66library ;
77
88import 'package:dwds/data/debug_info.dart' ;
9+ // TODO: https://github.com/dart-lang/webdev/issues/2508
10+ // ignore: deprecated_member_use
911import 'package:js/js.dart' ;
1012
1113import 'chrome_api.dart' ;
@@ -23,9 +25,7 @@ void main() {
2325}
2426
2527void _registerListeners () {
26- chrome.runtime.onMessage.addListener (
27- allowInterop (_handleRuntimeMessages),
28- );
28+ chrome.runtime.onMessage.addListener (allowInterop (_handleRuntimeMessages));
2929 // The only extension allowed to send messages to this extension is the
3030 // AngularDart DevTools extension. Its permission is set in the manifest.json
3131 // externally_connectable field.
@@ -34,8 +34,9 @@ void _registerListeners() {
3434 );
3535 // The only external service that sends messages to the Dart Debug Extension
3636 // is Cider.
37- chrome.runtime.onConnectExternal
38- .addListener (allowInterop (handleCiderConnectRequest));
37+ chrome.runtime.onConnectExternal.addListener (
38+ allowInterop (handleCiderConnectRequest),
39+ );
3940 // Update the extension icon on tab navigation:
4041 chrome.tabs.onActivated.addListener (
4142 allowInterop ((ActiveInfo info) async {
@@ -50,11 +51,13 @@ void _registerListeners() {
5051 }
5152 }),
5253 );
53- chrome.webNavigation.onCommitted
54- .addListener (allowInterop (_detectNavigationAwayFromDartApp));
54+ chrome.webNavigation.onCommitted.addListener (
55+ allowInterop (_detectNavigationAwayFromDartApp),
56+ );
5557
56- chrome.commands.onCommand
57- .addListener (allowInterop (_maybeSendCopyAppIdRequest));
58+ chrome.commands.onCommand.addListener (
59+ allowInterop (_maybeSendCopyAppIdRequest),
60+ );
5861}
5962
6063Future <void > _handleRuntimeMessages (
@@ -214,19 +217,20 @@ bool _isInternalNavigation(NavigationInfo navigationInfo) {
214217
215218DebugInfo _addTabInfo (DebugInfo debugInfo, {required Tab tab}) {
216219 return DebugInfo (
217- (b) => b
218- ..appEntrypointPath = debugInfo.appEntrypointPath
219- ..appId = debugInfo.appId
220- ..appInstanceId = debugInfo.appInstanceId
221- ..appOrigin = debugInfo.appOrigin
222- ..appUrl = debugInfo.appUrl
223- ..authUrl = debugInfo.authUrl
224- ..extensionUrl = debugInfo.extensionUrl
225- ..isInternalBuild = debugInfo.isInternalBuild
226- ..isFlutterApp = debugInfo.isFlutterApp
227- ..workspaceName = debugInfo.workspaceName
228- ..tabUrl = tab.url
229- ..tabId = tab.id,
220+ (b) =>
221+ b
222+ ..appEntrypointPath = debugInfo.appEntrypointPath
223+ ..appId = debugInfo.appId
224+ ..appInstanceId = debugInfo.appInstanceId
225+ ..appOrigin = debugInfo.appOrigin
226+ ..appUrl = debugInfo.appUrl
227+ ..authUrl = debugInfo.authUrl
228+ ..extensionUrl = debugInfo.extensionUrl
229+ ..isInternalBuild = debugInfo.isInternalBuild
230+ ..isFlutterApp = debugInfo.isFlutterApp
231+ ..workspaceName = debugInfo.workspaceName
232+ ..tabUrl = tab.url
233+ ..tabId = tab.id,
230234 );
231235}
232236
@@ -279,9 +283,7 @@ void _setDefaultIcon(int tabId) {
279283 final iconPath =
280284 isDevMode ? 'static_assets/dart_dev.png' : 'static_assets/dart_grey.png' ;
281285 setExtensionIcon (IconInfo (path: iconPath));
282- setExtensionPopup (
283- PopupDetails (popup: '' , tabId: tabId),
284- );
286+ setExtensionPopup (PopupDetails (popup: '' , tabId: tabId));
285287}
286288
287289Future <DebugInfo ?> _fetchDebugInfo (int tabId) {
0 commit comments