@@ -7,7 +7,6 @@ library debug_session;
7
7
8
8
import 'dart:async' ;
9
9
import 'dart:convert' ;
10
- import 'dart:html' ;
11
10
12
11
import 'package:built_collection/built_collection.dart' ;
13
12
import 'package:collection/collection.dart' show IterableExtension;
@@ -45,9 +44,6 @@ const _devToolsAlreadyOpenedAlert =
45
44
final _debugSessions = < _DebugSession > [];
46
45
final _tabIdToTrigger = < int , Trigger > {};
47
46
48
- // TODO(elliette): Remove once regression is fixed in Chrome.
49
- const _chrome115Error = 'chrome115Error' ;
50
-
51
47
enum DetachReason {
52
48
canceledByUser,
53
49
connectionErrorEvent,
@@ -120,8 +116,6 @@ Future<void> attachDebugger(
120
116
121
117
_tabIdToTrigger[dartAppTabId] = trigger;
122
118
_registerDebugEventListeners ();
123
- // TODO(elliette): Remove once regression is fixed in Chrome.
124
- _registerChrome115NotificationListeners ();
125
119
chrome.debugger.attach (
126
120
Debuggee (tabId: dartAppTabId),
127
121
'1.3' ,
@@ -441,12 +435,6 @@ void _forwardDwdsEventToChromeDebugger(
441
435
? < String , Object > {}
442
436
: BuiltMap <String , Object >(json.decode (messageParams)).toMap ();
443
437
444
- // TODO(elliette): Remove once regression is fixed in Chrome.
445
- if (_shouldSkipEventForChrome115Bug (message.command)) {
446
- _showChrome115ErrorNotification (message.command, tabId);
447
- return ;
448
- }
449
-
450
438
chrome.debugger.sendCommand (
451
439
Debuggee (tabId: tabId),
452
440
message.command,
@@ -489,52 +477,6 @@ void _forwardDwdsEventToChromeDebugger(
489
477
}
490
478
}
491
479
492
- bool _shouldSkipEventForChrome115Bug (String command) {
493
- final unsupportedOnChrome115 = command.contains ('Debugger.setBreakpoint' ) ||
494
- command.contains ('Debugger.pause' );
495
- if (unsupportedOnChrome115) {
496
- final chromeVersionMatch =
497
- RegExp ('Chrome/([0-9.]+)' ).firstMatch (window.navigator.userAgent);
498
- final chromeVersion = chromeVersionMatch? [0 ];
499
- return chromeVersion? .startsWith ('Chrome/115' ) ?? false ;
500
- }
501
- return false ;
502
- }
503
-
504
- void _showChrome115ErrorNotification (String command, int tabId) {
505
- chrome.notifications.create (
506
- // notificationId
507
- '$_chrome115Error -$tabId ' ,
508
- NotificationOptions (
509
- title: '[Error] Dart Debug Extension' ,
510
- message:
511
- 'Regression in Chrome 115 prevents $command . Click here for more details.' ,
512
- iconUrl: 'static_assets/dart.png' ,
513
- type: 'basic' ,
514
- ),
515
- // callback
516
- null ,
517
- );
518
- }
519
-
520
- void _registerChrome115NotificationListeners () {
521
- chrome.notifications.onClicked.addListener (
522
- allowInterop ((notificationId) async {
523
- if (notificationId.startsWith (_chrome115Error)) {
524
- final tabId = notificationId.split ('-' )[1 ];
525
- final debugInfo = await fetchStorageObject <DebugInfo >(
526
- type: StorageObject .debugInfo,
527
- tabId: int .parse (tabId),
528
- );
529
- final bugLink = debugInfo? .isInternalBuild ?? false
530
- ? 'https://bugs.chromium.org/p/chromium/issues/detail?id=1469092'
531
- : 'https://github.com/Dart-Code/Dart-Code/issues/4664' ;
532
- await createTab (bugLink);
533
- }
534
- }),
535
- );
536
- }
537
-
538
480
void _forwardChromeDebuggerEventToDwds (
539
481
Debuggee source,
540
482
String method,
0 commit comments