Remove Chrome 115 extension error (#2258)
diff --git a/dwds/debug_extension_mv3/web/debug_session.dart b/dwds/debug_extension_mv3/web/debug_session.dart
index f5ffc8f..268556c 100644
--- a/dwds/debug_extension_mv3/web/debug_session.dart
+++ b/dwds/debug_extension_mv3/web/debug_session.dart
@@ -7,7 +7,6 @@
import 'dart:async';
import 'dart:convert';
-import 'dart:html';
import 'package:built_collection/built_collection.dart';
import 'package:collection/collection.dart' show IterableExtension;
@@ -45,9 +44,6 @@
final _debugSessions = <_DebugSession>[];
final _tabIdToTrigger = <int, Trigger>{};
-// TODO(elliette): Remove once regression is fixed in Chrome.
-const _chrome115Error = 'chrome115Error';
-
enum DetachReason {
canceledByUser,
connectionErrorEvent,
@@ -120,8 +116,6 @@
_tabIdToTrigger[dartAppTabId] = trigger;
_registerDebugEventListeners();
- // TODO(elliette): Remove once regression is fixed in Chrome.
- _registerChrome115NotificationListeners();
chrome.debugger.attach(
Debuggee(tabId: dartAppTabId),
'1.3',
@@ -441,12 +435,6 @@
? <String, Object>{}
: BuiltMap<String, Object>(json.decode(messageParams)).toMap();
- // TODO(elliette): Remove once regression is fixed in Chrome.
- if (_shouldSkipEventForChrome115Bug(message.command)) {
- _showChrome115ErrorNotification(message.command, tabId);
- return;
- }
-
chrome.debugger.sendCommand(
Debuggee(tabId: tabId),
message.command,
@@ -489,52 +477,6 @@
}
}
-bool _shouldSkipEventForChrome115Bug(String command) {
- final unsupportedOnChrome115 = command.contains('Debugger.setBreakpoint') ||
- command.contains('Debugger.pause');
- if (unsupportedOnChrome115) {
- final chromeVersionMatch =
- RegExp('Chrome/([0-9.]+)').firstMatch(window.navigator.userAgent);
- final chromeVersion = chromeVersionMatch?[0];
- return chromeVersion?.startsWith('Chrome/115') ?? false;
- }
- return false;
-}
-
-void _showChrome115ErrorNotification(String command, int tabId) {
- chrome.notifications.create(
- // notificationId
- '$_chrome115Error-$tabId',
- NotificationOptions(
- title: '[Error] Dart Debug Extension',
- message:
- 'Regression in Chrome 115 prevents $command. Click here for more details.',
- iconUrl: 'static_assets/dart.png',
- type: 'basic',
- ),
- // callback
- null,
- );
-}
-
-void _registerChrome115NotificationListeners() {
- chrome.notifications.onClicked.addListener(
- allowInterop((notificationId) async {
- if (notificationId.startsWith(_chrome115Error)) {
- final tabId = notificationId.split('-')[1];
- final debugInfo = await fetchStorageObject<DebugInfo>(
- type: StorageObject.debugInfo,
- tabId: int.parse(tabId),
- );
- final bugLink = debugInfo?.isInternalBuild ?? false
- ? 'https://bugs.chromium.org/p/chromium/issues/detail?id=1469092'
- : 'https://github.com/Dart-Code/Dart-Code/issues/4664';
- await createTab(bugLink);
- }
- }),
- );
-}
-
void _forwardChromeDebuggerEventToDwds(
Debuggee source,
String method,