chrome-devtools-frontend 1.0.1012379 → 1.0.1013298

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/config/gni/devtools_grd_files.gni +3 -0
  2. package/front_end/core/host/UserMetrics.ts +4 -2
  3. package/front_end/core/i18n/locales/en-US.json +38 -2
  4. package/front_end/core/i18n/locales/en-XL.json +38 -2
  5. package/front_end/core/root/Runtime.ts +1 -0
  6. package/front_end/core/sdk/CSSFontFace.ts +6 -0
  7. package/front_end/entrypoints/main/MainImpl.ts +4 -0
  8. package/front_end/generated/InspectorBackendCommands.js +2 -0
  9. package/front_end/generated/protocol.ts +16 -0
  10. package/front_end/panels/application/AppManifestView.ts +12 -1
  11. package/front_end/panels/application/DOMStorageItemsView.ts +5 -5
  12. package/front_end/panels/application/components/ProtocolHandlersView.ts +182 -0
  13. package/front_end/panels/application/components/components.ts +2 -0
  14. package/front_end/panels/application/components/protocolHandlersView.css +39 -0
  15. package/front_end/panels/profiler/HeapSnapshotView.ts +3 -1
  16. package/front_end/panels/sources/NavigatorView.ts +50 -22
  17. package/front_end/panels/sources/SourcesNavigator.ts +45 -1
  18. package/front_end/panels/sources/SourcesPanel.ts +26 -4
  19. package/front_end/panels/sources/navigatorTree.css +4 -0
  20. package/front_end/panels/sources/sourcesNavigator.css +10 -0
  21. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +15 -15
  22. package/front_end/third_party/lighthouse/report/bundle.d.ts +23 -2
  23. package/front_end/third_party/lighthouse/report/bundle.js +45 -19
  24. package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
  25. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +16 -11
  26. package/front_end/ui/components/linear_memory_inspector/linearMemoryInspector.css +4 -0
  27. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +35 -14
  28. package/front_end/ui/components/panel_feedback/previewToggle.css +21 -1
  29. package/front_end/ui/legacy/ContextMenu.ts +11 -2
  30. package/package.json +1 -1
  31. package/scripts/build/ninja/devtools_entrypoint.gni +3 -3
  32. package/scripts/build/ninja/wasm.gni +25 -0
  33. package/scripts/build/wasm-as.py +87 -0
  34. package/scripts/build/wasm_sourcemap.mjs +22 -0
  35. package/scripts/eslint_rules/lib/lit_template_result_or_nothing.js +6 -0
@@ -847,6 +847,7 @@ grd_files_debug_sources = [
847
847
  "front_end/panels/application/components/InterestGroupAccessGrid.js",
848
848
  "front_end/panels/application/components/OriginTrialTreeView.js",
849
849
  "front_end/panels/application/components/PermissionsPolicySection.js",
850
+ "front_end/panels/application/components/ProtocolHandlersView.js",
850
851
  "front_end/panels/application/components/ReportsGrid.js",
851
852
  "front_end/panels/application/components/StackTrace.js",
852
853
  "front_end/panels/application/components/TrustTokensView.js",
@@ -857,6 +858,7 @@ grd_files_debug_sources = [
857
858
  "front_end/panels/application/components/originTrialTokenRows.css.js",
858
859
  "front_end/panels/application/components/originTrialTreeView.css.js",
859
860
  "front_end/panels/application/components/permissionsPolicySection.css.js",
861
+ "front_end/panels/application/components/protocolHandlersView.css.js",
860
862
  "front_end/panels/application/components/reportingApiGrid.css.js",
861
863
  "front_end/panels/application/components/stackTraceLinkButton.css.js",
862
864
  "front_end/panels/application/components/stackTraceRow.css.js",
@@ -1252,6 +1254,7 @@ grd_files_debug_sources = [
1252
1254
  "front_end/panels/sources/navigatorTree.css.js",
1253
1255
  "front_end/panels/sources/navigatorView.css.js",
1254
1256
  "front_end/panels/sources/scopeChainSidebarPane.css.js",
1257
+ "front_end/panels/sources/sourcesNavigator.css.js",
1255
1258
  "front_end/panels/sources/sourcesPanel.css.js",
1256
1259
  "front_end/panels/sources/sourcesView.css.js",
1257
1260
  "front_end/panels/sources/threadsSidebarPane.css.js",
@@ -345,7 +345,8 @@ export enum Action {
345
345
  PerfPanelTraceImported = 54,
346
346
  PerfPanelTraceExported = 55,
347
347
  StackFrameRestarted = 56,
348
- MaxValue = 57,
348
+ CaptureTestProtocolClicked = 57,
349
+ MaxValue = 58,
349
350
  }
350
351
 
351
352
  /* eslint-disable @typescript-eslint/naming-convention */
@@ -627,8 +628,9 @@ export enum DevtoolsExperiments {
627
628
  'eyedropperColorPicker' = 60,
628
629
  'instrumentationBreakpoints' = 61,
629
630
  'cssAuthoringHints' = 62,
631
+ 'authoredDeployedGrouping' = 63,
630
632
  // Increment this when new experiments are added.
631
- 'MaxValue' = 63,
633
+ 'MaxValue' = 64,
632
634
  }
633
635
  /* eslint-enable @typescript-eslint/naming-convention */
634
636
 
@@ -2426,6 +2426,9 @@
2426
2426
  "panels/application/AppManifestView.ts | primaryManifestIconFromS": {
2427
2427
  "message": "Primary manifest icon from {PH1}"
2428
2428
  },
2429
+ "panels/application/AppManifestView.ts | protocolHandlers": {
2430
+ "message": "Protocol Handlers"
2431
+ },
2429
2432
  "panels/application/AppManifestView.ts | screenshot": {
2430
2433
  "message": "Screenshot"
2431
2434
  },
@@ -3197,6 +3200,24 @@
3197
3200
  "panels/application/components/PermissionsPolicySection.ts | showDetails": {
3198
3201
  "message": "Show details"
3199
3202
  },
3203
+ "panels/application/components/ProtocolHandlersView.ts | manifest": {
3204
+ "message": "manifest"
3205
+ },
3206
+ "panels/application/components/ProtocolHandlersView.ts | needHelpReadOur": {
3207
+ "message": "Need help? Read {PH1}."
3208
+ },
3209
+ "panels/application/components/ProtocolHandlersView.ts | protocolDetected": {
3210
+ "message": "Found valid protocol handler registration in the {PH1}. With the app installed, test the registered protocols."
3211
+ },
3212
+ "panels/application/components/ProtocolHandlersView.ts | protocolHandlerRegistrations": {
3213
+ "message": "URL protocol handler registration for PWAs"
3214
+ },
3215
+ "panels/application/components/ProtocolHandlersView.ts | protocolNotDetected": {
3216
+ "message": "Define protocol handlers in the {PH1} to register your app as a handler for custom protocols when your app is installed."
3217
+ },
3218
+ "panels/application/components/ProtocolHandlersView.ts | testProtocol": {
3219
+ "message": "Test protocol"
3220
+ },
3200
3221
  "panels/application/components/ReportsGrid.ts | destination": {
3201
3222
  "message": "Destination"
3202
3223
  },
@@ -3291,7 +3312,7 @@
3291
3312
  "message": "DOM Storage Items"
3292
3313
  },
3293
3314
  "panels/application/DOMStorageItemsView.ts | domStorageItemsCleared": {
3294
- "message": "{PH1} cleared"
3315
+ "message": "DOM Storage Items cleared"
3295
3316
  },
3296
3317
  "panels/application/DOMStorageItemsView.ts | domStorageNumberEntries": {
3297
3318
  "message": "Number of entries shown in table: {PH1}"
@@ -9794,6 +9815,9 @@
9794
9815
  "panels/sources/NavigatorView.ts | authored": {
9795
9816
  "message": "Authored"
9796
9817
  },
9818
+ "panels/sources/NavigatorView.ts | authoredTooltip": {
9819
+ "message": "Contains original sources"
9820
+ },
9797
9821
  "panels/sources/NavigatorView.ts | delete": {
9798
9822
  "message": "Delete"
9799
9823
  },
@@ -9803,6 +9827,9 @@
9803
9827
  "panels/sources/NavigatorView.ts | deployed": {
9804
9828
  "message": "Deployed"
9805
9829
  },
9830
+ "panels/sources/NavigatorView.ts | deployedTooltip": {
9831
+ "message": "Contains final sources the browser sees"
9832
+ },
9806
9833
  "panels/sources/NavigatorView.ts | excludeFolder": {
9807
9834
  "message": "Exclude folder"
9808
9835
  },
@@ -10163,6 +10190,9 @@
10163
10190
  "panels/sources/sources-meta.ts | watch": {
10164
10191
  "message": "Watch"
10165
10192
  },
10193
+ "panels/sources/SourcesNavigator.ts | authoredDescription": {
10194
+ "message": "Group files by Authored/Deployed"
10195
+ },
10166
10196
  "panels/sources/SourcesNavigator.ts | clearConfiguration": {
10167
10197
  "message": "Clear configuration"
10168
10198
  },
@@ -10233,7 +10263,7 @@
10233
10263
  "message": "Drop workspace folder here"
10234
10264
  },
10235
10265
  "panels/sources/SourcesPanel.ts | groupByAuthored": {
10236
- "message": "Group by Authored/Deployed (experimental)"
10266
+ "message": "Group by Authored/Deployed"
10237
10267
  },
10238
10268
  "panels/sources/SourcesPanel.ts | groupByFolder": {
10239
10269
  "message": "Group by folder"
@@ -11906,9 +11936,15 @@
11906
11936
  "ui/components/panel_feedback/PanelFeedback.ts | videoAndDocumentation": {
11907
11937
  "message": "Video and documentation"
11908
11938
  },
11939
+ "ui/components/panel_feedback/PreviewToggle.ts | learnMoreLink": {
11940
+ "message": "Learn More"
11941
+ },
11909
11942
  "ui/components/panel_feedback/PreviewToggle.ts | previewTextFeedbackLink": {
11910
11943
  "message": "Send us your feedback."
11911
11944
  },
11945
+ "ui/components/panel_feedback/PreviewToggle.ts | shortFeedbackLink": {
11946
+ "message": "Send feedback"
11947
+ },
11912
11948
  "ui/components/request_link_icon/RequestLinkIcon.ts | clickToShowRequestInTheNetwork": {
11913
11949
  "message": "Click to open the network panel and show request for URL: {url}"
11914
11950
  },
@@ -2426,6 +2426,9 @@
2426
2426
  "panels/application/AppManifestView.ts | primaryManifestIconFromS": {
2427
2427
  "message": "P̂ŕîḿâŕŷ ḿâńîf́êśt̂ íĉón̂ f́r̂óm̂ {PH1}"
2428
2428
  },
2429
+ "panels/application/AppManifestView.ts | protocolHandlers": {
2430
+ "message": "P̂ŕôt́ôćôĺ Ĥán̂d́l̂ér̂ś"
2431
+ },
2429
2432
  "panels/application/AppManifestView.ts | screenshot": {
2430
2433
  "message": "Ŝćr̂éêńŝh́ôt́"
2431
2434
  },
@@ -3197,6 +3200,24 @@
3197
3200
  "panels/application/components/PermissionsPolicySection.ts | showDetails": {
3198
3201
  "message": "Ŝh́ôẃ d̂ét̂áîĺŝ"
3199
3202
  },
3203
+ "panels/application/components/ProtocolHandlersView.ts | manifest": {
3204
+ "message": "m̂án̂íf̂éŝt́"
3205
+ },
3206
+ "panels/application/components/ProtocolHandlersView.ts | needHelpReadOur": {
3207
+ "message": "N̂éêd́ ĥél̂ṕ? R̂éâd́ {PH1}."
3208
+ },
3209
+ "panels/application/components/ProtocolHandlersView.ts | protocolDetected": {
3210
+ "message": "F̂óûńd̂ v́âĺîd́ p̂ŕôt́ôćôĺ ĥán̂d́l̂ér̂ ŕêǵîśt̂ŕât́îón̂ ín̂ t́ĥé {PH1}. Ŵít̂h́ t̂h́ê áp̂ṕ îńŝt́âĺl̂éd̂, t́êśt̂ t́ĥé r̂éĝíŝt́êŕêd́ p̂ŕôt́ôćôĺŝ."
3211
+ },
3212
+ "panels/application/components/ProtocolHandlersView.ts | protocolHandlerRegistrations": {
3213
+ "message": "ÛŔL̂ ṕr̂ót̂óĉól̂ h́âńd̂ĺêŕ r̂éĝíŝt́r̂át̂íôń f̂ór̂ ṔŴÁŝ"
3214
+ },
3215
+ "panels/application/components/ProtocolHandlersView.ts | protocolNotDetected": {
3216
+ "message": "D̂éf̂ín̂é p̂ŕôt́ôćôĺ ĥán̂d́l̂ér̂ś îń t̂h́ê {PH1} t́ô ŕêǵîśt̂ér̂ ýôúr̂ áp̂ṕ âś â h́âńd̂ĺêŕ f̂ór̂ ćûśt̂óm̂ ṕr̂ót̂óĉól̂ś ŵh́êń ŷóûŕ âṕp̂ íŝ ín̂śt̂ál̂ĺêd́."
3217
+ },
3218
+ "panels/application/components/ProtocolHandlersView.ts | testProtocol": {
3219
+ "message": "T̂éŝt́ p̂ŕôt́ôćôĺ"
3220
+ },
3200
3221
  "panels/application/components/ReportsGrid.ts | destination": {
3201
3222
  "message": "D̂éŝt́îńât́îón̂"
3202
3223
  },
@@ -3291,7 +3312,7 @@
3291
3312
  "message": "D̂ÓM̂ Śt̂ór̂áĝé Ît́êḿŝ"
3292
3313
  },
3293
3314
  "panels/application/DOMStorageItemsView.ts | domStorageItemsCleared": {
3294
- "message": "{PH1} ĉĺêár̂éd̂"
3315
+ "message": "D̂ÓM̂ Śt̂ór̂áĝé Ît́êḿŝ ćl̂éâŕêd́"
3295
3316
  },
3296
3317
  "panels/application/DOMStorageItemsView.ts | domStorageNumberEntries": {
3297
3318
  "message": "N̂úm̂b́êŕ ôf́ êńt̂ŕîéŝ śĥóŵń îń t̂áb̂ĺê: {PH1}"
@@ -9794,6 +9815,9 @@
9794
9815
  "panels/sources/NavigatorView.ts | authored": {
9795
9816
  "message": "Âút̂h́ôŕêd́"
9796
9817
  },
9818
+ "panels/sources/NavigatorView.ts | authoredTooltip": {
9819
+ "message": "Ĉón̂t́âín̂ś ôŕîǵîńâĺ ŝóûŕĉéŝ"
9820
+ },
9797
9821
  "panels/sources/NavigatorView.ts | delete": {
9798
9822
  "message": "D̂él̂ét̂é"
9799
9823
  },
@@ -9803,6 +9827,9 @@
9803
9827
  "panels/sources/NavigatorView.ts | deployed": {
9804
9828
  "message": "D̂ép̂ĺôýêd́"
9805
9829
  },
9830
+ "panels/sources/NavigatorView.ts | deployedTooltip": {
9831
+ "message": "Ĉón̂t́âín̂ś f̂ín̂ál̂ śôúr̂ćêś t̂h́ê b́r̂óŵśêŕ ŝéêś"
9832
+ },
9806
9833
  "panels/sources/NavigatorView.ts | excludeFolder": {
9807
9834
  "message": "Êx́ĉĺûd́ê f́ôĺd̂ér̂"
9808
9835
  },
@@ -10163,6 +10190,9 @@
10163
10190
  "panels/sources/sources-meta.ts | watch": {
10164
10191
  "message": "Ŵát̂ćĥ"
10165
10192
  },
10193
+ "panels/sources/SourcesNavigator.ts | authoredDescription": {
10194
+ "message": "Ĝŕôúp̂ f́îĺêś b̂ý Âút̂h́ôŕêd́/D̂ép̂ĺôýêd́"
10195
+ },
10166
10196
  "panels/sources/SourcesNavigator.ts | clearConfiguration": {
10167
10197
  "message": "Ĉĺêár̂ ćôńf̂íĝúr̂át̂íôń"
10168
10198
  },
@@ -10233,7 +10263,7 @@
10233
10263
  "message": "D̂ŕôṕ ŵór̂ḱŝṕâćê f́ôĺd̂ér̂ h́êŕê"
10234
10264
  },
10235
10265
  "panels/sources/SourcesPanel.ts | groupByAuthored": {
10236
- "message": "Ĝŕôúp̂ b́ŷ Áût́ĥór̂éd̂/D́êṕl̂óŷéd̂ (éx̂ṕêŕîḿêńt̂ál̂)"
10266
+ "message": "Ĝŕôúp̂ b́ŷ Áût́ĥór̂éd̂/D́êṕl̂óŷéd̂"
10237
10267
  },
10238
10268
  "panels/sources/SourcesPanel.ts | groupByFolder": {
10239
10269
  "message": "Ĝŕôúp̂ b́ŷ f́ôĺd̂ér̂"
@@ -11906,9 +11936,15 @@
11906
11936
  "ui/components/panel_feedback/PanelFeedback.ts | videoAndDocumentation": {
11907
11937
  "message": "V̂íd̂éô án̂d́ d̂óĉúm̂én̂t́ât́îón̂"
11908
11938
  },
11939
+ "ui/components/panel_feedback/PreviewToggle.ts | learnMoreLink": {
11940
+ "message": "L̂éâŕn̂ Ḿôŕê"
11941
+ },
11909
11942
  "ui/components/panel_feedback/PreviewToggle.ts | previewTextFeedbackLink": {
11910
11943
  "message": "Ŝén̂d́ ûś ŷóûŕ f̂éêd́b̂áĉḱ."
11911
11944
  },
11945
+ "ui/components/panel_feedback/PreviewToggle.ts | shortFeedbackLink": {
11946
+ "message": "Ŝén̂d́ f̂éêd́b̂áĉḱ"
11947
+ },
11912
11948
  "ui/components/request_link_icon/RequestLinkIcon.ts | clickToShowRequestInTheNetwork": {
11913
11949
  "message": "Ĉĺîćk̂ t́ô óp̂én̂ t́ĥé n̂ét̂ẃôŕk̂ ṕâńêĺ âńd̂ śĥóŵ ŕêq́ûéŝt́ f̂ór̂ ÚR̂Ĺ: {url}"
11914
11950
  },
@@ -292,6 +292,7 @@ export enum ExperimentName {
292
292
  EYEDROPPER_COLOR_PICKER = 'eyedropperColorPicker',
293
293
  INSTRUMENTATION_BREAKPOINTS = 'instrumentationBreakpoints',
294
294
  CSS_AUTHORING_HINTS = 'cssAuthoringHints',
295
+ AUTHORED_DEPLOYED_GROUPING = 'authoredDeployedGrouping',
295
296
  }
296
297
 
297
298
  // TODO(crbug.com/1167717): Make this a const enum again
@@ -10,12 +10,14 @@ export class CSSFontFace {
10
10
  readonly #fontVariationAxes: Protocol.CSS.FontVariationAxis[];
11
11
  readonly #fontVariationAxesByTag: Map<string, Protocol.CSS.FontVariationAxis>;
12
12
  readonly #src: Platform.DevToolsPath.UrlString;
13
+ readonly #fontDisplay: string;
13
14
 
14
15
  constructor(payload: Protocol.CSS.FontFace) {
15
16
  this.#fontFamily = payload.fontFamily;
16
17
  this.#fontVariationAxes = payload.fontVariationAxes || [];
17
18
  this.#fontVariationAxesByTag = new Map();
18
19
  this.#src = payload.src as Platform.DevToolsPath.UrlString;
20
+ this.#fontDisplay = payload.fontDisplay;
19
21
  for (const axis of this.#fontVariationAxes) {
20
22
  this.#fontVariationAxesByTag.set(axis.tag, axis);
21
23
  }
@@ -29,6 +31,10 @@ export class CSSFontFace {
29
31
  return this.#src;
30
32
  }
31
33
 
34
+ getFontDisplay(): string {
35
+ return this.#fontDisplay;
36
+ }
37
+
32
38
  getVariationAxisByTag(tag: string): Protocol.CSS.FontVariationAxis|undefined {
33
39
  return this.#fontVariationAxesByTag.get(tag);
34
40
  }
@@ -402,6 +402,10 @@ export class MainImpl {
402
402
  Root.Runtime.experiments.register(
403
403
  Root.Runtime.ExperimentName.EYEDROPPER_COLOR_PICKER, 'Enable color picking outside the browser window');
404
404
 
405
+ // Change grouping of sources panel to use Authored/Deployed trees
406
+ Root.Runtime.experiments.register(
407
+ Root.Runtime.ExperimentName.AUTHORED_DEPLOYED_GROUPING, 'Group sources into Authored and Deployed trees');
408
+
405
409
  Root.Runtime.experiments.enableExperimentsByDefault([
406
410
  'sourceOrderViewer',
407
411
  'hideIssuesFeature',
@@ -287,6 +287,7 @@ export function registerCommands(inspectorBackend) {
287
287
  GeolocationInsecureOriginDeprecatedNotRemoved: 'GeolocationInsecureOriginDeprecatedNotRemoved',
288
288
  GetUserMediaInsecureOrigin: 'GetUserMediaInsecureOrigin',
289
289
  HostCandidateAttributeGetter: 'HostCandidateAttributeGetter',
290
+ IdentityInCanMakePaymentEvent: 'IdentityInCanMakePaymentEvent',
290
291
  InsecurePrivateNetworkSubresourceRequest: 'InsecurePrivateNetworkSubresourceRequest',
291
292
  LegacyConstraintGoogIPv6: 'LegacyConstraintGoogIPv6',
292
293
  LocalCSSFileExtensionRejected: 'LocalCSSFileExtensionRejected',
@@ -296,6 +297,7 @@ export function registerCommands(inspectorBackend) {
296
297
  NotificationInsecureOrigin: 'NotificationInsecureOrigin',
297
298
  NotificationPermissionRequestedIframe: 'NotificationPermissionRequestedIframe',
298
299
  ObsoleteWebRtcCipherSuite: 'ObsoleteWebRtcCipherSuite',
300
+ OpenWebDatabaseInsecureContext: 'OpenWebDatabaseInsecureContext',
299
301
  PictureSourceSrc: 'PictureSourceSrc',
300
302
  PrefixedCancelAnimationFrame: 'PrefixedCancelAnimationFrame',
301
303
  PrefixedRequestAnimationFrame: 'PrefixedRequestAnimationFrame',
@@ -1034,6 +1034,7 @@ export namespace Audits {
1034
1034
  GeolocationInsecureOriginDeprecatedNotRemoved = 'GeolocationInsecureOriginDeprecatedNotRemoved',
1035
1035
  GetUserMediaInsecureOrigin = 'GetUserMediaInsecureOrigin',
1036
1036
  HostCandidateAttributeGetter = 'HostCandidateAttributeGetter',
1037
+ IdentityInCanMakePaymentEvent = 'IdentityInCanMakePaymentEvent',
1037
1038
  InsecurePrivateNetworkSubresourceRequest = 'InsecurePrivateNetworkSubresourceRequest',
1038
1039
  LegacyConstraintGoogIPv6 = 'LegacyConstraintGoogIPv6',
1039
1040
  LocalCSSFileExtensionRejected = 'LocalCSSFileExtensionRejected',
@@ -1043,6 +1044,7 @@ export namespace Audits {
1043
1044
  NotificationInsecureOrigin = 'NotificationInsecureOrigin',
1044
1045
  NotificationPermissionRequestedIframe = 'NotificationPermissionRequestedIframe',
1045
1046
  ObsoleteWebRtcCipherSuite = 'ObsoleteWebRtcCipherSuite',
1047
+ OpenWebDatabaseInsecureContext = 'OpenWebDatabaseInsecureContext',
1046
1048
  PictureSourceSrc = 'PictureSourceSrc',
1047
1049
  PrefixedCancelAnimationFrame = 'PrefixedCancelAnimationFrame',
1048
1050
  PrefixedRequestAnimationFrame = 'PrefixedRequestAnimationFrame',
@@ -1785,6 +1787,10 @@ export namespace CSS {
1785
1787
  * Pseudo element type.
1786
1788
  */
1787
1789
  pseudoType: DOM.PseudoType;
1790
+ /**
1791
+ * Pseudo element custom ident.
1792
+ */
1793
+ pseudoIdentifier?: string;
1788
1794
  /**
1789
1795
  * Matches of CSS rules applicable to the pseudo style.
1790
1796
  */
@@ -3172,6 +3178,11 @@ export namespace DOM {
3172
3178
  * Pseudo element type for this node.
3173
3179
  */
3174
3180
  pseudoType?: PseudoType;
3181
+ /**
3182
+ * Pseudo element identifier for this node. Only present if there is a
3183
+ * valid pseudoType.
3184
+ */
3185
+ pseudoIdentifier?: string;
3175
3186
  /**
3176
3187
  * Shadow root type.
3177
3188
  */
@@ -4760,6 +4771,11 @@ export namespace DOMSnapshot {
4760
4771
  * Type of a pseudo element node.
4761
4772
  */
4762
4773
  pseudoType?: RareStringData;
4774
+ /**
4775
+ * Pseudo element identifier for this node. Only present if there is a
4776
+ * valid pseudoType.
4777
+ */
4778
+ pseudoIdentifier?: RareStringData;
4763
4779
  /**
4764
4780
  * Whether this DOM node responds to mouse clicks. This includes nodes that have had click
4765
4781
  * event listeners attached via JavaScript as well as anchor tags that naturally navigate when
@@ -15,6 +15,7 @@ import * as Components from '../../ui/legacy/components/utils/utils.js';
15
15
  import * as UI from '../../ui/legacy/legacy.js';
16
16
  import type * as Protocol from '../../generated/protocol.js';
17
17
  import * as IconButton from '../../ui/components/icon_button/icon_button.js';
18
+ import * as ApplicationComponents from './components/components.js';
18
19
 
19
20
  const UIStrings = {
20
21
  /**
@@ -44,6 +45,10 @@ const UIStrings = {
44
45
  /**
45
46
  *@description Text in App Manifest View of the Application panel
46
47
  */
48
+ protocolHandlers: 'Protocol Handlers',
49
+ /**
50
+ *@description Text in App Manifest View of the Application panel
51
+ */
47
52
  icons: 'Icons',
48
53
  /**
49
54
  *@description Text for the name of something
@@ -423,6 +428,7 @@ export class AppManifestView extends UI.Widget.VBox implements SDK.TargetManager
423
428
  private target?: SDK.Target.Target;
424
429
  private resourceTreeModel?: SDK.ResourceTreeModel.ResourceTreeModel|null;
425
430
  private serviceWorkerManager?: SDK.ServiceWorkerManager.ServiceWorkerManager|null;
431
+ private protocolHandlersView: ApplicationComponents.ProtocolHandlersView.ProtocolHandlersView;
426
432
  constructor() {
427
433
  super(true);
428
434
 
@@ -448,8 +454,10 @@ export class AppManifestView extends UI.Widget.VBox implements SDK.TargetManager
448
454
  this.errorsSection = this.reportView.appendSection(i18nString(UIStrings.errorsAndWarnings));
449
455
  this.installabilitySection = this.reportView.appendSection(i18nString(UIStrings.installability));
450
456
  this.identitySection = this.reportView.appendSection(i18nString(UIStrings.identity));
451
-
452
457
  this.presentationSection = this.reportView.appendSection(i18nString(UIStrings.presentation));
458
+ const protocolHandlersSection = this.reportView.appendSection(i18nString(UIStrings.protocolHandlers));
459
+ this.protocolHandlersView = new ApplicationComponents.ProtocolHandlersView.ProtocolHandlersView();
460
+ protocolHandlersSection.contentElement.append(this.protocolHandlersView);
453
461
  this.iconsSection = this.reportView.appendSection(i18nString(UIStrings.icons), 'report-section-icons');
454
462
  this.shortcutSections = [];
455
463
  this.screenshotsSections = [];
@@ -701,6 +709,9 @@ export class AppManifestView extends UI.Widget.VBox implements SDK.TargetManager
701
709
  this.newNoteUrlField.appendChild(link);
702
710
  }
703
711
 
712
+ const protocolHandlers = parsedManifest['protocol_handlers'] || [];
713
+ this.protocolHandlersView.data = {protocolHandlers, manifestLink: url};
714
+
704
715
  const icons = parsedManifest['icons'] || [];
705
716
  this.iconsSection.clearContent();
706
717
 
@@ -53,14 +53,14 @@ const UIStrings = {
53
53
  */
54
54
  value: 'Value',
55
55
  /**
56
- *@description Data grid name for DOM Storage Items data grids
56
+ *@description Name for the "DOM Storage Items" table that shows the content of the DOM Storage.
57
57
  */
58
58
  domStorageItems: 'DOM Storage Items',
59
59
  /**
60
- *@description Text for announcing number of entries after filtering
61
- *@example {'DOM Storage Items'} PH1
60
+ *@description Text for announcing that the "DOM Storage Items" table was cleared, that is, all
61
+ * entries were deleted.
62
62
  */
63
- domStorageItemsCleared: '{PH1} cleared',
63
+ domStorageItemsCleared: 'DOM Storage Items cleared',
64
64
  /**
65
65
  *@description Text in DOMStorage Items View of the Application panel
66
66
  */
@@ -154,7 +154,7 @@ export class DOMStorageItemsView extends StorageItemsView {
154
154
 
155
155
  this.dataGrid.rootNode().removeChildren();
156
156
  this.dataGrid.addCreationNode(false);
157
- UI.ARIAUtils.alert(i18nString(UIStrings.domStorageItemsCleared, {PH1: this.dataGrid.displayName}));
157
+ UI.ARIAUtils.alert(i18nString(UIStrings.domStorageItemsCleared));
158
158
  this.setCanDeleteSelected(false);
159
159
  }
160
160
 
@@ -0,0 +1,182 @@
1
+ // Copyright 2022 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import * as Host from '../../../core/host/host.js';
6
+ import * as i18n from '../../../core/i18n/i18n.js';
7
+ import * as Platform from '../../../core/platform/platform.js';
8
+ import * as Buttons from '../../../ui/components/buttons/buttons.js';
9
+ import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
10
+ import * as IconButton from '../../../ui/components/icon_button/icon_button.js';
11
+ import * as Input from '../../../ui/components/input/input.js';
12
+ // inspectorCommonStyles is imported for the chrome-select class that is used for the dropdown
13
+ // eslint-disable-next-line rulesdir/es_modules_import
14
+ import inspectorCommonStyles from '../../../ui/legacy/inspectorCommon.css.js';
15
+ import * as UI from '../../../ui/legacy/legacy.js';
16
+ import * as LitHtml from '../../../ui/lit-html/lit-html.js';
17
+
18
+ import protocolHandlersViewStyles from './protocolHandlersView.css.js';
19
+
20
+ const PROTOCOL_DOCUMENT_URL = 'https://web.dev/url-protocol-handler/';
21
+ const UIStrings = {
22
+ /**
23
+ *@description Status message for when protocol handlers are detected in the manifest
24
+ *@example {protocolhandler/manifest.json} PH1
25
+ */
26
+ protocolDetected:
27
+ 'Found valid protocol handler registration in the {PH1}. With the app installed, test the registered protocols.',
28
+ /**
29
+ *@description Status message for when protocol handlers are not detected in the manifest
30
+ *@example {protocolhandler/manifest.json} PH1
31
+ */
32
+ protocolNotDetected:
33
+ 'Define protocol handlers in the {PH1} to register your app as a handler for custom protocols when your app is installed.',
34
+ /**
35
+ *@description Text wrapping a link pointing to more information on handling protocol handlers
36
+ *@example {https://example.com/} PH1
37
+ */
38
+ needHelpReadOur: 'Need help? Read {PH1}.',
39
+ /**
40
+ *@description Link text for more information on URL protocol handler registrations for PWAs
41
+ */
42
+ protocolHandlerRegistrations: 'URL protocol handler registration for PWAs',
43
+ /**
44
+ *@description In text hyperlink to the PWA manifest
45
+ */
46
+ manifest: 'manifest',
47
+ /**
48
+ *@description Text for test protocol button
49
+ */
50
+ testProtocol: 'Test protocol',
51
+ };
52
+
53
+ const str_ = i18n.i18n.registerUIStrings('panels/application/components/ProtocolHandlersView.ts', UIStrings);
54
+ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
55
+
56
+ interface HTMLSelectElementEvent extends Event {
57
+ target: HTMLSelectElement;
58
+ }
59
+
60
+ interface HTMLInputElementEvent extends Event {
61
+ target: HTMLInputElement;
62
+ }
63
+
64
+ export interface ProtocolHandler {
65
+ protocol: string;
66
+ url: string;
67
+ }
68
+
69
+ export interface ProtocolHandlersData {
70
+ protocolHandlers: ProtocolHandler[];
71
+ manifestLink: Platform.DevToolsPath.UrlString;
72
+ }
73
+
74
+ export class ProtocolHandlersView extends HTMLElement {
75
+ static readonly litTagName = LitHtml.literal`devtools-protocol-handlers-view`;
76
+ readonly #shadow = this.attachShadow({mode: 'open'});
77
+ #protocolHandlers: ProtocolHandler[] = [];
78
+ #manifestLink: Platform.DevToolsPath.UrlString = Platform.DevToolsPath.EmptyUrlString;
79
+ #selectedProtocolState: string = '';
80
+ #queryInputState: string = '';
81
+
82
+ set data(data: ProtocolHandlersData) {
83
+ const isNewManifest = this.#manifestLink !== data.manifestLink;
84
+ this.#protocolHandlers = data.protocolHandlers;
85
+ this.#manifestLink = data.manifestLink;
86
+ if (isNewManifest) {
87
+ this.#update();
88
+ }
89
+ }
90
+
91
+ #update(): void {
92
+ this.#queryInputState = '';
93
+ this.#selectedProtocolState = this.#protocolHandlers[0]?.protocol ?? '';
94
+ this.#render();
95
+ }
96
+
97
+ #renderStatusMessage(): LitHtml.TemplateResult {
98
+ const manifestInTextLink = UI.XLink.XLink.create(this.#manifestLink, i18nString(UIStrings.manifest));
99
+ const statusString = this.#protocolHandlers.length > 0 ? UIStrings.protocolDetected : UIStrings.protocolNotDetected;
100
+ const iconData: IconButton.Icon.IconData = {
101
+ iconName: this.#protocolHandlers.length > 0 ? 'ic_checkmark_16x16' : 'ic_info_black_18dp',
102
+ color: this.#protocolHandlers.length > 0 ? 'var( --color-ic-file-image)' : 'var(--color-link)',
103
+ width: '16px',
104
+ };
105
+ return LitHtml.html`
106
+ <div class="protocol-handlers-row status">
107
+ <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${iconData as IconButton.Icon.IconData}>
108
+ </${IconButton.Icon.Icon.litTagName}>
109
+ ${i18n.i18n.getFormatLocalizedString(str_, statusString, {
110
+ PH1: manifestInTextLink,
111
+ })}
112
+ </div>
113
+ `;
114
+ }
115
+
116
+ #renderProtocolTest(): LitHtml.LitTemplate {
117
+ if (this.#protocolHandlers.length === 0) {
118
+ return LitHtml.nothing;
119
+ }
120
+ const protocolOptions = this.#protocolHandlers.filter(p => p.protocol)
121
+ .map(p => LitHtml.html`<option value=${p.protocol}>${p.protocol}://</option>`);
122
+ return LitHtml.html`
123
+ <div class="protocol-handlers-row">
124
+ <select class="chrome-select protocol-select" @change=${this.#handleProtocolSelect}>
125
+ ${protocolOptions}
126
+ </select>
127
+ <input .value=${this.#queryInputState} class="devtools-text-input" type="text" @change=${
128
+ this.#handleQueryInputChange}/>
129
+ <${Buttons.Button.Button.litTagName} .variant=${Buttons.Button.Variant.PRIMARY} @click=${
130
+ this.#handleTestProtocolClick}>
131
+ ${i18nString(UIStrings.testProtocol)}
132
+ </${Buttons.Button.Button.litTagName}>
133
+ </div>
134
+ `;
135
+ }
136
+
137
+ #handleProtocolSelect = (evt: HTMLSelectElementEvent): void => {
138
+ this.#selectedProtocolState = evt.target.value;
139
+ };
140
+
141
+ #handleQueryInputChange = (evt: HTMLInputElementEvent): void => {
142
+ this.#queryInputState = evt.target.value;
143
+ this.#render();
144
+ };
145
+
146
+ #handleTestProtocolClick = (): void => {
147
+ const protocolURL = `${this.#selectedProtocolState}://${this.#queryInputState}` as Platform.DevToolsPath.UrlString;
148
+ Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(protocolURL);
149
+ Host.userMetrics.actionTaken(Host.UserMetrics.Action.CaptureTestProtocolClicked);
150
+ };
151
+
152
+ connectedCallback(): void {
153
+ this.#shadow.adoptedStyleSheets = [
154
+ protocolHandlersViewStyles,
155
+ inspectorCommonStyles,
156
+ Input.textInputStyles,
157
+ ];
158
+ }
159
+
160
+ #render(): void {
161
+ const protocolDocLink =
162
+ UI.XLink.XLink.create(PROTOCOL_DOCUMENT_URL, i18nString(UIStrings.protocolHandlerRegistrations));
163
+ // clang-format off
164
+ LitHtml.render(LitHtml.html`
165
+ ${this.#renderStatusMessage()}
166
+ <div class="protocol-handlers-row">
167
+ ${i18n.i18n.getFormatLocalizedString(str_, UIStrings.needHelpReadOur, {PH1: protocolDocLink})}
168
+ </div>
169
+ ${this.#renderProtocolTest()}
170
+ `, this.#shadow, {host: this});
171
+ // clang-format on
172
+ }
173
+ }
174
+
175
+ ComponentHelpers.CustomElements.defineComponent('devtools-protocol-handlers-view', ProtocolHandlersView);
176
+
177
+ declare global {
178
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
179
+ interface HTMLElementTagNameMap {
180
+ 'devtools-protocol-handlers-view': ProtocolHandlersView;
181
+ }
182
+ }
@@ -7,6 +7,7 @@ import * as EndpointsGrid from './EndpointsGrid.js';
7
7
  import * as FrameDetailsView from './FrameDetailsView.js';
8
8
  import * as InterestGroupAccessGrid from './InterestGroupAccessGrid.js';
9
9
  import * as OriginTrialTreeView from './OriginTrialTreeView.js';
10
+ import * as ProtocolHandlersView from './ProtocolHandlersView.js';
10
11
  import * as ReportsGrid from './ReportsGrid.js';
11
12
  import * as StackTrace from './StackTrace.js';
12
13
  import * as TrustTokensView from './TrustTokensView.js';
@@ -17,6 +18,7 @@ export {
17
18
  FrameDetailsView,
18
19
  InterestGroupAccessGrid,
19
20
  OriginTrialTreeView,
21
+ ProtocolHandlersView,
20
22
  ReportsGrid,
21
23
  StackTrace,
22
24
  TrustTokensView,