chrome-devtools-frontend 1.0.947377 → 1.0.948916

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 (124) hide show
  1. package/config/gni/all_devtools_files.gni +1 -6
  2. package/config/gni/devtools_grd_files.gni +5 -12
  3. package/config/gni/devtools_image_files.gni +1 -0
  4. package/front_end/.eslintrc.js +1 -0
  5. package/front_end/Images/src/circled_backslash_icon.svg +3 -0
  6. package/front_end/core/host/UserMetrics.ts +1 -1
  7. package/front_end/core/i18n/locales/en-US.json +32 -44
  8. package/front_end/core/i18n/locales/en-XL.json +32 -44
  9. package/front_end/core/platform/platform.ts +0 -2
  10. package/front_end/core/platform/string-utilities.ts +14 -1
  11. package/front_end/core/platform/utilities.ts +0 -29
  12. package/front_end/core/root/Runtime.ts +4 -207
  13. package/front_end/core/sdk/Cookie.ts +0 -21
  14. package/front_end/core/sdk/RemoteObject.ts +15 -1
  15. package/front_end/core/sdk/sdk-legacy.ts +0 -3
  16. package/front_end/entrypoints/devtools_app/{devtools_app-meta-files.ts → devtools_app.ts} +9 -3
  17. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +2 -1
  18. package/front_end/entrypoints/js_app/{JsMain.ts → js_app.ts} +5 -1
  19. package/front_end/entrypoints/main/MainImpl.ts +0 -1
  20. package/front_end/entrypoints/ndb_app/{ndb_app.js → ndb_app.ts} +0 -2
  21. package/front_end/entrypoints/node_app/node_app.ts +1 -3
  22. package/front_end/entrypoints/shell/{shell.js → shell.ts} +0 -2
  23. package/front_end/entrypoints/visibility.gni +3 -1
  24. package/front_end/entrypoints/worker_app/worker_app.ts +1 -4
  25. package/front_end/generated/InspectorBackendCommands.js +8 -1
  26. package/front_end/generated/protocol-mapping.d.ts +4 -0
  27. package/front_end/generated/protocol-proxy-api.d.ts +6 -0
  28. package/front_end/generated/protocol.d.ts +9 -0
  29. package/front_end/legacy/legacy-defs.d.ts +0 -4
  30. package/front_end/legacy_test_runner/test_runner/TestRunner.js +35 -59
  31. package/front_end/models/issues_manager/AttributionReportingIssue.ts +27 -2
  32. package/front_end/models/issues_manager/CorsIssue.ts +15 -15
  33. package/front_end/models/issues_manager/descriptions/{corsInsecurePrivateNetworkPreflight.md → corsPreflightAllowPrivateNetworkError.md} +1 -1
  34. package/front_end/panels/accessibility/AccessibilitySidebarView.ts +3 -1
  35. package/front_end/panels/application/BackForwardCacheStrings.ts +1 -5
  36. package/front_end/panels/application/BackForwardCacheView.ts +150 -58
  37. package/front_end/panels/application/ResourcesPanel.ts +0 -42
  38. package/front_end/panels/application/application-legacy.ts +0 -3
  39. package/front_end/panels/application/application-meta.ts +0 -13
  40. package/front_end/panels/application/backForwardCacheView.css +44 -6
  41. package/front_end/panels/application/components/FrameDetailsView.ts +3 -3
  42. package/front_end/panels/application/components/OriginTrialTreeView.ts +3 -3
  43. package/front_end/panels/application/components/StackTrace.ts +1 -1
  44. package/front_end/panels/console/ConsolePrompt.ts +0 -4
  45. package/front_end/panels/coverage/CoverageView.ts +1 -1
  46. package/front_end/panels/css_overview/components/cssOverviewStartView.css +1 -0
  47. package/front_end/panels/css_overview/cssOverviewCompletedView.css +1 -1
  48. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +2 -1
  49. package/front_end/panels/elements/AccessibilityTreeUtils.ts +1 -7
  50. package/front_end/panels/elements/ElementsPanel.ts +9 -1
  51. package/front_end/panels/elements/ElementsTreeElement.ts +1 -1
  52. package/front_end/panels/elements/PropertiesWidget.ts +109 -4
  53. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
  54. package/front_end/panels/elements/propertiesWidget.css +34 -0
  55. package/front_end/panels/emulation/DeviceModeToolbar.ts +5 -1
  56. package/front_end/panels/issues/CorsIssueDetailsView.ts +20 -8
  57. package/front_end/panels/network/NetworkWaterfallColumn.ts +2 -0
  58. package/front_end/panels/profiler/CPUProfileFlameChart.ts +3 -1
  59. package/front_end/panels/profiler/ProfileDataGrid.ts +2 -1
  60. package/front_end/panels/settings/components/SyncSection.ts +2 -2
  61. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +46 -46
  62. package/front_end/panels/timeline/TimelineTreeView.ts +2 -1
  63. package/front_end/ui/components/diff_view/DiffView.ts +4 -4
  64. package/front_end/ui/components/helpers/component-server-setup.ts +1 -12
  65. package/front_end/ui/components/helpers/helpers.ts +0 -2
  66. package/front_end/ui/components/icon_button/IconButton.ts +1 -1
  67. package/front_end/ui/components/issue_counter/IssueCounter.ts +2 -2
  68. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +3 -3
  69. package/front_end/ui/components/markdown_view/MarkdownView.ts +4 -4
  70. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +98 -0
  71. package/front_end/ui/components/panel_feedback/panel_feedback.ts +1 -0
  72. package/front_end/ui/components/panel_feedback/previewToggle.css +24 -0
  73. package/front_end/ui/components/report_view/ReportView.ts +22 -0
  74. package/front_end/ui/components/report_view/reportSection.css +20 -0
  75. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
  76. package/front_end/ui/components/settings/SettingCheckbox.ts +2 -2
  77. package/front_end/ui/components/text_editor/config.ts +4 -3
  78. package/front_end/ui/components/text_editor/javascript.ts +8 -4
  79. package/front_end/ui/components/text_prompt/TextPrompt.ts +2 -2
  80. package/front_end/ui/legacy/GlassPane.ts +1 -1
  81. package/front_end/ui/legacy/SearchableView.ts +2 -1
  82. package/front_end/ui/legacy/Treeoutline.ts +1 -1
  83. package/front_end/ui/legacy/Widget.ts +1 -1
  84. package/front_end/ui/legacy/XWidget.ts +0 -5
  85. package/front_end/ui/legacy/components/inline_editor/CSSVarSwatch.ts +2 -2
  86. package/front_end/ui/legacy/components/inline_editor/ColorSwatch.ts +1 -1
  87. package/front_end/ui/legacy/utils/append-style.ts +2 -13
  88. package/front_end/ui/legacy/utils/create-shadow-root-with-core-styles.ts +7 -5
  89. package/package.json +2 -4
  90. package/scripts/build/build_inspector_overlay.py +15 -1
  91. package/scripts/build/rjsmin.py +84 -115
  92. package/scripts/eslint_rules/lib/ban_a_tags_in_lit_html.js +2 -11
  93. package/scripts/eslint_rules/lib/ban_literal_devtools_component_tag_names.js +2 -11
  94. package/scripts/eslint_rules/lib/ban_self_closing_custom_element_tagnames.js +2 -11
  95. package/scripts/eslint_rules/lib/ban_style_tags_in_lit_html.js +2 -11
  96. package/scripts/eslint_rules/lib/lit_html_data_as_type.js +2 -11
  97. package/scripts/eslint_rules/lib/lit_html_no_attribute_quotes.js +89 -0
  98. package/scripts/eslint_rules/lib/lit_no_style_interpolation.js +2 -11
  99. package/scripts/eslint_rules/lib/no_only_eslint_tests.js +53 -0
  100. package/scripts/eslint_rules/lib/static_tag_must_be_static_property.js +2 -11
  101. package/scripts/eslint_rules/lib/utils.js +29 -0
  102. package/scripts/eslint_rules/tests/.eslintrc.js +18 -0
  103. package/scripts/eslint_rules/tests/lit_html_no_attribute_quotes_test.js +45 -0
  104. package/scripts/eslint_rules/tests/no_only_eslint_tests_test.js +94 -0
  105. package/scripts/eslint_rules/tests/utils_test.js +40 -0
  106. package/front_end/entrypoints/devtools_app/devtools_app.js +0 -11
  107. package/front_end/entrypoints/devtools_app/devtools_app.json +0 -4
  108. package/front_end/entrypoints/js_app/js_app.js +0 -12
  109. package/front_end/entrypoints/js_app/js_app.json +0 -3
  110. package/front_end/entrypoints/ndb_app/ndb_app.json +0 -4
  111. package/front_end/entrypoints/startup/RuntimeInstantiator.ts +0 -95
  112. package/front_end/entrypoints/startup/startup.ts +0 -9
  113. package/front_end/panels/help/HelpImpl.ts +0 -141
  114. package/front_end/panels/help/ReleaseNoteText.ts +0 -1496
  115. package/front_end/panels/help/ReleaseNoteView.ts +0 -107
  116. package/front_end/panels/help/help-meta.ts +0 -145
  117. package/front_end/panels/help/help.ts +0 -13
  118. package/front_end/panels/help/releaseNote.css +0 -115
  119. package/front_end/ui/components/helpers/get-stylesheet.ts +0 -45
  120. package/scripts/build/build_release_applications.py +0 -216
  121. package/scripts/build/modular_build.py +0 -184
  122. package/scripts/check_gn.js +0 -119
  123. package/scripts/json_validator/module.schema.json +0 -19
  124. package/scripts/json_validator/validate_module_json.js +0 -44
@@ -23,6 +23,10 @@ self.Platform = self.Platform || {};
23
23
  self.Platform.StringUtilities = Platform.StringUtilities;
24
24
  self.Platform.MapUtilities = Platform.MapUtilities;
25
25
  self.Platform.ArrayUtilities = Platform.ArrayUtilities;
26
+ self.createPlainTextSearchRegex = Platform.StringUtilities.createPlainTextSearchRegex;
27
+ String.sprintf = Platform.StringUtilities.sprintf;
28
+ String.regexSpecialCharacters = Platform.StringUtilities.regexSpecialCharacters;
29
+ String.caseInsensetiveComparator = Platform.StringUtilities.caseInsensetiveComparator;
26
30
 
27
31
  /**
28
32
  * @return {boolean}
@@ -229,23 +233,36 @@ export function addSnifferPromise(receiver, methodName) {
229
233
  });
230
234
  }
231
235
 
232
- /** @type {function():void} */
233
- let _resolveOnFinishInits;
234
-
235
- /**
236
- * @param {string} module
237
- * @return {!Promise<undefined>}
238
- */
239
- export async function loadModule(module) {
240
- const promise = new Promise(resolve => {
241
- _resolveOnFinishInits = resolve;
242
- });
243
- await self.runtime.loadModulePromise(module);
244
- if (!_pendingInits) {
245
- return;
246
- }
247
- return promise;
248
- }
236
+ const mappingForLayoutTests = new Map([
237
+ ['panels/animation', 'animation'],
238
+ ['panels/browser_debugger', 'browser_debugger'],
239
+ ['panels/changes', 'changes'],
240
+ ['panels/console', 'console'],
241
+ ['panels/elements', 'elements'],
242
+ ['panels/emulation', 'emulation'],
243
+ ['panels/mobile_throttling', 'mobile_throttling'],
244
+ ['panels/network', 'network'],
245
+ ['panels/profiler', 'profiler'],
246
+ ['panels/application', 'resources'],
247
+ ['panels/search', 'search'],
248
+ ['panels/sources', 'sources'],
249
+ ['panels/snippets', 'snippets'],
250
+ ['panels/settings', 'settings'],
251
+ ['panels/timeline', 'timeline'],
252
+ ['panels/web_audio', 'web_audio'],
253
+ ['models/persistence', 'persistence'],
254
+ ['models/workspace_diff', 'workspace_diff'],
255
+ ['entrypoints/main', 'main'],
256
+ ['third_party/diff', 'diff'],
257
+ ['ui/legacy/components/inline_editor', 'inline_editor'],
258
+ ['ui/legacy/components/data_grid', 'data_grid'],
259
+ ['ui/legacy/components/perf_ui', 'perf_ui'],
260
+ ['ui/legacy/components/source_frame', 'source_frame'],
261
+ ['ui/legacy/components/color_picker', 'color_picker'],
262
+ ['ui/legacy/components/cookie_table', 'cookie_table'],
263
+ ['ui/legacy/components/quick_open', 'quick_open'],
264
+ ['ui/legacy/components/utils', 'components'],
265
+ ]);
249
266
 
250
267
  /**
251
268
  * @param {string} module
@@ -253,7 +270,7 @@ export async function loadModule(module) {
253
270
  */
254
271
  export async function loadLegacyModule(module) {
255
272
  let containingFolder = module;
256
- for (const [remappedFolder, originalFolder] of Root.Runtime.mappingForLayoutTests.entries()) {
273
+ for (const [remappedFolder, originalFolder] of mappingForLayoutTests.entries()) {
257
274
  if (originalFolder === module) {
258
275
  containingFolder = remappedFolder;
259
276
  }
@@ -667,9 +684,6 @@ export function addIframe(path, options = {}) {
667
684
  `);
668
685
  }
669
686
 
670
- /** @type {number} */
671
- let _pendingInits = 0;
672
-
673
687
  /**
674
688
  * The old test framework executed certain snippets in the inspected page
675
689
  * context as part of loading a test helper file.
@@ -685,12 +699,7 @@ let _pendingInits = 0;
685
699
  * @param {string} code
686
700
  */
687
701
  export async function deprecatedInitAsync(code) {
688
- _pendingInits++;
689
702
  await TestRunner.RuntimeAgent.invoke_evaluate({expression: code, objectGroup: 'console'});
690
- _pendingInits--;
691
- if (!_pendingInits && _resolveOnFinishInits !== undefined) {
692
- _resolveOnFinishInits();
693
- }
694
703
  }
695
704
 
696
705
  /**
@@ -1290,36 +1299,6 @@ export class MockSetting {
1290
1299
  }
1291
1300
  }
1292
1301
 
1293
- /**
1294
- * @return {!Array<!Root.Runtime.Module>}
1295
- */
1296
- export function loadedModules() {
1297
- return self.runtime.modules.filter(module => module.loadedForTest)
1298
- .filter(module => module.name() !== 'help')
1299
- .filter(module => module.name().indexOf('test_runner') === -1);
1300
- }
1301
-
1302
- /**
1303
- * @param {!Array<!Root.Runtime.Module>} relativeTo
1304
- * @return {!Array<!Root.Runtime.Module>}
1305
- */
1306
- export function dumpLoadedModules(relativeTo) {
1307
- const previous = new Set(relativeTo || []);
1308
- function moduleSorter(left, right) {
1309
- return Platform.StringUtilities.naturalOrderComparator(left.descriptor.name, right.descriptor.name);
1310
- }
1311
-
1312
- addResult('Loaded modules:');
1313
- const sortedLoadedModules = loadedModules().sort(moduleSorter);
1314
- for (const module of sortedLoadedModules) {
1315
- if (previous.has(module)) {
1316
- continue;
1317
- }
1318
- addResult(' ' + module.descriptor.name);
1319
- }
1320
- return sortedLoadedModules;
1321
- }
1322
-
1323
1302
  /**
1324
1303
  * @param {string} urlSuffix
1325
1304
  * @param {!Workspace.Workspace.projectTypes=} projectType
@@ -1511,13 +1490,10 @@ TestRunner.override = override;
1511
1490
  TestRunner.clearSpecificInfoFromStackFrames = clearSpecificInfoFromStackFrames;
1512
1491
  TestRunner.hideInspectorView = hideInspectorView;
1513
1492
  TestRunner.mainFrame = mainFrame;
1514
- TestRunner.loadedModules = loadedModules;
1515
- TestRunner.dumpLoadedModules = dumpLoadedModules;
1516
1493
  TestRunner.waitForUISourceCode = waitForUISourceCode;
1517
1494
  TestRunner.waitForUISourceCodeRemoved = waitForUISourceCodeRemoved;
1518
1495
  TestRunner.url = url;
1519
1496
  TestRunner.dumpSyntaxHighlight = dumpSyntaxHighlight;
1520
- TestRunner.loadModule = loadModule;
1521
1497
  TestRunner.loadLegacyModule = loadLegacyModule;
1522
1498
  TestRunner.loadTestModule = loadTestModule;
1523
1499
  TestRunner.evaluateInPageRemoteObject = evaluateInPageRemoteObject;
@@ -17,8 +17,13 @@ export const enum IssueCode {
17
17
  AttributionSourceUntrustworthyOrigin = 'AttributionReportingIssue::AttributionSourceUntrustworthyOrigin',
18
18
  AttributionUntrustworthyFrameOrigin = 'AttributionReportingIssue::AttributionUntrustworthyFrameOrigin',
19
19
  AttributionUntrustworthyOrigin = 'AttributionReportingIssue::AttributionUntrustworthyOrigin',
20
- AttributionTriggerDataTooLarge = 'AttrubtionReportingIssue::AttributionTriggerDataTooLarge',
21
- AttributionEventSourceTriggerDataTooLarge = 'AttrubtionReportingIssue::AttributionEventSourceTriggerDataTooLarge',
20
+ AttributionTriggerDataTooLarge = 'AttributionReportingIssue::AttributionTriggerDataTooLarge',
21
+ AttributionEventSourceTriggerDataTooLarge = 'AttributionReportingIssue::AttributionEventSourceTriggerDataTooLarge',
22
+ InvalidAttributionSourceExpiry = 'AttributionReportingIssue::InvalidAttributionSourceExpiry',
23
+ InvalidAttributionSourcePriority = 'AttributionReportingIssue::InvalidAttributionSourcePriority',
24
+ InvalidEventSourceTriggerData = 'AttributionReportingIssue::InvalidEventSourceTriggerData',
25
+ InvalidTriggerPriority = 'AttributionReportingIssue::InvalidTriggerPriority',
26
+ InvalidTriggerDedupKey = 'AttributionReportingIssue::InvalidTriggerDedupKey',
22
27
  }
23
28
 
24
29
  function getIssueCode(details: Protocol.Audits.AttributionReportingIssueDetails): IssueCode {
@@ -40,6 +45,16 @@ function getIssueCode(details: Protocol.Audits.AttributionReportingIssueDetails)
40
45
  return IssueCode.AttributionTriggerDataTooLarge;
41
46
  case Protocol.Audits.AttributionReportingIssueType.AttributionEventSourceTriggerDataTooLarge:
42
47
  return IssueCode.AttributionEventSourceTriggerDataTooLarge;
48
+ case Protocol.Audits.AttributionReportingIssueType.InvalidAttributionSourceExpiry:
49
+ return IssueCode.InvalidAttributionSourceExpiry;
50
+ case Protocol.Audits.AttributionReportingIssueType.InvalidAttributionSourcePriority:
51
+ return IssueCode.InvalidAttributionSourcePriority;
52
+ case Protocol.Audits.AttributionReportingIssueType.InvalidEventSourceTriggerData:
53
+ return IssueCode.InvalidEventSourceTriggerData;
54
+ case Protocol.Audits.AttributionReportingIssueType.InvalidTriggerPriority:
55
+ return IssueCode.InvalidTriggerPriority;
56
+ case Protocol.Audits.AttributionReportingIssueType.InvalidTriggerDedupKey:
57
+ return IssueCode.InvalidTriggerDedupKey;
43
58
  }
44
59
  }
45
60
 
@@ -108,6 +123,16 @@ export class AttributionReportingIssue extends Issue<IssueCode> {
108
123
  file: 'arAttributionEventSourceTriggerDataTooLarge.md',
109
124
  links: [],
110
125
  };
126
+ case IssueCode.InvalidAttributionSourceExpiry:
127
+ return null;
128
+ case IssueCode.InvalidAttributionSourcePriority:
129
+ return null;
130
+ case IssueCode.InvalidEventSourceTriggerData:
131
+ return null;
132
+ case IssueCode.InvalidTriggerPriority:
133
+ return null;
134
+ case IssueCode.InvalidTriggerDedupKey:
135
+ return null;
111
136
  }
112
137
  }
113
138
 
@@ -13,7 +13,7 @@ const UIStrings = {
13
13
  /**
14
14
  *@description Label for the link for CORS private network issues
15
15
  */
16
- corsForPrivateNetworksRfc: 'CORS for private networks (RFC1918)',
16
+ corsPrivateNetworkAccess: 'Private Network Access',
17
17
  /**
18
18
  *@description Label for the link for CORS network issues
19
19
  */
@@ -26,7 +26,6 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
26
26
  // eslint-disable-next-line rulesdir/const_enum
27
27
  export enum IssueCode {
28
28
  InsecurePrivateNetwork = 'CorsIssue::InsecurePrivateNetwork',
29
- InsecurePrivateNetworkPreflight = 'CorsIssue::InsecurePrivateNetworkPreflight',
30
29
  InvalidHeaderValues = 'CorsIssue::InvalidHeaders',
31
30
  WildcardOriginNotAllowed = 'CorsIssue::WildcardOriginWithCredentials',
32
31
  PreflightResponseInvalid = 'CorsIssue::PreflightResponseInvalid',
@@ -37,14 +36,15 @@ export enum IssueCode {
37
36
  RedirectContainsCredentials = 'CorsIssue::RedirectContainsCredentials',
38
37
  DisallowedByMode = 'CorsIssue::DisallowedByMode',
39
38
  CorsDisabledScheme = 'CorsIssue::CorsDisabledScheme',
39
+ // TODO(https://crbug.com/1263483): Remove this once it's removed from CDP.
40
40
  PreflightMissingAllowExternal = 'CorsIssue::PreflightMissingAllowExternal',
41
+ // TODO(https://crbug.com/1263483): Remove this once it's removed from CDP.
41
42
  PreflightInvalidAllowExternal = 'CorsIssue::PreflightInvalidAllowExternal',
42
43
  InvalidResponse = 'CorsIssue::InvalidResponse',
43
44
  NoCorsRedirectModeNotFollow = 'CorsIssue::NoCorsRedirectModeNotFollow',
44
45
  InvalidPrivateNetworkAccess = 'CorsIssue::InvalidPrivateNetworkAccess',
45
46
  UnexpectedPrivateNetworkAccess = 'CorsIssue::UnexpectedPrivateNetworkAccess',
46
- PreflightMissingAllowPrivateNetwork = 'CorsIssue::PreflightMissingAllowPrivateNetwork',
47
- PreflightInvalidAllowPrivateNetwork = 'CorsIssue::PreflightInvalidAllowPrivateNetwork',
47
+ PreflightAllowPrivateNetworkError = 'CorsIssue::PreflightAllowPrivateNetworkError',
48
48
  }
49
49
 
50
50
  function getIssueCode(details: Protocol.Audits.CorsIssueDetails): IssueCode {
@@ -87,8 +87,7 @@ function getIssueCode(details: Protocol.Audits.CorsIssueDetails): IssueCode {
87
87
  case Protocol.Network.CorsError.InvalidResponse:
88
88
  return IssueCode.InvalidResponse;
89
89
  case Protocol.Network.CorsError.InsecurePrivateNetwork:
90
- return details.clientSecurityState?.initiatorIsSecureContext ? IssueCode.InsecurePrivateNetworkPreflight :
91
- IssueCode.InsecurePrivateNetwork;
90
+ return IssueCode.InsecurePrivateNetwork;
92
91
  case Protocol.Network.CorsError.NoCorsRedirectModeNotFollow:
93
92
  return IssueCode.NoCorsRedirectModeNotFollow;
94
93
  case Protocol.Network.CorsError.InvalidPrivateNetworkAccess:
@@ -96,9 +95,8 @@ function getIssueCode(details: Protocol.Audits.CorsIssueDetails): IssueCode {
96
95
  case Protocol.Network.CorsError.UnexpectedPrivateNetworkAccess:
97
96
  return IssueCode.UnexpectedPrivateNetworkAccess;
98
97
  case Protocol.Network.CorsError.PreflightMissingAllowPrivateNetwork:
99
- return IssueCode.PreflightMissingAllowPrivateNetwork;
100
98
  case Protocol.Network.CorsError.PreflightInvalidAllowPrivateNetwork:
101
- return IssueCode.PreflightInvalidAllowPrivateNetwork;
99
+ return IssueCode.PreflightAllowPrivateNetworkError;
102
100
  }
103
101
  }
104
102
 
@@ -127,15 +125,15 @@ export class CorsIssue extends Issue<IssueCode> {
127
125
  file: 'corsInsecurePrivateNetwork.md',
128
126
  links: [{
129
127
  link: 'https://developer.chrome.com/blog/private-network-access-update',
130
- linkTitle: i18nString(UIStrings.corsForPrivateNetworksRfc),
128
+ linkTitle: i18nString(UIStrings.corsPrivateNetworkAccess),
131
129
  }],
132
130
  };
133
- case IssueCode.InsecurePrivateNetworkPreflight:
131
+ case IssueCode.PreflightAllowPrivateNetworkError:
134
132
  return {
135
- file: 'corsInsecurePrivateNetworkPreflight.md',
133
+ file: 'corsPreflightAllowPrivateNetworkError.md',
136
134
  links: [{
137
135
  link: 'https://developer.chrome.com/blog/private-network-access-update',
138
- linkTitle: i18nString(UIStrings.corsForPrivateNetworksRfc),
136
+ linkTitle: i18nString(UIStrings.corsPrivateNetworkAccess),
139
137
  }],
140
138
  };
141
139
  case IssueCode.InvalidHeaderValues:
@@ -231,8 +229,6 @@ export class CorsIssue extends Issue<IssueCode> {
231
229
  case IssueCode.InvalidResponse:
232
230
  case IssueCode.InvalidPrivateNetworkAccess:
233
231
  case IssueCode.UnexpectedPrivateNetworkAccess:
234
- case IssueCode.PreflightMissingAllowPrivateNetwork:
235
- case IssueCode.PreflightInvalidAllowPrivateNetwork:
236
232
  return null;
237
233
  }
238
234
  }
@@ -243,7 +239,11 @@ export class CorsIssue extends Issue<IssueCode> {
243
239
 
244
240
  getKind(): IssueKind {
245
241
  if (this.issueDetails.isWarning &&
246
- this.issueDetails.corsErrorStatus.corsError === Protocol.Network.CorsError.InsecurePrivateNetwork) {
242
+ (this.issueDetails.corsErrorStatus.corsError === Protocol.Network.CorsError.InsecurePrivateNetwork ||
243
+ this.issueDetails.corsErrorStatus.corsError ===
244
+ Protocol.Network.CorsError.PreflightMissingAllowPrivateNetwork ||
245
+ this.issueDetails.corsErrorStatus.corsError ===
246
+ Protocol.Network.CorsError.PreflightInvalidAllowPrivateNetwork)) {
247
247
  return IssueKind.BreakingChange;
248
248
  }
249
249
  return IssueKind.PageError;
@@ -3,7 +3,7 @@
3
3
  A site requested a resource from a network that it could only access because of its users' privileged network position.
4
4
  These requests expose devices and servers to the internet, increasing the risk of a cross-site request forgery (CSRF) attack, and/or information leakage.
5
5
 
6
- To mitigate these risks, a future version of Chrome will require non-public subresources to opt-into being accessed with a preflight request.
6
+ To mitigate these risks, Chrome will require non-public subresources to opt-into being accessed with a preflight request and will start blocking them in Chrome 101 (April 2022).
7
7
 
8
8
  To fix this issue, ensure that response to the [preflight request](issueCorsPreflightRequest) for the private network resource has the `Access-Control-Allow-Private-Network` header set to `true`.
9
9
 
@@ -107,7 +107,9 @@ export class AccessibilitySidebarView extends UI.ThrottledWidget.ThrottledWidget
107
107
  if (!accessibilityModel) {
108
108
  return;
109
109
  }
110
- accessibilityModel.clear();
110
+ if (!Root.Runtime.experiments.isEnabled('fullAccessibilityTree')) {
111
+ accessibilityModel.clear();
112
+ }
111
113
  await accessibilityModel.requestPartialAXTree(node);
112
114
  this.accessibilityNodeCallback(accessibilityModel.axNodeForDOMNode(node));
113
115
  }
@@ -154,10 +154,6 @@ const UIStrings = {
154
154
  * @description Description text for not restored reason BackForwardCacheDisabledForDelegate.
155
155
  */
156
156
  backForwardCacheDisabledForDelegate: 'Back/forward cache is not supported by delegate.',
157
- /**
158
- * @description Description text for not restored reason OptInUnloadHeaderNotPresent.
159
- */
160
- optInUnloadHeaderNotPresent: 'The page has unload handler without the back/forward cache opt-in header.',
161
157
  /**
162
158
  * @description Description text for not restored reason UnloadHandlerExistsInMainFrame.
163
159
  */
@@ -466,7 +462,7 @@ export const NotRestoredReasonDescription = {
466
462
  'UserAgentOverrideDiffers': {name: i18nLazyString(UIStrings.userAgentOverrideDiffers)},
467
463
  'ForegroundCacheLimit': {name: i18nLazyString(UIStrings.foregroundCacheLimit)},
468
464
  'BackForwardCacheDisabledForDelegate': {name: i18nLazyString(UIStrings.backForwardCacheDisabledForDelegate)},
469
- 'OptInUnloadHeaderNotPresent': {name: i18nLazyString(UIStrings.optInUnloadHeaderNotPresent)},
465
+ 'OptInUnloadHeaderNotPresent': {name: i18nLazyString(UIStrings.unloadHandlerExistsInMainFrame)},
470
466
  'UnloadHandlerExistsInMainFrame': {name: i18nLazyString(UIStrings.unloadHandlerExistsInMainFrame)},
471
467
  'UnloadHandlerExistsInSubFrame': {name: i18nLazyString(UIStrings.unloadHandlerExistsInSubFrame)},
472
468
  'ServiceWorkerUnregistration': {name: i18nLazyString(UIStrings.serviceWorkerUnregistration)},
@@ -31,25 +31,22 @@ const UIStrings = {
31
31
  /**
32
32
  * @description Entry name text in the back/forward cache view of the Application panel
33
33
  */
34
- url: 'URL',
35
- /**
36
- * @description Entry name text in the back/forward cache view of the Application panel
37
- */
38
- bfcacheStatus: 'Back/forward cache Status',
34
+ url: 'URL:',
39
35
  /**
40
36
  * @description Status text for the status of the back/forward cache status
41
37
  */
42
- unknown: 'unknown',
38
+ unknown: 'Unknown Status',
43
39
  /**
44
40
  * @description Status text for the status of the back/forward cache status indicating that
45
41
  * the back/forward cache was not used and a normal navigation occured instead.
46
42
  */
47
- normalNavigation: 'Normal navigation (Not restored from back/forward cache)',
43
+ normalNavigation:
44
+ 'Not served from back/forward cache: to trigger back/forward cache, use Chrome\'s back/forward buttons, or use the test button below to automatically navigate away and back.',
48
45
  /**
49
46
  * @description Status text for the status of the back/forward cache status indicating that
50
47
  * the back/forward cache was used to restore the page instead of reloading it.
51
48
  */
52
- restoredFromBFCache: 'Restored from back/forward cache',
49
+ restoredFromBFCache: 'Successfully served from back/forward cache.',
53
50
  /**
54
51
  * @description Label for a list of reasons which prevent the page from being eligible for
55
52
  * back/forward cache. These reasons are actionable i.e. they can be cleaned up to make the
@@ -81,9 +78,17 @@ const UIStrings = {
81
78
  */
82
79
  supportPending: 'Pending Support',
83
80
  /**
84
- * @description Button name for showing whether BFCache is available in the pages.
81
+ * @description Label for the button to test whether BFCache is available for the page
82
+ */
83
+ runTest: 'Test back/forward cache',
84
+ /**
85
+ * @description Label for the disabled button while the test is running
85
86
  */
86
- runTest: 'Run Test',
87
+ runningTest: 'Running test',
88
+ /**
89
+ * @description Link Text about explanation of back/forward cache
90
+ */
91
+ learnMore: 'Learn more: back/forward cache eligibility',
87
92
  /**
88
93
  * @description Explanation for 'pending support' items which prevent the page from being eligible
89
94
  * for back/forward cache.
@@ -94,6 +99,11 @@ const UIStrings = {
94
99
  const str_ = i18n.i18n.registerUIStrings('panels/application/BackForwardCacheView.ts', UIStrings);
95
100
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
96
101
 
102
+ const enum ScreenStatusType {
103
+ Running = 'Running',
104
+ Result = 'Result',
105
+ }
106
+
97
107
  export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
98
108
  constructor() {
99
109
  super(true, 1000);
@@ -102,8 +112,11 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
102
112
  this.getMainResourceTreeModel()?.addEventListener(
103
113
  SDK.ResourceTreeModel.Events.BackForwardCacheDetailsUpdated, this.onBackForwardCacheUpdate, this);
104
114
  this.update();
115
+ this.screenStatus = ScreenStatusType.Result;
105
116
  }
106
117
 
118
+ private screenStatus: ScreenStatusType;
119
+
107
120
  wasShown(): void {
108
121
  super.wasShown();
109
122
  this.registerCSSFiles([backForwardCacheViewStyles]);
@@ -117,7 +130,7 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
117
130
  const data = {reportTitle: i18nString(UIStrings.backForwardCacheTitle)};
118
131
  const html = LitHtml.html`
119
132
  <${ReportView.ReportView.Report.litTagName} .data=${data as ReportView.ReportView.ReportData}>
120
- ${this.renderMainFrameInformation(this.getMainFrame())}
133
+ ${this.renderMainFrameInformation(this.getMainFrame())}
121
134
  </${ReportView.ReportView.Report.litTagName}>
122
135
  `;
123
136
  LitHtml.render(html, this.contentElement, {host: this});
@@ -132,10 +145,20 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
132
145
  return this.getMainResourceTreeModel()?.mainFrame || null;
133
146
  }
134
147
 
148
+ private renderBackForwardCacheTestResult(): void {
149
+ SDK.TargetManager.TargetManager.instance().removeModelListener(
150
+ SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameNavigated,
151
+ this.renderBackForwardCacheTestResult, this);
152
+ this.screenStatus = ScreenStatusType.Result;
153
+ this.update();
154
+ }
155
+
135
156
  private async goBackOneHistoryEntry(): Promise<void> {
136
157
  SDK.TargetManager.TargetManager.instance().removeModelListener(
137
158
  SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameNavigated,
138
159
  this.goBackOneHistoryEntry, this);
160
+ this.screenStatus = ScreenStatusType.Running;
161
+ this.update();
139
162
  const mainTarget = SDK.TargetManager.TargetManager.instance().mainTarget();
140
163
  if (!mainTarget) {
141
164
  return;
@@ -148,6 +171,9 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
148
171
  if (!historyResults) {
149
172
  return;
150
173
  }
174
+ SDK.TargetManager.TargetManager.instance().addModelListener(
175
+ SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.FrameNavigated,
176
+ this.renderBackForwardCacheTestResult, this);
151
177
  resourceTreeModel.navigateToHistoryEntry(historyResults.entries[historyResults.currentIndex - 1]);
152
178
  }
153
179
 
@@ -176,41 +202,97 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
176
202
 
177
203
  private renderMainFrameInformation(mainFrame: SDK.ResourceTreeModel.ResourceTreeFrame|null): LitHtml.TemplateResult {
178
204
  if (!mainFrame) {
179
- return LitHtml.html`<${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.mainFrame)}</${
180
- ReportView.ReportView.ReportKey.litTagName}>
181
- <${ReportView.ReportView.ReportValue.litTagName}>
182
- ${i18nString(UIStrings.unavailable)}
183
- </${ReportView.ReportView.ReportValue.litTagName}>`;
205
+ // clang-format off
206
+ return LitHtml.html`
207
+ <${ReportView.ReportView.ReportKey.litTagName}>
208
+ ${i18nString(UIStrings.mainFrame)}
209
+ </${ReportView.ReportView.ReportKey.litTagName}>
210
+ <${ReportView.ReportView.ReportValue.litTagName}>
211
+ ${i18nString(UIStrings.unavailable)}
212
+ </${ReportView.ReportView.ReportValue.litTagName}>
213
+ `;
214
+ // clang-format on
184
215
  }
216
+ const isDisabled = this.screenStatus === ScreenStatusType.Running;
217
+ // clang-format off
185
218
  return LitHtml.html`
186
- <${ReportView.ReportView.ReportSectionHeader.litTagName}>
187
- <${Buttons.Button.Button.litTagName}
188
- .variant=${Buttons.Button.Variant.PRIMARY}
189
- @click=${this.navigateAwayAndBack}>
219
+ ${this.renderBackForwardCacheStatus(mainFrame.backForwardCacheDetails.restoredFromCache)}
220
+ <div class='url'>
221
+ <div class='url-key'>
222
+ ${i18nString(UIStrings.url)}
223
+ </div>
224
+ <div class='url-value'>
225
+ ${mainFrame.url}
226
+ </div>
227
+ </div>
228
+ <${ReportView.ReportView.ReportSection.litTagName}>
229
+ <${Buttons.Button.Button.litTagName}
230
+ .disabled=${isDisabled}
231
+ .spinner=${isDisabled}
232
+ .variant=${Buttons.Button.Variant.PRIMARY}
233
+ @click=${this.navigateAwayAndBack}>
234
+ ${isDisabled ? LitHtml.html`
235
+ ${i18nString(UIStrings.runningTest)}`:`
190
236
  ${i18nString(UIStrings.runTest)}
191
- </${Buttons.Button.Button.litTagName}>
192
- </${ReportView.ReportView.ReportSectionHeader.litTagName}>
193
- <${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.url)}</${
194
- ReportView.ReportView.ReportKey.litTagName}>
195
- <${ReportView.ReportView.ReportValue.litTagName}>${mainFrame.url}</${
196
- ReportView.ReportView.ReportValue.litTagName}>
197
- <${ReportView.ReportView.ReportKey.litTagName}>${i18nString(UIStrings.bfcacheStatus)}</${
198
- ReportView.ReportView.ReportKey.litTagName}>
199
- <${ReportView.ReportView.ReportValue.litTagName}>${
200
- this.renderBackForwardCacheStatus(
201
- mainFrame.backForwardCacheDetails.restoredFromCache)}</${ReportView.ReportView.ReportValue.litTagName}>
202
- ${this.maybeRenderExplanations(mainFrame.backForwardCacheDetails.explanations)}
237
+ `}
238
+ </${Buttons.Button.Button.litTagName}>
239
+ </${ReportView.ReportView.ReportSection.litTagName}>
240
+ <${ReportView.ReportView.ReportSectionDivider.litTagName}>
241
+ </${ReportView.ReportView.ReportSectionDivider.litTagName}>
242
+ ${this.maybeRenderExplanations(mainFrame.backForwardCacheDetails.explanations)}
243
+ <${ReportView.ReportView.ReportSection.litTagName}>
244
+ <x-link href="https://web.dev/bfcache/" class="link">
245
+ ${i18nString(UIStrings.learnMore)}
246
+ </x-link>
247
+ </${ReportView.ReportView.ReportSection.litTagName}>
203
248
  `;
249
+ // clang-format on
204
250
  }
205
251
 
206
- private renderBackForwardCacheStatus(status: boolean|undefined): Platform.UIString.LocalizedString {
252
+ private renderBackForwardCacheStatus(status: boolean|undefined): LitHtml.TemplateResult {
207
253
  switch (status) {
208
254
  case true:
209
- return i18nString(UIStrings.restoredFromBFCache);
255
+ // clang-format off
256
+ return LitHtml.html`
257
+ <${ReportView.ReportView.ReportSection.litTagName}>
258
+ <div class='status'>
259
+ <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
260
+ iconName: 'ic_checkmark_16x16',
261
+ color: 'green',
262
+ width: '16px',
263
+ height: '16px',
264
+ } as IconButton.Icon.IconData}>
265
+ </${IconButton.Icon.Icon.litTagName}>
266
+ </div>
267
+ ${i18nString(UIStrings.restoredFromBFCache)}
268
+ </${ReportView.ReportView.ReportSection.litTagName}>
269
+ `;
270
+ // clang-format on
210
271
  case false:
211
- return i18nString(UIStrings.normalNavigation);
272
+ // clang-format off
273
+ return LitHtml.html`
274
+ <${ReportView.ReportView.ReportSection.litTagName}>
275
+ <div class='status'>
276
+ <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
277
+ iconName: 'circled_backslash_icon',
278
+ color: 'var(--color-text-secondary)',
279
+ width: '16px',
280
+ height: '16px',
281
+ } as IconButton.Icon.IconData}>
282
+ </${IconButton.Icon.Icon.litTagName}>
283
+ </div>
284
+ ${i18nString(UIStrings.normalNavigation)}
285
+ </${ReportView.ReportView.ReportSection.litTagName}>
286
+ `;
287
+ // clang-format on
212
288
  }
213
- return i18nString(UIStrings.unknown);
289
+ // clang-format off
290
+ return LitHtml.html`
291
+ <${ReportView.ReportView.ReportSection.litTagName}>
292
+ ${i18nString(UIStrings.unknown)}
293
+ </${ReportView.ReportView.ReportSection.litTagName}>
294
+ `;
295
+ // clang-format on
214
296
  }
215
297
 
216
298
  private maybeRenderExplanations(explanations: Protocol.Page.BackForwardCacheNotRestoredExplanation[]):
@@ -243,36 +325,46 @@ export class BackForwardCacheView extends UI.ThrottledWidget.ThrottledWidget {
243
325
  // clang-format off
244
326
  return LitHtml.html`
245
327
  ${explanations.length > 0 ? LitHtml.html`
246
- <${ReportView.ReportView.ReportKey.litTagName}>
328
+ <${ReportView.ReportView.ReportSectionHeader.litTagName}>
247
329
  ${category}
248
- <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
249
- iconName: 'help_outline',
250
- color: 'var(--color-text-secondary)',
251
- width: '16px',
252
- height: '16px',
253
- } as IconButton.Icon.IconData} title=${explainerText}></${IconButton.Icon.Icon.litTagName}>
254
- </${ReportView.ReportView.ReportKey.litTagName}>
255
- <${ReportView.ReportView.ReportValue.litTagName}>
256
- <ul class='not-restored-reason-list'>${explanations.map(explanation => this.renderReason(explanation))}</ul>
257
- </${ReportView.ReportView.ReportValue.litTagName}>
330
+ <div class='help-outline-icon'>
331
+ <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
332
+ iconName: 'help_outline',
333
+ color: 'var(--color-text-secondary)',
334
+ width: '16px',
335
+ height: '16px',
336
+ } as IconButton.Icon.IconData} title=${explainerText}>
337
+ </${IconButton.Icon.Icon.litTagName}>
338
+ </div>
339
+ </${ReportView.ReportView.ReportSectionHeader.litTagName}>
340
+ ${explanations.map(explanation => this.renderReason(explanation))}
258
341
  ` : LitHtml.nothing}
259
342
  `;
260
343
  // clang-format on
261
344
  }
262
345
 
263
346
  private renderReason(explanation: Protocol.Page.BackForwardCacheNotRestoredExplanation): LitHtml.TemplateResult {
347
+ // clang-format off
264
348
  return LitHtml.html`
265
- <li>
266
- <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
267
- iconName: 'circled_exclamation_icon',
268
- color: 'orange',
269
- width: '16px',
270
- height: '16px',
271
- } as IconButton.Icon.IconData}></${IconButton.Icon.Icon.litTagName}>
272
- ${explanation.reason} : ${
273
- (explanation.reason in NotRestoredReasonDescription) ?
274
- LitHtml.html`${NotRestoredReasonDescription[explanation.reason].name()}` :
275
- LitHtml.nothing} </li>
349
+ <${ReportView.ReportView.ReportSection.litTagName}>
350
+ ${(explanation.reason in NotRestoredReasonDescription) ?
351
+ LitHtml.html`
352
+ <div class='circled-exclamation-icon'>
353
+ <${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
354
+ iconName: 'circled_exclamation_icon',
355
+ color: 'orange',
356
+ width: '16px',
357
+ height: '16px',
358
+ } as IconButton.Icon.IconData}>
359
+ </${IconButton.Icon.Icon.litTagName}>
360
+ </div>
361
+ ${NotRestoredReasonDescription[explanation.reason].name()}` :
362
+ LitHtml.nothing}
363
+ </${ReportView.ReportView.ReportSection.litTagName}>
364
+ <div class='gray-text'>
365
+ ${explanation.reason}
366
+ </div>
276
367
  `;
368
+ // clang-format on
277
369
  }
278
370
  }