6
6
library ;
7
7
8
8
import 'package:dwds/data/debug_info.dart' ;
9
+ // TODO: https://github.com/dart-lang/webdev/issues/2508
10
+ // ignore: deprecated_member_use
9
11
import 'package:js/js.dart' ;
10
12
11
13
import 'chrome_api.dart' ;
@@ -23,9 +25,7 @@ void main() {
23
25
}
24
26
25
27
void _registerListeners () {
26
- chrome.runtime.onMessage.addListener (
27
- allowInterop (_handleRuntimeMessages),
28
- );
28
+ chrome.runtime.onMessage.addListener (allowInterop (_handleRuntimeMessages));
29
29
// The only extension allowed to send messages to this extension is the
30
30
// AngularDart DevTools extension. Its permission is set in the manifest.json
31
31
// externally_connectable field.
@@ -34,8 +34,9 @@ void _registerListeners() {
34
34
);
35
35
// The only external service that sends messages to the Dart Debug Extension
36
36
// is Cider.
37
- chrome.runtime.onConnectExternal
38
- .addListener (allowInterop (handleCiderConnectRequest));
37
+ chrome.runtime.onConnectExternal.addListener (
38
+ allowInterop (handleCiderConnectRequest),
39
+ );
39
40
// Update the extension icon on tab navigation:
40
41
chrome.tabs.onActivated.addListener (
41
42
allowInterop ((ActiveInfo info) async {
@@ -50,11 +51,13 @@ void _registerListeners() {
50
51
}
51
52
}),
52
53
);
53
- chrome.webNavigation.onCommitted
54
- .addListener (allowInterop (_detectNavigationAwayFromDartApp));
54
+ chrome.webNavigation.onCommitted.addListener (
55
+ allowInterop (_detectNavigationAwayFromDartApp),
56
+ );
55
57
56
- chrome.commands.onCommand
57
- .addListener (allowInterop (_maybeSendCopyAppIdRequest));
58
+ chrome.commands.onCommand.addListener (
59
+ allowInterop (_maybeSendCopyAppIdRequest),
60
+ );
58
61
}
59
62
60
63
Future <void > _handleRuntimeMessages (
@@ -214,19 +217,20 @@ bool _isInternalNavigation(NavigationInfo navigationInfo) {
214
217
215
218
DebugInfo _addTabInfo (DebugInfo debugInfo, {required Tab tab}) {
216
219
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,
230
234
);
231
235
}
232
236
@@ -279,9 +283,7 @@ void _setDefaultIcon(int tabId) {
279
283
final iconPath =
280
284
isDevMode ? 'static_assets/dart_dev.png' : 'static_assets/dart_grey.png' ;
281
285
setExtensionIcon (IconInfo (path: iconPath));
282
- setExtensionPopup (
283
- PopupDetails (popup: '' , tabId: tabId),
284
- );
286
+ setExtensionPopup (PopupDetails (popup: '' , tabId: tabId));
285
287
}
286
288
287
289
Future <DebugInfo ?> _fetchDebugInfo (int tabId) {
0 commit comments