chrome-devtools-frontend 1.0.927127 → 1.0.928589
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.
- package/AUTHORS +1 -0
- package/config/gni/all_devtools_files.gni +0 -1
- package/config/gni/devtools_grd_files.gni +30 -4
- package/config/gni/devtools_image_files.gni +1 -0
- package/front_end/Images/src/ic_preview_feature.svg +3 -0
- package/front_end/Tests.js +2 -3
- package/front_end/core/common/Settings.ts +26 -45
- package/front_end/core/host/UserMetrics.ts +2 -2
- package/front_end/core/i18n/locales/en-US.json +60 -15
- package/front_end/core/i18n/locales/en-XL.json +60 -15
- package/front_end/core/platform/keyboard-utilities.ts +1 -0
- package/front_end/core/root/Runtime.ts +62 -61
- package/front_end/core/sdk/AccessibilityModel.ts +73 -73
- package/front_end/core/sdk/CPUProfileDataModel.ts +14 -14
- package/front_end/core/sdk/CPUProfilerModel.ts +33 -33
- package/front_end/core/sdk/CPUThrottlingManager.ts +8 -8
- package/front_end/core/sdk/CSSFontFace.ts +10 -10
- package/front_end/core/sdk/CSSMatchedStyles.ts +114 -114
- package/front_end/core/sdk/CSSMedia.ts +22 -22
- package/front_end/core/sdk/CSSMetadata.ts +53 -49
- package/front_end/core/sdk/CSSModel.ts +139 -135
- package/front_end/core/sdk/CSSProperty.ts +18 -18
- package/front_end/core/sdk/CSSRule.ts +15 -15
- package/front_end/core/sdk/CSSStyleDeclaration.ts +49 -47
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +12 -12
- package/front_end/core/sdk/ChildTargetManager.ts +41 -40
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +10 -10
- package/front_end/core/sdk/Connections.ts +81 -81
- package/front_end/core/sdk/ConsoleModel.ts +68 -68
- package/front_end/core/sdk/Cookie.ts +48 -48
- package/front_end/core/sdk/CookieModel.ts +13 -13
- package/front_end/core/sdk/CookieParser.ts +45 -45
- package/front_end/core/sdk/DOMDebuggerModel.ts +131 -131
- package/front_end/core/sdk/DOMModel.ts +264 -252
- package/front_end/core/sdk/DebuggerModel.ts +209 -205
- package/front_end/core/sdk/EmulationModel.ts +76 -76
- package/front_end/core/sdk/FilmStripModel.ts +29 -29
- package/front_end/core/sdk/FrameManager.ts +43 -42
- package/front_end/core/sdk/HeapProfilerModel.ts +36 -36
- package/front_end/core/sdk/IsolateManager.ts +82 -82
- package/front_end/core/sdk/IssuesModel.ts +6 -6
- package/front_end/core/sdk/LayerTreeBase.ts +37 -37
- package/front_end/core/sdk/LogModel.ts +5 -5
- package/front_end/core/sdk/NetworkManager.ts +229 -225
- package/front_end/core/sdk/NetworkRequest.ts +368 -360
- package/front_end/core/sdk/OverlayColorGenerator.ts +9 -9
- package/front_end/core/sdk/OverlayModel.ts +155 -153
- package/front_end/core/sdk/OverlayPersistentHighlighter.ts +100 -101
- package/front_end/core/sdk/PageResourceLoader.ts +30 -30
- package/front_end/core/sdk/PaintProfiler.ts +16 -16
- package/front_end/core/sdk/PerformanceMetricsModel.ts +12 -12
- package/front_end/core/sdk/ProfileTreeModel.ts +3 -3
- package/front_end/core/sdk/RemoteObject.ts +108 -104
- package/front_end/core/sdk/Resource.ts +85 -84
- package/front_end/core/sdk/ResourceTreeModel.ts +150 -145
- package/front_end/core/sdk/RuntimeModel.ts +38 -34
- package/front_end/core/sdk/SDKModel.ts +3 -3
- package/front_end/core/sdk/ScreenCaptureModel.ts +19 -19
- package/front_end/core/sdk/Script.ts +29 -29
- package/front_end/core/sdk/SecurityOriginManager.ts +19 -19
- package/front_end/core/sdk/ServerTiming.ts +2 -2
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +43 -43
- package/front_end/core/sdk/ServiceWorkerManager.ts +72 -68
- package/front_end/core/sdk/SourceMap.ts +40 -36
- package/front_end/core/sdk/SourceMapManager.ts +57 -57
- package/front_end/core/sdk/Target.ts +64 -63
- package/front_end/core/sdk/TargetManager.ts +60 -56
- package/front_end/core/sdk/TracingManager.ts +39 -39
- package/front_end/core/sdk/TracingModel.ts +125 -125
- package/front_end/core/sdk/WebAuthnModel.ts +9 -9
- package/front_end/entrypoints/lighthouse_worker/{LighthouseService.js → LighthouseService.ts} +20 -45
- package/front_end/entrypoints/lighthouse_worker/{lighthouse_worker.js → lighthouse_worker.ts} +0 -0
- package/front_end/entrypoints/main/MainImpl.ts +7 -2
- package/front_end/legacy_test_runner/elements_test_runner/ElementsTestRunner.js +4 -4
- package/front_end/legacy_test_runner/sdk_test_runner/sdk_test_runner.js +1 -1
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -6
- package/front_end/models/issues_manager/GenericIssue.ts +86 -0
- package/front_end/models/issues_manager/Issue.ts +24 -0
- package/front_end/models/issues_manager/IssuesManager.ts +18 -6
- package/front_end/models/issues_manager/descriptions/genericCrossOriginPortalPostMessageError.md +3 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +5422 -1
- package/front_end/panels/console/ConsoleSidebar.ts +0 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +53 -61
- package/front_end/panels/elements/ElementsTreeOutline.ts +0 -1
- package/front_end/panels/elements/components/LayoutPane.ts +5 -1
- package/front_end/panels/issues/GenericIssueDetailsView.ts +68 -0
- package/front_end/panels/issues/IssueAggregator.ts +16 -0
- package/front_end/panels/issues/IssueKindView.ts +95 -0
- package/front_end/panels/issues/IssueView.ts +6 -0
- package/front_end/panels/issues/IssuesPane.ts +81 -18
- package/front_end/panels/issues/issuesTree.css +8 -3
- package/front_end/panels/lighthouse/LighthouseController.ts +3 -1
- package/front_end/panels/network/NetworkItemView.ts +1 -1
- package/front_end/panels/network/networkLogView.css +5 -0
- package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +1 -0
- package/front_end/panels/settings/settingsScreen.css +24 -0
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +8 -3
- package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
- package/front_end/panels/sources/sources-meta.ts +22 -7
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +4 -4
- package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +137 -0
- package/front_end/ui/components/code_highlighter/codeHighlighter.css +51 -0
- package/front_end/ui/components/code_highlighter/code_highlighter.ts +11 -0
- package/front_end/ui/components/docs/text_editor/basic.html +28 -0
- package/front_end/ui/components/docs/text_editor/basic.ts +14 -0
- package/front_end/ui/components/docs/text_prompt/basic.html +35 -0
- package/front_end/ui/components/docs/text_prompt/basic.ts +19 -0
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -0
- package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +17 -0
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -0
- package/front_end/ui/components/text_editor/TextEditor.ts +161 -0
- package/front_end/ui/components/text_editor/config.ts +264 -0
- package/front_end/{panels/console/components/components.ts → ui/components/text_editor/text_editor.ts} +2 -5
- package/front_end/ui/components/text_editor/theme.ts +113 -0
- package/front_end/ui/components/text_prompt/TextPrompt.ts +144 -0
- package/front_end/ui/components/text_prompt/textPrompt.css +33 -0
- package/front_end/ui/components/text_prompt/text_prompt.ts +9 -0
- package/front_end/ui/legacy/ARIAUtils.ts +14 -11
- package/front_end/ui/legacy/TabbedPane.ts +32 -3
- package/front_end/ui/legacy/UIUtils.ts +3 -1
- package/front_end/ui/legacy/View.ts +6 -0
- package/front_end/ui/legacy/ViewManager.ts +5 -1
- package/front_end/ui/legacy/ViewRegistration.ts +5 -0
- package/front_end/ui/legacy/XLink.ts +1 -1
- package/front_end/ui/legacy/closeButton.css +6 -0
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +8 -3
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +38 -38
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +10 -4
- package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +23 -6
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +14 -16
- package/front_end/ui/legacy/filter.css +1 -0
- package/front_end/ui/legacy/tabbedPane.css +24 -0
- package/front_end/ui/legacy/toolbar.css +5 -0
- package/inspector_overlay/main.ts +2 -1
- package/inspector_overlay/tool_screenshot.ts +8 -1
- package/package.json +1 -1
- package/scripts/build/rollup.config.js +9 -0
- package/scripts/migration/class-fields/migrate.js +56 -0
- package/scripts/migration/class-fields/package.json +5 -0
- package/front_end/panels/console/components/SidebarDeprecation.ts +0 -58
- package/front_end/panels/console/components/sidebarDeprecation.css +0 -17
package/front_end/entrypoints/lighthouse_worker/{LighthouseService.js → LighthouseService.ts}
RENAMED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Root from '../../core/root/root.js';
|
|
6
6
|
|
|
7
|
-
function disableLoggingForTest() {
|
|
8
|
-
console.log = () => undefined; // eslint-disable-line no-console
|
|
7
|
+
function disableLoggingForTest(): void {
|
|
8
|
+
console.log = (): void => undefined; // eslint-disable-line no-console
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -16,43 +16,25 @@ function disableLoggingForTest() {
|
|
|
16
16
|
* via status updates defined below.
|
|
17
17
|
*/
|
|
18
18
|
class LighthousePort {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
|
-
this._onMessage;
|
|
24
|
-
/**
|
|
25
|
-
* @type {(function():void)|undefined}
|
|
26
|
-
*/
|
|
27
|
-
this._onClose;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* @param {string} eventName
|
|
31
|
-
* @param {function(string=):void} callback
|
|
32
|
-
*/
|
|
33
|
-
on(eventName, callback) {
|
|
19
|
+
onMessage?: (message: string) => void;
|
|
20
|
+
onClose?: () => void;
|
|
21
|
+
on(eventName: string, callback: (arg?: string) => void): void {
|
|
34
22
|
if (eventName === 'message') {
|
|
35
|
-
this.
|
|
23
|
+
this.onMessage = callback;
|
|
36
24
|
} else if (eventName === 'close') {
|
|
37
|
-
this.
|
|
25
|
+
this.onClose = callback;
|
|
38
26
|
}
|
|
39
27
|
}
|
|
40
28
|
|
|
41
|
-
|
|
42
|
-
* @param {string} message
|
|
43
|
-
*/
|
|
44
|
-
send(message) {
|
|
29
|
+
send(message: string): void {
|
|
45
30
|
notifyFrontendViaWorkerMessage('sendProtocolMessage', {message});
|
|
46
31
|
}
|
|
47
32
|
}
|
|
48
33
|
|
|
49
34
|
const port = new LighthousePort();
|
|
50
35
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
* @return {!Promise<*>}
|
|
54
|
-
*/
|
|
55
|
-
async function start(params) {
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
|
+
async function start(params: any): Promise<unknown> {
|
|
56
38
|
if (Root.Runtime.Runtime.queryParam('isUnderTest')) {
|
|
57
39
|
disableLoggingForTest();
|
|
58
40
|
params.flags.maxWaitForLoad = 2 * 1000;
|
|
@@ -91,10 +73,8 @@ async function start(params) {
|
|
|
91
73
|
* Finds a locale supported by Lighthouse from the user's system locales.
|
|
92
74
|
* If no matching locale is found, or if fetching locale data fails, this function returns nothing
|
|
93
75
|
* and Lighthouse will use `en-US` by default.
|
|
94
|
-
* @param {string[]} locales
|
|
95
|
-
* @return {!Promise<(string|undefined)>}
|
|
96
76
|
*/
|
|
97
|
-
async function fetchLocaleData(locales) {
|
|
77
|
+
async function fetchLocaleData(locales: string[]): Promise<string|void> {
|
|
98
78
|
// @ts-expect-error https://github.com/GoogleChrome/lighthouse/issues/11628
|
|
99
79
|
const locale = self.lookupLocale(locales);
|
|
100
80
|
|
|
@@ -115,8 +95,8 @@ async function fetchLocaleData(locales) {
|
|
|
115
95
|
localeDataTextPromise = Root.Runtime.loadResourcePromise(localeUrl.toString());
|
|
116
96
|
}
|
|
117
97
|
|
|
118
|
-
const timeoutPromise =
|
|
119
|
-
|
|
98
|
+
const timeoutPromise = new Promise<string>(
|
|
99
|
+
(resolve, reject) => setTimeout(() => reject(new Error('timed out fetching locale')), 5000));
|
|
120
100
|
const localeDataText = await Promise.race([timeoutPromise, localeDataTextPromise]);
|
|
121
101
|
const localeData = JSON.parse(localeDataText);
|
|
122
102
|
// @ts-expect-error https://github.com/GoogleChrome/lighthouse/issues/11628
|
|
@@ -129,25 +109,19 @@ async function fetchLocaleData(locales) {
|
|
|
129
109
|
return;
|
|
130
110
|
}
|
|
131
111
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
* @param {*} params
|
|
135
|
-
*/
|
|
136
|
-
function notifyFrontendViaWorkerMessage(method, params) {
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
113
|
+
function notifyFrontendViaWorkerMessage(method: string, params: any): void {
|
|
137
114
|
self.postMessage(JSON.stringify({method, params}));
|
|
138
115
|
}
|
|
139
116
|
|
|
140
|
-
|
|
141
|
-
* @param {!MessageEvent} event
|
|
142
|
-
*/
|
|
143
|
-
self.onmessage = async event => {
|
|
117
|
+
self.onmessage = async(event: MessageEvent): Promise<void> => {
|
|
144
118
|
const messageFromFrontend = JSON.parse(event.data);
|
|
145
119
|
if (messageFromFrontend.method === 'start') {
|
|
146
120
|
const result = await start(messageFromFrontend.params);
|
|
147
121
|
self.postMessage(JSON.stringify({id: messageFromFrontend.id, result}));
|
|
148
122
|
} else if (messageFromFrontend.method === 'dispatchProtocolMessage') {
|
|
149
|
-
if (port.
|
|
150
|
-
port.
|
|
123
|
+
if (port.onMessage) {
|
|
124
|
+
port.onMessage(messageFromFrontend.params.message);
|
|
151
125
|
}
|
|
152
126
|
} else {
|
|
153
127
|
throw new Error(`Unknown event: ${event.data}`);
|
|
@@ -155,6 +129,7 @@ self.onmessage = async event => {
|
|
|
155
129
|
};
|
|
156
130
|
|
|
157
131
|
// Make lighthouse and traceviewer happy.
|
|
132
|
+
// @ts-expect-error https://github.com/GoogleChrome/lighthouse/issues/11628
|
|
158
133
|
globalThis.global = self;
|
|
159
134
|
// @ts-expect-error https://github.com/GoogleChrome/lighthouse/issues/11628
|
|
160
135
|
globalThis.global.isVinn = true;
|
|
@@ -164,5 +139,5 @@ globalThis.global.document = {};
|
|
|
164
139
|
globalThis.global.document.documentElement = {};
|
|
165
140
|
// @ts-expect-error https://github.com/GoogleChrome/lighthouse/issues/11628
|
|
166
141
|
globalThis.global.document.documentElement.style = {
|
|
167
|
-
WebkitAppearance: 'WebkitAppearance'
|
|
142
|
+
WebkitAppearance: 'WebkitAppearance',
|
|
168
143
|
};
|
package/front_end/entrypoints/lighthouse_worker/{lighthouse_worker.js → lighthouse_worker.ts}
RENAMED
|
File without changes
|
|
@@ -215,7 +215,7 @@ export class MainImpl {
|
|
|
215
215
|
clear: Host.InspectorFrontendHost.InspectorFrontendHostInstance.clearPreferences,
|
|
216
216
|
};
|
|
217
217
|
const globalStorage = new Common.Settings.SettingsStorage(prefs, hostStorage, storagePrefix);
|
|
218
|
-
Common.Settings.Settings.instance({forceNew: true, globalStorage, localStorage});
|
|
218
|
+
Common.Settings.Settings.instance({forceNew: true, syncedStorage: globalStorage, globalStorage, localStorage});
|
|
219
219
|
|
|
220
220
|
// @ts-ignore layout test global
|
|
221
221
|
self.Common.settings = Common.Settings.Settings.instance();
|
|
@@ -243,7 +243,6 @@ export class MainImpl {
|
|
|
243
243
|
'ignoreListJSFramesOnTimeline', 'Ignore List for JavaScript frames on Timeline', true);
|
|
244
244
|
Root.Runtime.experiments.register(
|
|
245
245
|
'cssOverview', 'CSS Overview', undefined, 'https://developer.chrome.com/blog/new-in-devtools-87/#css-overview');
|
|
246
|
-
Root.Runtime.experiments.register('emptySourceMapAutoStepping', 'Empty sourcemap auto-stepping');
|
|
247
246
|
Root.Runtime.experiments.register('inputEventsOnTimelineOverview', 'Input events on Timeline overview', true);
|
|
248
247
|
Root.Runtime.experiments.register('liveHeapProfile', 'Live heap profile', true);
|
|
249
248
|
Root.Runtime.experiments.register(
|
|
@@ -317,6 +316,9 @@ export class MainImpl {
|
|
|
317
316
|
'hideIssuesFeature', 'Enable experimental hide issues menu', undefined,
|
|
318
317
|
'https://developer.chrome.com/blog/new-in-devtools-94/#hide-issues');
|
|
319
318
|
|
|
319
|
+
// Hide Issues Feature.
|
|
320
|
+
Root.Runtime.experiments.register('groupAndHideIssuesByKind', 'Allow grouping and hiding of issues by IssueKind');
|
|
321
|
+
|
|
320
322
|
// Localized DevTools, hide "locale selector" setting behind an experiment.
|
|
321
323
|
Root.Runtime.experiments.register(Root.Runtime.ExperimentName.LOCALIZED_DEVTOOLS, 'Enable localized DevTools');
|
|
322
324
|
|
|
@@ -527,6 +529,9 @@ export class MainImpl {
|
|
|
527
529
|
Timeline.TimelinePanel.LoadTimelineHandler.instance().handleQueryParam(value);
|
|
528
530
|
}
|
|
529
531
|
|
|
532
|
+
// Initialize ARIAUtils.alert Element
|
|
533
|
+
UI.ARIAUtils.alertElementInstance();
|
|
534
|
+
|
|
530
535
|
// Allow UI cycles to repaint prior to creating connection.
|
|
531
536
|
setTimeout(this.initializeTarget.bind(this), 0);
|
|
532
537
|
MainImpl.timeEnd('Main._showAppUI');
|
|
@@ -725,11 +725,11 @@ ElementsTestRunner.dumpElementsTree = function(rootNode, depth, resultsArray) {
|
|
|
725
725
|
return element.innerText.replace(/\u200b/g, '').replace(/\n/g, '\\n').trim();
|
|
726
726
|
}
|
|
727
727
|
|
|
728
|
-
function dumpMap(name,
|
|
728
|
+
function dumpMap(name, node) {
|
|
729
729
|
const result = [];
|
|
730
730
|
|
|
731
|
-
for (const id of
|
|
732
|
-
result.push(id + '=' +
|
|
731
|
+
for (const id of node.getMarkerKeysForTest()) {
|
|
732
|
+
result.push(id + '=' + node.marker(id));
|
|
733
733
|
}
|
|
734
734
|
|
|
735
735
|
if (!result.length) {
|
|
@@ -748,7 +748,7 @@ ElementsTestRunner.dumpElementsTree = function(rootNode, depth, resultsArray) {
|
|
|
748
748
|
const node = treeItem.node && treeItem.node();
|
|
749
749
|
|
|
750
750
|
if (node) {
|
|
751
|
-
markers += dumpMap('markers', node
|
|
751
|
+
markers += dumpMap('markers', node);
|
|
752
752
|
const dump = (node.subtreeMarkerCount ? 'subtreeMarkerCount:' + node.subtreeMarkerCount : '');
|
|
753
753
|
|
|
754
754
|
if (dump) {
|
|
@@ -49,7 +49,7 @@ SDKTestRunner.PageMock = class {
|
|
|
49
49
|
self.Bindings.debuggerWorkspaceBinding.resetForTest(TestRunner.mainTarget);
|
|
50
50
|
self.Bindings.resourceMapping.resetForTest(TestRunner.mainTarget);
|
|
51
51
|
this.enabledDomains.clear();
|
|
52
|
-
self.SDK.targetManager.
|
|
52
|
+
self.SDK.targetManager.clearAllTargetsForTest();
|
|
53
53
|
|
|
54
54
|
const oldFactory = ProtocolClient.Connection.getFactory();
|
|
55
55
|
ProtocolClient.Connection.setFactory(() => {
|
|
@@ -90,8 +90,6 @@ export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObser
|
|
|
90
90
|
return true;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
// TODO(crbug.com/1018234): Also take into account source maps here and remove the auto-stepping
|
|
94
|
-
// logic in the front-end (which is currently still an experiment) completely.
|
|
95
93
|
const rawLocation = callFrame.location();
|
|
96
94
|
if (!rawLocation) {
|
|
97
95
|
return [];
|
|
@@ -118,10 +116,6 @@ export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObser
|
|
|
118
116
|
}
|
|
119
117
|
}
|
|
120
118
|
|
|
121
|
-
if (!Root.Runtime.experiments.isEnabled('emptySourceMapAutoStepping')) {
|
|
122
|
-
return [];
|
|
123
|
-
}
|
|
124
|
-
|
|
125
119
|
const compilerMapping = this.debuggerModelToData.get(rawLocation.debuggerModel)?.compilerMapping;
|
|
126
120
|
if (!compilerMapping) {
|
|
127
121
|
return [];
|
|
@@ -0,0 +1,86 @@
|
|
|
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 SDK from '../../core/sdk/sdk.js';
|
|
7
|
+
import * as Protocol from '../../generated/protocol.js';
|
|
8
|
+
|
|
9
|
+
import {Issue, IssueCategory, IssueKind} from './Issue.js';
|
|
10
|
+
import type {LazyMarkdownIssueDescription, MarkdownIssueDescription} from './MarkdownIssueDescription.js';
|
|
11
|
+
import {resolveLazyDescription} from './MarkdownIssueDescription.js';
|
|
12
|
+
|
|
13
|
+
const UIStrings = {
|
|
14
|
+
/**
|
|
15
|
+
*@description Title for cross-origin portal post message error
|
|
16
|
+
*/
|
|
17
|
+
crossOriginPortalPostMessage: 'Portals - Same-origin communication channels',
|
|
18
|
+
};
|
|
19
|
+
const str_ = i18n.i18n.registerUIStrings('models/issues_manager/GenericIssue.ts', UIStrings);
|
|
20
|
+
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
21
|
+
|
|
22
|
+
export class GenericIssue extends Issue {
|
|
23
|
+
private issueDetails: Protocol.Audits.GenericIssueDetails;
|
|
24
|
+
|
|
25
|
+
constructor(
|
|
26
|
+
issueDetails: Protocol.Audits.GenericIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel,
|
|
27
|
+
issueId?: Protocol.Audits.IssueId) {
|
|
28
|
+
const issueCode = [
|
|
29
|
+
Protocol.Audits.InspectorIssueCode.GenericIssue,
|
|
30
|
+
issueDetails.errorType,
|
|
31
|
+
].join('::');
|
|
32
|
+
super(issueCode, issuesModel, issueId);
|
|
33
|
+
this.issueDetails = issueDetails;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
getCategory(): IssueCategory {
|
|
37
|
+
return IssueCategory.Generic;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
primaryKey(): string {
|
|
41
|
+
return `${this.code()}-(${this.issueDetails.frameId})`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
getDescription(): MarkdownIssueDescription|null {
|
|
45
|
+
const description = issueDescriptions.get(this.issueDetails.errorType);
|
|
46
|
+
if (!description) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
return resolveLazyDescription(description);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
details(): Protocol.Audits.GenericIssueDetails {
|
|
53
|
+
return this.issueDetails;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
getKind(): IssueKind {
|
|
57
|
+
return IssueKind.Improvement;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
static fromInspectorIssue(issuesModel: SDK.IssuesModel.IssuesModel, inspectorIssue: Protocol.Audits.InspectorIssue):
|
|
61
|
+
GenericIssue[] {
|
|
62
|
+
const genericDetails = inspectorIssue.details.genericIssueDetails;
|
|
63
|
+
if (!genericDetails) {
|
|
64
|
+
console.warn('Generic issue without details received.');
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
return [new GenericIssue(genericDetails, issuesModel, inspectorIssue.issueId)];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const genericCrossOriginPortalPostMessageError = {
|
|
72
|
+
file: 'genericCrossOriginPortalPostMessageError.md',
|
|
73
|
+
links: [{
|
|
74
|
+
link: 'https://github.com/WICG/portals#same-origin-communication-channels',
|
|
75
|
+
linkTitle: i18nLazyString(UIStrings.crossOriginPortalPostMessage),
|
|
76
|
+
}],
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const genericCrossOriginPortalPostMessageCode = [
|
|
80
|
+
Protocol.Audits.InspectorIssueCode.GenericIssue,
|
|
81
|
+
Protocol.Audits.GenericIssueErrorType.CrossOriginPortalPostMessageError,
|
|
82
|
+
].join('::');
|
|
83
|
+
|
|
84
|
+
const issueDescriptions: Map<Protocol.Audits.GenericIssueErrorType, LazyMarkdownIssueDescription> = new Map([
|
|
85
|
+
[Protocol.Audits.GenericIssueErrorType.CrossOriginPortalPostMessageError, genericCrossOriginPortalPostMessageError],
|
|
86
|
+
]);
|
|
@@ -11,6 +11,18 @@ import type * as Protocol from '../../generated/protocol.js';
|
|
|
11
11
|
import type {MarkdownIssueDescription} from './MarkdownIssueDescription.js';
|
|
12
12
|
|
|
13
13
|
const UIStrings = {
|
|
14
|
+
/**
|
|
15
|
+
*@description The kind of an issue (plural) (Issues are categorized into kinds).
|
|
16
|
+
*/
|
|
17
|
+
improvements: 'Improvements',
|
|
18
|
+
/**
|
|
19
|
+
*@description The kind of an issue (plural) (Issues are categorized into kinds).
|
|
20
|
+
*/
|
|
21
|
+
pageErrors: 'Page Errors',
|
|
22
|
+
/**
|
|
23
|
+
*@description The kind of an issue (plural) (Issues are categorized into kinds).
|
|
24
|
+
*/
|
|
25
|
+
breakingChanges: 'Breaking Changes',
|
|
14
26
|
/**
|
|
15
27
|
*@description A description for a kind of issue we display in the issues tab.
|
|
16
28
|
*/
|
|
@@ -30,6 +42,7 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
|
30
42
|
// eslint-disable-next-line rulesdir/const_enum
|
|
31
43
|
export enum IssueCategory {
|
|
32
44
|
CrossOriginEmbedderPolicy = 'CrossOriginEmbedderPolicy',
|
|
45
|
+
Generic = 'Generic',
|
|
33
46
|
MixedContent = 'MixedContent',
|
|
34
47
|
SameSiteCookie = 'SameSiteCookie',
|
|
35
48
|
HeavyAd = 'HeavyAd',
|
|
@@ -63,6 +76,17 @@ export enum IssueKind {
|
|
|
63
76
|
Improvement = 'Improvement',
|
|
64
77
|
}
|
|
65
78
|
|
|
79
|
+
export function getIssueKindName(issueKind: IssueKind): Common.UIString.LocalizedString {
|
|
80
|
+
switch (issueKind) {
|
|
81
|
+
case IssueKind.BreakingChange:
|
|
82
|
+
return i18nString(UIStrings.breakingChanges);
|
|
83
|
+
case IssueKind.Improvement:
|
|
84
|
+
return i18nString(UIStrings.improvements);
|
|
85
|
+
case IssueKind.PageError:
|
|
86
|
+
return i18nString(UIStrings.pageErrors);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
66
90
|
export function getIssueKindDescription(issueKind: IssueKind): Common.UIString.LocalizedString {
|
|
67
91
|
switch (issueKind) {
|
|
68
92
|
case IssueKind.PageError:
|
|
@@ -12,6 +12,7 @@ import {ContentSecurityPolicyIssue} from './ContentSecurityPolicyIssue.js';
|
|
|
12
12
|
import {CorsIssue} from './CorsIssue.js';
|
|
13
13
|
import {CrossOriginEmbedderPolicyIssue, isCrossOriginEmbedderPolicyIssue} from './CrossOriginEmbedderPolicyIssue.js';
|
|
14
14
|
import {DeprecationIssue} from './DeprecationIssue.js';
|
|
15
|
+
import {GenericIssue} from './GenericIssue.js';
|
|
15
16
|
import {HeavyAdIssue} from './HeavyAdIssue.js';
|
|
16
17
|
import type {Issue, IssueKind} from './Issue.js';
|
|
17
18
|
import {Events} from './IssuesManagerEvents.js';
|
|
@@ -94,6 +95,10 @@ const issueCodeHandlers = new Map<
|
|
|
94
95
|
Protocol.Audits.InspectorIssueCode.WasmCrossOriginModuleSharingIssue,
|
|
95
96
|
WasmCrossOriginModuleSharingIssue.fromInspectorIssue,
|
|
96
97
|
],
|
|
98
|
+
[
|
|
99
|
+
Protocol.Audits.InspectorIssueCode.GenericIssue,
|
|
100
|
+
GenericIssue.fromInspectorIssue,
|
|
101
|
+
],
|
|
97
102
|
]);
|
|
98
103
|
|
|
99
104
|
/**
|
|
@@ -154,7 +159,7 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
154
159
|
private allIssues = new Map<string, Issue>();
|
|
155
160
|
private filteredIssues = new Map<string, Issue>();
|
|
156
161
|
private issueCounts = new Map<IssueKind, number>();
|
|
157
|
-
private hiddenIssueCount
|
|
162
|
+
private hiddenIssueCount = new Map<IssueKind, number>();
|
|
158
163
|
private hasSeenTopFrameNavigated = false;
|
|
159
164
|
private sourceFrameIssuesManager = new SourceFrameIssuesManager(this);
|
|
160
165
|
private issuesById: Map<string, Issue> = new Map();
|
|
@@ -273,7 +278,7 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
273
278
|
this.updateIssueHiddenStatus(issue, values);
|
|
274
279
|
}
|
|
275
280
|
if (issue.isHidden()) {
|
|
276
|
-
this.hiddenIssueCount
|
|
281
|
+
this.hiddenIssueCount.set(issue.getKind(), 1 + (this.hiddenIssueCount.get(issue.getKind()) || 0));
|
|
277
282
|
}
|
|
278
283
|
this.dispatchEventToListeners(Events.IssueAdded, {issuesModel, issue});
|
|
279
284
|
}
|
|
@@ -293,8 +298,15 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
293
298
|
return this.filteredIssues.size;
|
|
294
299
|
}
|
|
295
300
|
|
|
296
|
-
numberOfHiddenIssues(): number {
|
|
297
|
-
|
|
301
|
+
numberOfHiddenIssues(kind?: IssueKind): number {
|
|
302
|
+
if (kind) {
|
|
303
|
+
return this.hiddenIssueCount.get(kind) ?? 0;
|
|
304
|
+
}
|
|
305
|
+
let count = 0;
|
|
306
|
+
for (const num of this.hiddenIssueCount.values()) {
|
|
307
|
+
count += num;
|
|
308
|
+
}
|
|
309
|
+
return count;
|
|
298
310
|
}
|
|
299
311
|
|
|
300
312
|
numberOfAllStoredIssues(): number {
|
|
@@ -327,7 +339,7 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
327
339
|
this.filteredIssues.clear();
|
|
328
340
|
this.issueCounts.clear();
|
|
329
341
|
this.issuesById.clear();
|
|
330
|
-
this.hiddenIssueCount
|
|
342
|
+
this.hiddenIssueCount.clear();
|
|
331
343
|
const values = this.hideIssueSetting?.get();
|
|
332
344
|
const hideIssuesFeature = Root.Runtime.experiments.isEnabled('hideIssuesFeature');
|
|
333
345
|
for (const [key, issue] of this.allIssues) {
|
|
@@ -338,7 +350,7 @@ export class IssuesManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes
|
|
|
338
350
|
this.filteredIssues.set(key, issue);
|
|
339
351
|
this.issueCounts.set(issue.getKind(), 1 + (this.issueCounts.get(issue.getKind()) ?? 0));
|
|
340
352
|
if (issue.isHidden()) {
|
|
341
|
-
this.hiddenIssueCount
|
|
353
|
+
this.hiddenIssueCount.set(issue.getKind(), 1 + (this.hiddenIssueCount.get(issue.getKind()) || 0));
|
|
342
354
|
}
|
|
343
355
|
const issueId = issue.getIssueId();
|
|
344
356
|
if (issueId) {
|
package/front_end/models/issues_manager/descriptions/genericCrossOriginPortalPostMessageError.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Cross-origin portal post messages are blocked on your site
|
|
2
|
+
|
|
3
|
+
In order to prevent cross-site tracking, cross-origin portal content cannot communicate with the page tha embeds it. `window.portalHost.postMessage()` is blocked: messages will not be sent from the portal to the page that embeds it.
|
|
@@ -8,6 +8,7 @@ import * as ContrastCheckTrigger from './ContrastCheckTrigger.js';
|
|
|
8
8
|
import * as CorsIssue from './CorsIssue.js';
|
|
9
9
|
import * as CrossOriginEmbedderPolicyIssue from './CrossOriginEmbedderPolicyIssue.js';
|
|
10
10
|
import * as DeprecationIssue from './DeprecationIssue.js';
|
|
11
|
+
import * as GenericIssue from './GenericIssue.js';
|
|
11
12
|
import * as HeavyAdIssue from './HeavyAdIssue.js';
|
|
12
13
|
import * as Issue from './Issue.js';
|
|
13
14
|
import * as IssueResolver from './IssueResolver.js';
|
|
@@ -30,6 +31,7 @@ export {
|
|
|
30
31
|
CorsIssue,
|
|
31
32
|
CrossOriginEmbedderPolicyIssue,
|
|
32
33
|
DeprecationIssue,
|
|
34
|
+
GenericIssue,
|
|
33
35
|
HeavyAdIssue,
|
|
34
36
|
Issue,
|
|
35
37
|
IssueResolver,
|