chrome-devtools-frontend 1.0.959955 → 1.0.961797

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 (83) hide show
  1. package/.vscode/devtools-workspace-launch.json +29 -0
  2. package/.vscode/devtools-workspace-settings.json +6 -1
  3. package/.vscode/devtools-workspace-tasks.json +28 -0
  4. package/config/gni/devtools_grd_files.gni +1 -3
  5. package/front_end/core/common/ParsedURL.ts +5 -2
  6. package/front_end/core/host/UserMetrics.ts +2 -1
  7. package/front_end/core/i18n/locales/en-US.json +36 -24
  8. package/front_end/core/i18n/locales/en-XL.json +36 -24
  9. package/front_end/core/sdk/DebuggerModel.ts +8 -1
  10. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +3 -0
  11. package/front_end/core/sdk/SourceMap.ts +9 -1
  12. package/front_end/entrypoints/main/MainImpl.ts +5 -0
  13. package/front_end/generated/InspectorBackendCommands.js +21 -2
  14. package/front_end/generated/SupportedCSSProperties.js +3 -1
  15. package/front_end/generated/protocol-mapping.d.ts +17 -1
  16. package/front_end/generated/protocol-proxy-api.d.ts +18 -1
  17. package/front_end/generated/protocol.d.ts +79 -0
  18. package/front_end/models/issues_manager/IssuesManager.ts +0 -5
  19. package/front_end/models/issues_manager/issues_manager.ts +0 -2
  20. package/front_end/panels/application/IndexedDBModel.ts +3 -0
  21. package/front_end/panels/application/components/FrameDetailsView.ts +5 -1
  22. package/front_end/panels/application/components/PermissionsPolicySection.ts +16 -4
  23. package/front_end/panels/console/ConsoleView.ts +10 -1
  24. package/front_end/panels/console/ConsoleViewMessage.ts +5 -106
  25. package/front_end/panels/console/ErrorStackParser.ts +117 -0
  26. package/front_end/panels/console/console.ts +2 -0
  27. package/front_end/panels/elements/ElementsPanel.ts +10 -1
  28. package/front_end/panels/issues/IssueAggregator.ts +0 -10
  29. package/front_end/panels/issues/IssueView.ts +0 -2
  30. package/front_end/panels/snippets/SnippetsQuickOpen.ts +5 -0
  31. package/front_end/panels/sources/BreakpointEditDialog.ts +1 -1
  32. package/front_end/panels/sources/DebuggerPlugin.ts +7 -1
  33. package/front_end/panels/sources/SourcesPanel.ts +20 -2
  34. package/front_end/panels/timeline/TimelineTreeView.ts +10 -1
  35. package/front_end/third_party/acorn/README.chromium +1 -1
  36. package/front_end/third_party/acorn-loose/README.chromium +2 -2
  37. package/front_end/third_party/additional_readme_paths.json +15 -0
  38. package/front_end/third_party/codemirror/README.chromium +2 -2
  39. package/front_end/third_party/codemirror.next/README.chromium +1 -1
  40. package/front_end/third_party/lighthouse/README.chromium +1 -1
  41. package/front_end/third_party/lit-html/README.chromium +2 -2
  42. package/front_end/third_party/marked/README.chromium +2 -2
  43. package/front_end/third_party/puppeteer/README.chromium +2 -2
  44. package/front_end/third_party/puppeteer/package/README.md +11 -11
  45. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts +0 -1
  46. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts.map +1 -1
  47. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js +2 -1
  48. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js.map +1 -1
  49. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts +3 -1
  50. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts.map +1 -1
  51. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js +40 -8
  52. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js.map +1 -1
  53. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +1 -1
  54. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts +0 -1
  55. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts.map +1 -1
  56. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js +2 -1
  57. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js.map +1 -1
  58. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts +3 -1
  59. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -1
  60. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +40 -8
  61. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js.map +1 -1
  62. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +1 -1
  63. package/front_end/third_party/puppeteer/package/lib/types.d.ts +3 -2
  64. package/front_end/third_party/puppeteer/package/package.json +2 -2
  65. package/front_end/third_party/wasmparser/README.chromium +2 -2
  66. package/front_end/ui/components/buttons/Button.ts +6 -1
  67. package/front_end/ui/components/buttons/button.css +0 -1
  68. package/front_end/ui/components/docs/button/basic.ts +1 -0
  69. package/front_end/ui/components/docs/icon_button/basic.ts +2 -7
  70. package/front_end/ui/components/icon_button/IconButton.ts +1 -1
  71. package/front_end/ui/legacy/SplitWidget.ts +6 -2
  72. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +10 -8
  73. package/front_end/ui/legacy/toolbar.css +4 -0
  74. package/package.json +1 -1
  75. package/scripts/build/assert_third_party_readmes.py +69 -0
  76. package/front_end/models/issues_manager/WasmCrossOriginModuleSharingIssue.ts +0 -67
  77. package/front_end/models/issues_manager/descriptions/wasmCrossOriginModuleSharing.md +0 -5
  78. package/front_end/panels/issues/WasmCrossOriginModuleSharingAffectedResourcesView.ts +0 -90
  79. package/front_end/third_party/acorn/LICENSE +0 -19
  80. package/front_end/third_party/acorn-loose/LICENSE +0 -19
  81. package/front_end/third_party/codemirror/LICENSE +0 -21
  82. package/front_end/third_party/lit-html/LICENSE +0 -28
  83. package/front_end/third_party/wasmparser/LICENSE +0 -177
@@ -128,6 +128,11 @@ export class Button extends HTMLElement {
128
128
  void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);
129
129
  }
130
130
 
131
+ set title(title: string) {
132
+ this.#props.title = title;
133
+ void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);
134
+ }
135
+
131
136
  set disabled(disabled: boolean) {
132
137
  this.#setDisabledProperty(disabled);
133
138
  void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);
@@ -212,7 +217,7 @@ export class Button extends HTMLElement {
212
217
  // clang-format off
213
218
  LitHtml.render(
214
219
  LitHtml.html`
215
- <button .title=${this.#props.title} .disabled=${this.#props.disabled} class=${LitHtml.Directives.classMap(classes)}>
220
+ <button title=${LitHtml.Directives.ifDefined(this.#props.title)} .disabled=${this.#props.disabled} class=${LitHtml.Directives.classMap(classes)}>
216
221
  ${this.#props.iconUrl ? LitHtml.html`<${IconButton.Icon.Icon.litTagName}
217
222
  .data=${{
218
223
  iconPath: this.#props.iconUrl,
@@ -142,7 +142,6 @@ button.toolbar:focus-visible {
142
142
 
143
143
  button.toolbar:disabled,
144
144
  button.toolbar:disabled:hover {
145
- border: 1px solid transparent;
146
145
  background: var(--color-background);
147
146
  color: var(--color-text-disabled);
148
147
  cursor: not-allowed;
@@ -29,6 +29,7 @@ primaryButton.data = {
29
29
  variant: Buttons.Button.Variant.PRIMARY,
30
30
  };
31
31
  primaryButton.innerText = 'Click me';
32
+ primaryButton.title = 'Custom title';
32
33
  primaryButton.onclick = () => alert('clicked');
33
34
  appendButton(primaryButton);
34
35
 
@@ -12,18 +12,13 @@ function appendComponent(data: IconButton.IconButton.IconButtonData) {
12
12
 
13
13
  appendComponent({
14
14
  clickHandler: (): void => {},
15
- groups: [{iconName: 'survey_feedback_icon', iconColor: 'black', text: '1 item'}],
16
- });
17
-
18
- appendComponent({
19
- clickHandler: (): void => {},
20
- groups: [{iconName: 'survey_feedback_icon', iconColor: 'black', text: '1 item'}],
15
+ groups: [{iconName: 'survey_feedback_icon', text: '1 item'}],
21
16
  });
22
17
 
23
18
  appendComponent({
24
19
  clickHandler: (): void => {},
25
20
  groups: [
26
- {iconName: 'survey_feedback_icon', iconColor: 'blue', text: 'Test'},
21
+ {iconName: 'survey_feedback_icon', iconColor: 'var(--color-primary)', text: 'Test'},
27
22
  {iconName: 'warning_icon', iconColor: '', text: '1'},
28
23
  ],
29
24
  });
@@ -85,7 +85,7 @@ export class IconButton extends HTMLElement {
85
85
  ${filteredGroups.map(counter =>
86
86
  LitHtml.html`
87
87
  <${Icon.litTagName} class="status-icon"
88
- .data=${{iconName: counter.iconName, color: counter.iconColor || '', width: counter.iconWidth || '1.5ex', height: counter.iconHeight || '1.5ex'} as IconData}>
88
+ .data=${{iconName: counter.iconName, color: counter.iconColor || 'var(--color-text-primary)', width: counter.iconWidth || '1.5ex', height: counter.iconHeight || '1.5ex'} as IconData}>
89
89
  </${Icon.litTagName}>
90
90
  ${this.#compact ? LitHtml.html`<!-- Force line-height for this element --><span>&#8203;</span>` : LitHtml.nothing}
91
91
  <span class="icon-button-title">${counter.text}</span>
@@ -31,6 +31,7 @@
31
31
  import * as Common from '../../core/common/common.js';
32
32
  import * as Platform from '../../core/platform/platform.js';
33
33
 
34
+ import * as ARIAUtils from './ARIAUtils.js';
34
35
  import {Constraints} from './Geometry.js';
35
36
  import type {ResizeUpdatePositionEvent} from './ResizerWidget.js';
36
37
  import {Events as ResizerWidgetEvents, SimpleResizerWidget} from './ResizerWidget.js';
@@ -815,8 +816,9 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
815
816
  this.forceUpdateLayout();
816
817
  }
817
818
 
818
- createShowHideSidebarButton(showTitle: Common.UIString.LocalizedString, hideTitle: Common.UIString.LocalizedString):
819
- ToolbarButton {
819
+ createShowHideSidebarButton(
820
+ showTitle: Common.UIString.LocalizedString, hideTitle: Common.UIString.LocalizedString,
821
+ shownString: Common.UIString.LocalizedString, hiddenString: Common.UIString.LocalizedString): ToolbarButton {
820
822
  this.showSidebarButtonTitle = showTitle;
821
823
  this.hideSidebarButtonTitle = hideTitle;
822
824
  this.showHideSidebarButton = new ToolbarButton('', '');
@@ -826,8 +828,10 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
826
828
  function buttonClicked(this: SplitWidget): void {
827
829
  if (this.showModeInternal !== ShowMode.Both) {
828
830
  this.showBoth(true);
831
+ ARIAUtils.alert(shownString);
829
832
  } else {
830
833
  this.hideSidebar(true);
834
+ ARIAUtils.alert(hiddenString);
831
835
  }
832
836
  }
833
837
 
@@ -869,7 +869,7 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
869
869
  for (let i = 0; i < numColumns; i++) {
870
870
  const column = this.visibleColumnsArray[i];
871
871
  if (!column.weight) {
872
- column.weight = 100 * cells[i].offsetWidth / tableWidth || 10;
872
+ column.weight = 100 * this.getPreferredWidth(i) / tableWidth || 10;
873
873
  }
874
874
  }
875
875
  this.columnWidthsInitialized = true;
@@ -934,6 +934,11 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
934
934
  willHide(): void {
935
935
  }
936
936
 
937
+ private getPreferredWidth(columnIndex: number): number {
938
+ return elementToPreferedWidthMap.get(this.headerTableColumnGroup.children[columnIndex]) ||
939
+ this.headerTableBodyInternal.rows[0].cells[columnIndex].offsetWidth;
940
+ }
941
+
937
942
  private applyColumnWeights(): void {
938
943
  let tableWidth = this.element.offsetWidth - this.cornerWidth;
939
944
  if (tableWidth <= 0) {
@@ -945,9 +950,7 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
945
950
  for (let i = 0; i < this.visibleColumnsArray.length; ++i) {
946
951
  const column = this.visibleColumnsArray[i];
947
952
  if (column.fixedWidth) {
948
- const currentChild = this.headerTableColumnGroup.children[i];
949
- const width =
950
- elementToPreferedWidthMap.get(currentChild) || this.headerTableBodyInternal.rows[0].cells[i].offsetWidth;
953
+ const width = this.getPreferredWidth(i);
951
954
  fixedColumnWidths[i] = width;
952
955
  tableWidth -= width;
953
956
  } else {
@@ -1415,7 +1418,6 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
1415
1418
  // Constrain the dragpoint to be within the containing div of the
1416
1419
  // datagrid.
1417
1420
  let dragPoint: number = event.clientX - this.element.totalOffsetLeft();
1418
- const firstRowCells = this.headerTableBodyInternal.rows[0].cells;
1419
1421
  let leftEdgeOfPreviousColumn = 0;
1420
1422
  // Constrain the dragpoint to be within the space made up by the
1421
1423
  // column directly to the left and the column directly to the right.
@@ -1425,19 +1427,19 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
1425
1427
  }
1426
1428
  let rightCellIndex: number = leftCellIndex + 1;
1427
1429
  for (let i = 0; i < leftCellIndex; i++) {
1428
- leftEdgeOfPreviousColumn += firstRowCells[i].offsetWidth;
1430
+ leftEdgeOfPreviousColumn += this.getPreferredWidth(i);
1429
1431
  }
1430
1432
 
1431
1433
  // Differences for other resize methods
1432
1434
  if (this.resizeMethod === ResizeMethod.Last) {
1433
1435
  rightCellIndex = this.resizers.length;
1434
1436
  } else if (this.resizeMethod === ResizeMethod.First) {
1435
- leftEdgeOfPreviousColumn += firstRowCells[leftCellIndex].offsetWidth - firstRowCells[0].offsetWidth;
1437
+ leftEdgeOfPreviousColumn += this.getPreferredWidth(leftCellIndex) - this.getPreferredWidth(0);
1436
1438
  leftCellIndex = 0;
1437
1439
  }
1438
1440
 
1439
1441
  const rightEdgeOfNextColumn =
1440
- leftEdgeOfPreviousColumn + firstRowCells[leftCellIndex].offsetWidth + firstRowCells[rightCellIndex].offsetWidth;
1442
+ leftEdgeOfPreviousColumn + this.getPreferredWidth(leftCellIndex) + this.getPreferredWidth(rightCellIndex);
1441
1443
 
1442
1444
  // Give each column some padding so that they don't disappear.
1443
1445
  const leftMinimum = leftEdgeOfPreviousColumn + ColumnResizePadding;
@@ -423,6 +423,10 @@ input[is="history-input"]:not(:placeholder-shown) {
423
423
  color: var(--color-button-primary-text);
424
424
  }
425
425
 
426
+ .toolbar-item.highlight:focus-visible {
427
+ background: var(--color-primary-variant);
428
+ }
429
+
426
430
  .toolbar-item.highlight > .icon-mask {
427
431
  background: var(--color-button-primary-text);
428
432
  }
package/package.json CHANGED
@@ -53,5 +53,5 @@
53
53
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
54
54
  "watch": "third_party/node/node.py --output scripts/watch_build.js"
55
55
  },
56
- "version": "1.0.959955"
56
+ "version": "1.0.961797"
57
57
  }
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env vpython
2
+ # -*- coding: UTF-8 -*-
3
+ #
4
+ # Copyright 2022 The Chromium Authors. All rights reserved.
5
+ # Use of this source code is governed by a BSD-style license that can be
6
+ # found in the LICENSE file.
7
+ """
8
+ Asserts that all third_party packages are included in additional_readme_paths.json.
9
+ """
10
+
11
+ import sys
12
+ import json
13
+
14
+
15
+ def main(argv):
16
+ grd_sources = open(argv[1], 'r').read()
17
+ listed_third_party_directories = open(argv[2], 'r').read()
18
+ stamp_file = argv[3]
19
+
20
+ grd_json = json.loads(grd_sources)
21
+ listed_third_party_directories_json = json.loads(
22
+ listed_third_party_directories)
23
+
24
+ grd_json.sort()
25
+ listed_third_party_directories_json.sort()
26
+
27
+ return_code = 0
28
+ found_directories = set()
29
+ missing_directories = set()
30
+
31
+ for grd_file in grd_json:
32
+ if grd_file.startswith("front_end/third_party"):
33
+ third_party_directory_name = grd_file.split("/")[2]
34
+ found_directories.add(third_party_directory_name)
35
+ if third_party_directory_name not in listed_third_party_directories_json:
36
+ missing_directories.add(third_party_directory_name)
37
+
38
+ for missing_directory in missing_directories:
39
+ print(
40
+ "Directory `" + missing_directory + "`" +
41
+ " is not listed in the `additional_readme_paths.json` file " +
42
+ " in `front_end/third_party`. Make sure to include all third_party"
43
+ +
44
+ " directories in the `.json` file to ensure all licenses are listed"
45
+ + " in chrome://credits.\n")
46
+
47
+ return_code = 1
48
+
49
+ for listed_directory in listed_third_party_directories_json:
50
+ if (listed_directory not in found_directories
51
+ # TODO(crbug.com/1287519): Remove exception for codemirror 5
52
+ and not listed_directory == "codemirror"
53
+ and not listed_directory == "puppeteer"):
54
+ print(
55
+ "Directory `" + listed_directory + "`" +
56
+ " is not included in `config/gni/devtools_grd_files.gni`." +
57
+ " Make sure to only include third_party directoires that are shipped"
58
+ + " in Chromium.\n")
59
+
60
+ return_code = 1
61
+
62
+ with open(stamp_file, 'w', encoding="utf8") as fp:
63
+ fp.write("")
64
+
65
+ return return_code
66
+
67
+
68
+ if __name__ == '__main__':
69
+ sys.exit(main(sys.argv))
@@ -1,67 +0,0 @@
1
- // Copyright 2021 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 i18n from '../../core/i18n/i18n.js';
6
- import * as Protocol from '../../generated/protocol.js';
7
- import type * as SDK from '../../core/sdk/sdk.js';
8
- import {Issue, IssueCategory, IssueKind} from './Issue.js';
9
- import type {MarkdownIssueDescription} from './MarkdownIssueDescription.js';
10
-
11
- const UIStrings = {
12
- /**
13
- * @description Label for the link in the description of Wasm cross-origin module sharing issues, that is, issues
14
- * that are related to the upcoming deprecation of cross-origin sharing of Wasm modules.
15
- */
16
- linkTitle: 'Restricting Wasm module sharing to same-origin',
17
- };
18
- const str_ = i18n.i18n.registerUIStrings('models/issues_manager/WasmCrossOriginModuleSharingIssue.ts', UIStrings);
19
- const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
20
-
21
- export class WasmCrossOriginModuleSharingIssue extends
22
- Issue<Protocol.Audits.InspectorIssueCode.WasmCrossOriginModuleSharingIssue> {
23
- #issueDetails: Protocol.Audits.WasmCrossOriginModuleSharingIssueDetails;
24
-
25
- constructor(
26
- issueDetails: Protocol.Audits.WasmCrossOriginModuleSharingIssueDetails,
27
- issuesModel: SDK.IssuesModel.IssuesModel) {
28
- super(Protocol.Audits.InspectorIssueCode.WasmCrossOriginModuleSharingIssue, issuesModel);
29
- this.#issueDetails = issueDetails;
30
- }
31
-
32
- getCategory(): IssueCategory {
33
- return IssueCategory.Other;
34
- }
35
-
36
- details(): Protocol.Audits.WasmCrossOriginModuleSharingIssueDetails {
37
- return this.#issueDetails;
38
- }
39
-
40
- getDescription(): MarkdownIssueDescription|null {
41
- return {
42
- file: 'wasmCrossOriginModuleSharing.md',
43
- links: [{
44
- link: 'https://developer.chrome.com/blog/wasm-module-sharing-restricted-to-same-origin/',
45
- linkTitle: i18nString(UIStrings.linkTitle),
46
- }],
47
- };
48
- }
49
-
50
- primaryKey(): string {
51
- return JSON.stringify(this.#issueDetails);
52
- }
53
-
54
- getKind(): IssueKind {
55
- return this.#issueDetails.isWarning ? IssueKind.BreakingChange : IssueKind.PageError;
56
- }
57
-
58
- static fromInspectorIssue(issuesModel: SDK.IssuesModel.IssuesModel, inspectorIssue: Protocol.Audits.InspectorIssue):
59
- WasmCrossOriginModuleSharingIssue[] {
60
- const details = inspectorIssue.details.wasmCrossOriginModuleSharingIssue;
61
- if (!details) {
62
- console.warn('WasmCrossOriginModuleSharing issue without details received.');
63
- return [];
64
- }
65
- return [new WasmCrossOriginModuleSharingIssue(details, issuesModel)];
66
- }
67
- }
@@ -1,5 +0,0 @@
1
- # Share WebAssembly modules only between same-origin environments
2
-
3
- Starting in Chrome M95, WebAssembly modules may only be shared between same-origin environments. This means that [same-site but cross-origin](sameSiteAndSameOrigin) environments won't be able to share WebAssembly modules via `postMessage` anymore.
4
-
5
- To fix this, ensure that WebAssembly modules are only transferred between environments of the same origin. If this is not possible, serve the WebAssembly module from the same origin.
@@ -1,90 +0,0 @@
1
- // Copyright 2021 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 i18n from '../../core/i18n/i18n.js';
6
- import type * as Platform from '../../core/platform/platform.js';
7
- import type * as IssuesManager from '../../models/issues_manager/issues_manager.js';
8
- import type * as Protocol from '../../generated/protocol.js';
9
-
10
- import {AffectedResourcesView} from './AffectedResourcesView.js';
11
-
12
- const UIStrings = {
13
- /**
14
- * @description Label for number of affected resources indication in issue view. The number designates the number of attempts to transfer a module to cross-origin context.
15
- *
16
- */
17
- nModuleTransfers: '{n, plural, =1 {# module} other {# modules}}',
18
- /**
19
- *@description Title for a column in an Wasm cross-origin module sharing affected resource view
20
- */
21
- wasmModuleUrl: 'Wasm Module URL',
22
- /**
23
- * @description Title for a column in an Wasm cross-origin module sharing affected resource view.
24
- * The issue is about a transfer of a module between different origins (see https://developer.mozilla.org/en-US/docs/Glossary/Origin).
25
- * The transfer occurs from a source origin to a target origin.
26
- */
27
- sourceOrigin: 'Source Origin',
28
- /**
29
- * @description Title for a column in an Wasm cross-origin module sharing affected resource view.
30
- * The issue is about a transfer of a module between different origins (see https://developer.mozilla.org/en-US/docs/Glossary/Origin).
31
- * The transfer occurs from a source origin to a target origin.
32
- */
33
- targetOrigin: 'Target Origin',
34
- /**
35
- *@description Title for a column in an Wasm cross-origin module sharing affected resource view
36
- */
37
- status: 'Status',
38
- /**
39
- * @description Indicates that the Wasm module transfer was blocked.
40
- */
41
- blocked: 'blocked',
42
- /**
43
- * @description Indicated that the Wasm module transfer was not blocked, but only warned about.
44
- */
45
- warned: 'warning',
46
- };
47
- const str_ =
48
- i18n.i18n.registerUIStrings('panels/issues/WasmCrossOriginModuleSharingAffectedResourcesView.ts', UIStrings);
49
- const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
50
-
51
- export class WasmCrossOriginModuleSharingAffectedResourcesView extends AffectedResourcesView {
52
- #appendIssues(issues: Iterable<IssuesManager.WasmCrossOriginModuleSharingIssue.WasmCrossOriginModuleSharingIssue>):
53
- void {
54
- const header = document.createElement('tr');
55
- this.appendColumnTitle(header, i18nString(UIStrings.wasmModuleUrl));
56
- this.appendColumnTitle(header, i18nString(UIStrings.sourceOrigin));
57
- this.appendColumnTitle(header, i18nString(UIStrings.targetOrigin));
58
- this.appendColumnTitle(header, i18nString(UIStrings.status));
59
-
60
- this.affectedResources.appendChild(header);
61
-
62
- let count = 0;
63
- for (const issue of issues) {
64
- this.#appendDetails(issue.details());
65
- count++;
66
- }
67
- this.updateAffectedResourceCount(count);
68
- }
69
-
70
- protected getResourceNameWithCount(count: number): Platform.UIString.LocalizedString {
71
- return i18nString(UIStrings.nModuleTransfers, {n: count});
72
- }
73
-
74
- #appendDetails(details: Protocol.Audits.WasmCrossOriginModuleSharingIssueDetails): void {
75
- const element = document.createElement('tr');
76
-
77
- element.appendChild(this.createIssueDetailCell(details.wasmModuleUrl));
78
- element.appendChild(this.createIssueDetailCell(details.sourceOrigin));
79
- element.appendChild(this.createIssueDetailCell(details.targetOrigin));
80
- element.appendChild(
81
- this.createIssueDetailCell(details.isWarning ? i18nString(UIStrings.warned) : i18nString(UIStrings.blocked)));
82
-
83
- this.affectedResources.appendChild(element);
84
- }
85
-
86
- update(): void {
87
- this.clear();
88
- this.#appendIssues(this.issue.getWasmCrossOriginModuleSharingIssue());
89
- }
90
- }
@@ -1,19 +0,0 @@
1
- Copyright (C) 2012-2018 by various contributors (see AUTHORS)
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
@@ -1,19 +0,0 @@
1
- Copyright (C) 2012-2018 by various contributors (see AUTHORS)
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (C) 2017 by Marijn Haverbeke <marijnh@gmail.com> and others
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1,28 +0,0 @@
1
- BSD 3-Clause License
2
-
3
- Copyright (c) 2017, The Polymer Authors. All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without
6
- modification, are permitted provided that the following conditions are met:
7
-
8
- * Redistributions of source code must retain the above copyright notice, this
9
- list of conditions and the following disclaimer.
10
-
11
- * Redistributions in binary form must reproduce the above copyright notice,
12
- this list of conditions and the following disclaimer in the documentation
13
- and/or other materials provided with the distribution.
14
-
15
- * Neither the name of the copyright holder nor the names of its
16
- contributors may be used to endorse or promote products derived from
17
- this software without specific prior written permission.
18
-
19
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.