chrome-devtools-frontend 1.0.1660788 → 1.0.1662289
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/.agents/skills/evaluate-ai-css-completion/SKILL.md +143 -0
- package/.agents/skills/evaluate-ai-css-completion/scripts/evaluate.js +104 -0
- package/.agents/skills/migrate-chromium-test/SKILL.md +7 -2
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +7 -1
- package/docs/ui_engineering.md +75 -42
- package/eslint.config.mjs +7 -0
- package/extension-api/ExtensionAPI.d.ts +88 -0
- package/front_end/core/common/SettingRegistration.ts +0 -5
- package/front_end/core/host/InspectorFrontendHost.ts +1 -0
- package/front_end/core/host/InspectorFrontendHostStub.ts +2 -0
- package/front_end/core/platform/ArrayUtilities.ts +10 -0
- package/front_end/core/platform/StringUtilities.ts +20 -4
- package/front_end/core/sdk/CPUThrottlingManager.ts +2 -0
- package/front_end/core/sdk/DOMDebuggerModel.ts +2 -0
- package/front_end/core/sdk/DOMModel.ts +1 -0
- package/front_end/core/sdk/DebuggerModel.ts +4 -4
- package/front_end/core/sdk/EventBreakpointsModel.ts +2 -0
- package/front_end/core/sdk/FrameManager.ts +1 -0
- package/front_end/core/sdk/IsolateManager.ts +1 -0
- package/front_end/core/sdk/NetworkManager.ts +2 -0
- package/front_end/core/sdk/NetworkRequest.ts +1 -0
- package/front_end/core/sdk/PageResourceLoader.ts +2 -0
- package/front_end/core/sdk/SourceMap.ts +5 -5
- package/front_end/core/sdk/SourceMapManager.ts +3 -2
- package/front_end/core/sdk/TargetManager.ts +4 -0
- package/front_end/entrypoints/main/MainImpl.ts +2 -1
- package/front_end/foundation/README.md +86 -0
- package/front_end/generated/InspectorBackendCommands.ts +4 -5
- package/front_end/generated/protocol.ts +20 -38
- package/front_end/models/bindings/CompilerScriptMapping.ts +5 -5
- package/front_end/models/bindings/ContentProviderBasedProject.ts +2 -3
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +3 -3
- package/front_end/models/bindings/DefaultScriptMapping.ts +3 -3
- package/front_end/models/bindings/ResourceMapping.ts +3 -3
- package/front_end/models/bindings/ResourceScriptMapping.ts +2 -2
- package/front_end/models/bindings/SASSSourceMapping.ts +3 -3
- package/front_end/models/bindings/TempFile.ts +8 -3
- package/front_end/models/extensions/ExtensionAPI.ts +110 -46
- package/front_end/models/extensions/RecorderExtensionEndpoint.ts +7 -5
- package/front_end/models/formatter/ScriptFormatter.ts +8 -11
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +14 -5
- package/front_end/models/issues_manager/CheckFormsIssuesTrigger.ts +8 -9
- package/front_end/models/issues_manager/CookieIssue.ts +21 -9
- package/front_end/models/issues_manager/Issue.ts +3 -4
- package/front_end/models/issues_manager/IssueAggregator.ts +0 -9
- package/front_end/models/issues_manager/IssueResolver.ts +2 -2
- package/front_end/models/issues_manager/IssuesManager.ts +136 -137
- package/front_end/models/issues_manager/RelatedIssue.ts +10 -8
- package/front_end/models/issues_manager/issues_manager.ts +0 -2
- package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
- package/front_end/models/logs/RequestResolver.ts +2 -2
- package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +12 -9
- package/front_end/models/trace/handlers/FramesHandler.ts +4 -7
- package/front_end/models/trace/handlers/ModelHandlers.ts +0 -1
- package/front_end/models/trace/handlers/RendererHandler.ts +2 -15
- package/front_end/models/trace/handlers/Threads.ts +4 -11
- package/front_end/models/trace/insights/DOMSize.ts +1 -1
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +10 -4
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +2 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +0 -44
- package/front_end/panels/application/CookieItemsView.ts +1 -1
- package/front_end/panels/application/ServiceWorkersView.ts +494 -411
- package/front_end/panels/application/WebMCPView.ts +38 -43
- package/front_end/panels/application/application.ts +0 -6
- package/front_end/panels/application/components/AdsView.ts +201 -30
- package/front_end/panels/application/components/adsView.css +25 -0
- package/front_end/panels/application/components/components.ts +0 -2
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +1 -1
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +2 -2
- package/front_end/panels/application/serviceWorkersView.css +40 -4
- package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +147 -123
- package/front_end/panels/common/ExtensionServer.ts +3 -3
- package/front_end/panels/console/ConsoleView.ts +3 -2
- package/front_end/panels/console/PromptBuilder.ts +2 -1
- package/front_end/panels/emulation/DeviceModeView.ts +164 -113
- package/front_end/panels/issues/AffectedResourcesView.ts +1 -1
- package/front_end/panels/issues/IssueView.ts +0 -2
- package/front_end/panels/issues/IssuesPane.ts +1 -8
- package/front_end/panels/js_timeline/js_timeline-meta.ts +3 -2
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +53 -12
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +3 -3
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +5 -5
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +4 -4
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +2 -2
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +6 -6
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +3 -3
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +8 -9
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplayUtils.ts +2 -2
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +1 -1
- package/front_end/panels/linear_memory_inspector/linear_memory_inspector-meta.ts +2 -2
- package/front_end/panels/network/RequestPayloadView.ts +92 -52
- package/front_end/panels/network/RequestTimingView.ts +95 -127
- package/front_end/panels/network/components/ResponseHeaderSection.ts +5 -3
- package/front_end/panels/profiler/HeapSnapshotView.ts +3 -3
- package/front_end/panels/profiler/WritableProfileHeader.ts +2 -2
- package/front_end/panels/recorder/{components/ControlButton.ts → ControlButton.ts} +9 -10
- package/front_end/panels/recorder/{components/CreateRecordingView.ts → CreateRecordingView.ts} +48 -47
- package/front_end/panels/recorder/{components/ExtensionView.ts → ExtensionView.ts} +8 -8
- package/front_end/panels/recorder/RecorderController.ts +302 -127
- package/front_end/panels/recorder/RecorderPanel.ts +1 -1
- package/front_end/panels/recorder/{components/RecordingListView.ts → RecordingListView.ts} +19 -20
- package/front_end/panels/recorder/{components/RecordingView.ts → RecordingView.ts} +88 -88
- package/front_end/panels/recorder/{components/ReplaySection.ts → ReplaySection.ts} +11 -11
- package/front_end/panels/recorder/{components/SelectorPicker.ts → SelectorPicker.ts} +13 -13
- package/front_end/panels/recorder/{components/StepEditor.ts → StepEditor.ts} +15 -15
- package/front_end/panels/recorder/{components/StepView.ts → StepView.ts} +10 -10
- package/front_end/panels/recorder/{components/TimelineSection.ts → TimelineSection.ts} +2 -2
- package/front_end/panels/recorder/recorder.ts +23 -1
- package/front_end/panels/recorder/util/util.ts +113 -0
- package/front_end/panels/sources/SourcesView.ts +0 -17
- package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +42 -0
- package/front_end/panels/sources/sources.ts +0 -2
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +0 -17
- package/front_end/panels/timeline/IsolateSelector.ts +10 -8
- package/front_end/panels/timeline/ThreadAppender.ts +0 -106
- package/front_end/panels/timeline/TimelinePanel.ts +18 -7
- package/front_end/panels/timeline/TimelineUIUtils.ts +144 -129
- package/front_end/panels/timeline/timeline-meta.ts +3 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/report_view/ReportView.ts +11 -5
- package/front_end/ui/components/report_view/report.css +4 -1
- package/front_end/ui/legacy/TextPrompt.ts +49 -1
- package/front_end/ui/legacy/Treeoutline.ts +3 -0
- package/front_end/ui/legacy/UIUtils.ts +11 -1
- package/front_end/ui/legacy/Widget.ts +14 -15
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +2 -2
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +11 -7
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -1
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +10 -1
- package/front_end/ui/legacy/textPrompt.css +10 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +1 -1
- package/front_end/models/issues_manager/AttributionReportingIssue.ts +0 -247
- package/front_end/models/issues_manager/descriptions/arInsecureContext.md +0 -7
- package/front_end/models/issues_manager/descriptions/arInvalidInfoHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsSourceHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsTriggerHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arInvalidRegisterSourceHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arInvalidRegisterTriggerHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNavigationRegistrationUniqueScopeAlreadySet.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNavigationRegistrationWithoutTransientUserActivation.md +0 -6
- package/front_end/models/issues_manager/descriptions/arNoRegisterOsSourceHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNoRegisterOsTriggerHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNoRegisterSourceHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNoRegisterTriggerHeader.md +0 -5
- package/front_end/models/issues_manager/descriptions/arNoWebOrOsSupport.md +0 -4
- package/front_end/models/issues_manager/descriptions/arOsSourceIgnored.md +0 -18
- package/front_end/models/issues_manager/descriptions/arOsTriggerIgnored.md +0 -19
- package/front_end/models/issues_manager/descriptions/arPermissionPolicyDisabled.md +0 -8
- package/front_end/models/issues_manager/descriptions/arSourceAndTriggerHeaders.md +0 -9
- package/front_end/models/issues_manager/descriptions/arSourceIgnored.md +0 -13
- package/front_end/models/issues_manager/descriptions/arTriggerIgnored.md +0 -12
- package/front_end/models/issues_manager/descriptions/arUntrustworthyReportingOrigin.md +0 -10
- package/front_end/models/issues_manager/descriptions/arWebAndOsHeaders.md +0 -11
- package/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +0 -183
- package/front_end/panels/application/InterestGroupStorageModel.ts +0 -81
- package/front_end/panels/application/InterestGroupStorageView.ts +0 -151
- package/front_end/panels/application/InterestGroupTreeElement.ts +0 -65
- package/front_end/panels/application/components/InterestGroupAccessGrid.ts +0 -135
- package/front_end/panels/application/components/interestGroupAccessGrid.css +0 -27
- package/front_end/panels/application/interestGroupStorageView.css +0 -9
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +0 -182
- package/front_end/panels/recorder/components/components.ts +0 -25
- package/front_end/panels/recorder/components/util.ts +0 -116
- package/front_end/panels/sources/InplaceFormatterEditorAction.ts +0 -149
- /package/front_end/panels/recorder/{components/controlButton.css → controlButton.css} +0 -0
- /package/front_end/panels/recorder/{components/createRecordingView.css → createRecordingView.css} +0 -0
- /package/front_end/panels/recorder/{components/extensionView.css → extensionView.css} +0 -0
- /package/front_end/panels/recorder/{components/recordingListView.css → recordingListView.css} +0 -0
- /package/front_end/panels/recorder/{components/recordingView.css → recordingView.css} +0 -0
- /package/front_end/panels/recorder/{components/replaySection.css → replaySection.css} +0 -0
- /package/front_end/panels/recorder/{components/selectorPicker.css → selectorPicker.css} +0 -0
- /package/front_end/panels/recorder/{components/startView.css → startView.css} +0 -0
- /package/front_end/panels/recorder/{components/stepEditor.css → stepEditor.css} +0 -0
- /package/front_end/panels/recorder/{components/stepView.css → stepView.css} +0 -0
- /package/front_end/panels/recorder/{components/timelineSection.css → timelineSection.css} +0 -0
|
@@ -6,22 +6,24 @@ import type * as Platform from '../../core/platform/platform.js';
|
|
|
6
6
|
|
|
7
7
|
import {PrivateAPI} from './ExtensionAPI.js';
|
|
8
8
|
import {ExtensionEndpoint} from './ExtensionEndpoint.js';
|
|
9
|
-
import {RecorderPluginManager} from './RecorderPluginManager.js';
|
|
9
|
+
import type {RecorderPluginManager} from './RecorderPluginManager.js';
|
|
10
10
|
|
|
11
11
|
export class RecorderExtensionEndpoint extends ExtensionEndpoint {
|
|
12
12
|
private readonly name: string;
|
|
13
13
|
private readonly mediaType?: string;
|
|
14
14
|
private readonly capabilities: PrivateAPI.RecordingExtensionPluginCapability[];
|
|
15
15
|
readonly #extensionOrigin: Platform.DevToolsPath.UrlString;
|
|
16
|
+
readonly #recorderPluginManager: RecorderPluginManager;
|
|
16
17
|
|
|
17
|
-
constructor(
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
constructor(name: string, port: MessagePort, capabilities: PrivateAPI.RecordingExtensionPluginCapability[],
|
|
19
|
+
extensionOrigin: Platform.DevToolsPath.UrlString, recorderPluginManager: RecorderPluginManager,
|
|
20
|
+
mediaType?: string) {
|
|
20
21
|
super(port);
|
|
21
22
|
this.name = name;
|
|
22
23
|
this.mediaType = mediaType;
|
|
23
24
|
this.capabilities = capabilities;
|
|
24
25
|
this.#extensionOrigin = extensionOrigin;
|
|
26
|
+
this.#recorderPluginManager = recorderPluginManager;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
getName(): string {
|
|
@@ -44,7 +46,7 @@ export class RecorderExtensionEndpoint extends ExtensionEndpoint {
|
|
|
44
46
|
switch (event) {
|
|
45
47
|
case PrivateAPI.RecorderExtensionPluginEvents.UnregisteredRecorderExtensionPlugin: {
|
|
46
48
|
this.disconnect();
|
|
47
|
-
|
|
49
|
+
this.#recorderPluginManager.removePlugin(this);
|
|
48
50
|
break;
|
|
49
51
|
}
|
|
50
52
|
default:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import * as Common from '../../core/common/common.js';
|
|
5
|
+
import type * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as Platform from '../../core/platform/platform.js';
|
|
7
7
|
import type * as FormatterActions from '../../entrypoints/formatter_worker/FormatterActions.js';
|
|
8
8
|
|
|
@@ -30,28 +30,25 @@ export interface FormattedContent {
|
|
|
30
30
|
formattedMapping: FormatterSourceMapping;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export async function format(
|
|
34
|
-
|
|
35
|
-
indent: string =
|
|
36
|
-
Common.Settings.Settings.instance().moduleSetting('text-editor-indent').get()): Promise<FormattedContent> {
|
|
33
|
+
export async function format(settings: Common.Settings.Settings, contentType: Common.ResourceType.ResourceType,
|
|
34
|
+
mimeType: string, content: string, indent?: string): Promise<FormattedContent> {
|
|
37
35
|
if (contentType.isDocumentOrScriptOrStyleSheet()) {
|
|
38
|
-
return await formatScriptContent(mimeType, content, indent);
|
|
36
|
+
return await formatScriptContent(settings, mimeType, content, indent);
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
return {formattedContent: content, formattedMapping: new IdentityFormatterSourceMapping()};
|
|
42
40
|
}
|
|
43
41
|
|
|
44
|
-
export async function formatScriptContent(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Common.Settings.Settings.instance().moduleSetting('text-editor-indent').get()): Promise<FormattedContent> {
|
|
42
|
+
export async function formatScriptContent(settings: Common.Settings.Settings, mimeType: string, content: string,
|
|
43
|
+
indent?: string): Promise<FormattedContent> {
|
|
44
|
+
const indentString = indent ?? settings.moduleSetting('text-editor-indent').get();
|
|
48
45
|
const originalContent = content.replace(/\r\n?|[\n\u2028\u2029]/g, '\n').replace(/^\uFEFF/, '');
|
|
49
46
|
|
|
50
47
|
const pool = formatterWorkerPool();
|
|
51
48
|
|
|
52
49
|
let formatResult: FormatterActions.FormatResult = {content: originalContent, mapping: {original: [], formatted: []}};
|
|
53
50
|
try {
|
|
54
|
-
formatResult = await pool.format(mimeType, originalContent,
|
|
51
|
+
formatResult = await pool.format(mimeType, originalContent, indentString);
|
|
55
52
|
} catch {
|
|
56
53
|
}
|
|
57
54
|
const originalContentLineEndings = Platform.StringUtilities.findLineEndingIndexes(originalContent);
|
|
@@ -11,6 +11,7 @@ import type * as HeapSnapshotModel from './HeapSnapshotModel.js';
|
|
|
11
11
|
|
|
12
12
|
export class HeapSnapshotWorkerProxy extends Common.ObjectWrapper.ObjectWrapper<HeapSnapshotWorkerProxy.EventTypes> {
|
|
13
13
|
readonly eventHandler: (arg0: string, arg1: string) => void;
|
|
14
|
+
#console: Common.Console.Console;
|
|
14
15
|
nextObjectId = 1;
|
|
15
16
|
nextCallId = 1;
|
|
16
17
|
callbacks = new Map<number, (...args: any[]) => void>();
|
|
@@ -19,9 +20,14 @@ export class HeapSnapshotWorkerProxy extends Common.ObjectWrapper.ObjectWrapper<
|
|
|
19
20
|
interval?: number;
|
|
20
21
|
readonly workerUrl?: string;
|
|
21
22
|
|
|
22
|
-
constructor(
|
|
23
|
+
constructor(
|
|
24
|
+
eventHandler: (arg0: string, arg1: string) => void,
|
|
25
|
+
console: Common.Console.Console,
|
|
26
|
+
workerUrl?: string,
|
|
27
|
+
) {
|
|
23
28
|
super();
|
|
24
29
|
this.eventHandler = eventHandler;
|
|
30
|
+
this.#console = console;
|
|
25
31
|
this.workerUrl = workerUrl;
|
|
26
32
|
this.worker = Platform.HostRuntime.HOST_RUNTIME.createWorker(
|
|
27
33
|
workerUrl ?? import.meta.resolve('../../entrypoints/heap_snapshot_worker/heap_snapshot_worker-entrypoint.js'),
|
|
@@ -29,6 +35,10 @@ export class HeapSnapshotWorkerProxy extends Common.ObjectWrapper.ObjectWrapper<
|
|
|
29
35
|
this.worker.onmessage = this.messageReceived.bind(this);
|
|
30
36
|
}
|
|
31
37
|
|
|
38
|
+
get console(): Common.Console.Console {
|
|
39
|
+
return this.#console;
|
|
40
|
+
}
|
|
41
|
+
|
|
32
42
|
createLoader(profileUid: number, snapshotReceivedCallback: (arg0: HeapSnapshotProxy) => void):
|
|
33
43
|
HeapSnapshotLoaderProxy {
|
|
34
44
|
const objectId = this.nextObjectId++;
|
|
@@ -159,9 +169,8 @@ export class HeapSnapshotWorkerProxy extends Common.ObjectWrapper.ObjectWrapper<
|
|
|
159
169
|
return;
|
|
160
170
|
}
|
|
161
171
|
if (data.error) {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
Common.Console.Console.instance().error(data['errorCallStack']);
|
|
172
|
+
this.#console.error(`An error occurred when a call to method '${data.errorMethodName}' was requested`);
|
|
173
|
+
this.#console.error(data['errorCallStack']);
|
|
165
174
|
this.callbacks.delete(data.callId);
|
|
166
175
|
return;
|
|
167
176
|
}
|
|
@@ -238,7 +247,7 @@ export class HeapSnapshotLoaderProxy extends HeapSnapshotProxyObject implements
|
|
|
238
247
|
|
|
239
248
|
async close(): Promise<void> {
|
|
240
249
|
await this.callMethodPromise('close');
|
|
241
|
-
const secondWorker = new HeapSnapshotWorkerProxy(() => {}, this.worker.workerUrl);
|
|
250
|
+
const secondWorker = new HeapSnapshotWorkerProxy(() => {}, this.worker.console, this.worker.workerUrl);
|
|
242
251
|
const channel = new MessageChannel();
|
|
243
252
|
await secondWorker.setupForSecondaryInit(channel.port2);
|
|
244
253
|
const snapshotProxy = await this.callFactoryMethodPromise('buildSnapshot', HeapSnapshotProxy, [channel.port1]);
|
|
@@ -3,20 +3,19 @@
|
|
|
3
3
|
// Use of this source code is governed by a BSD-style license that can be
|
|
4
4
|
// found in the LICENSE file.
|
|
5
5
|
import type * as Common from '../../core/common/common.js';
|
|
6
|
+
import * as Root from '../../core/root/root.js';
|
|
6
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Responsible for asking autofill for current form issues. This currently happens when devtools is first open.
|
|
10
11
|
*/
|
|
11
12
|
// TODO(crbug.com/1399414): Trigger check form issues when an element with an associated issue is editted in the issues panel.
|
|
12
|
-
let checkFormsIssuesTriggerInstance: CheckFormsIssuesTrigger|null = null;
|
|
13
13
|
export class CheckFormsIssuesTrigger {
|
|
14
|
-
constructor() {
|
|
15
|
-
SDK.
|
|
16
|
-
|
|
17
|
-
{scoped: true});
|
|
14
|
+
constructor(targetManager: SDK.TargetManager.TargetManager = SDK.TargetManager.TargetManager.instance()) {
|
|
15
|
+
targetManager.addModelListener(SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.Load,
|
|
16
|
+
this.#pageLoaded, this, {scoped: true});
|
|
18
17
|
|
|
19
|
-
for (const model of
|
|
18
|
+
for (const model of targetManager.models(SDK.ResourceTreeModel.ResourceTreeModel)) {
|
|
20
19
|
if (model.target().outermostTarget() !== model.target()) {
|
|
21
20
|
continue;
|
|
22
21
|
}
|
|
@@ -26,10 +25,10 @@ export class CheckFormsIssuesTrigger {
|
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
static instance({forceNew}: {forceNew: boolean} = {forceNew: false}): CheckFormsIssuesTrigger {
|
|
29
|
-
if (!
|
|
30
|
-
|
|
28
|
+
if (!Root.DevToolsContext.globalInstance().has(CheckFormsIssuesTrigger) || forceNew) {
|
|
29
|
+
Root.DevToolsContext.globalInstance().set(CheckFormsIssuesTrigger, new CheckFormsIssuesTrigger());
|
|
31
30
|
}
|
|
32
|
-
return
|
|
31
|
+
return Root.DevToolsContext.globalInstance().get(CheckFormsIssuesTrigger);
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
// TODO(crbug.com/1399414): Handle response by dropping current issues in favor of new ones.
|
|
@@ -53,6 +53,15 @@ export const enum CookieStatus {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export class CookieIssue extends Issue<Protocol.Audits.CookieIssueDetails> {
|
|
56
|
+
readonly #frameManager: SDK.FrameManager.FrameManager;
|
|
57
|
+
|
|
58
|
+
constructor(code: string, issueDetails: Protocol.Audits.CookieIssueDetails,
|
|
59
|
+
issuesModel: SDK.IssuesModel.IssuesModel|null, issueId: Protocol.Audits.IssueId|undefined,
|
|
60
|
+
frameManager: SDK.FrameManager.FrameManager) {
|
|
61
|
+
super(code, issueDetails, issuesModel, issueId);
|
|
62
|
+
this.#frameManager = frameManager;
|
|
63
|
+
}
|
|
64
|
+
|
|
56
65
|
cookieId(): string {
|
|
57
66
|
const details = this.details();
|
|
58
67
|
if (details.cookie) {
|
|
@@ -72,9 +81,10 @@ export class CookieIssue extends Issue<Protocol.Audits.CookieIssueDetails> {
|
|
|
72
81
|
/**
|
|
73
82
|
* Returns an array of issues from a given CookieIssueDetails.
|
|
74
83
|
*/
|
|
75
|
-
static createIssuesFromCookieIssueDetails(
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
static createIssuesFromCookieIssueDetails(cookieIssueDetails: Protocol.Audits.CookieIssueDetails,
|
|
85
|
+
issuesModel: SDK.IssuesModel.IssuesModel|null,
|
|
86
|
+
issueId: Protocol.Audits.IssueId|undefined,
|
|
87
|
+
frameManager: SDK.FrameManager.FrameManager): CookieIssue[] {
|
|
78
88
|
const issues: CookieIssue[] = [];
|
|
79
89
|
|
|
80
90
|
// Exclusion reasons have priority. It means a cookie was blocked. Create an issue
|
|
@@ -86,7 +96,7 @@ export class CookieIssue extends Issue<Protocol.Audits.CookieIssueDetails> {
|
|
|
86
96
|
exclusionReason, cookieIssueDetails.cookieWarningReasons, cookieIssueDetails.operation,
|
|
87
97
|
cookieIssueDetails.cookieUrl as Platform.DevToolsPath.UrlString | undefined);
|
|
88
98
|
if (code) {
|
|
89
|
-
issues.push(new CookieIssue(code, cookieIssueDetails, issuesModel, issueId));
|
|
99
|
+
issues.push(new CookieIssue(code, cookieIssueDetails, issuesModel, issueId, frameManager));
|
|
90
100
|
}
|
|
91
101
|
}
|
|
92
102
|
return issues;
|
|
@@ -99,7 +109,7 @@ export class CookieIssue extends Issue<Protocol.Audits.CookieIssueDetails> {
|
|
|
99
109
|
warningReason, [], cookieIssueDetails.operation,
|
|
100
110
|
cookieIssueDetails.cookieUrl as Platform.DevToolsPath.UrlString | undefined);
|
|
101
111
|
if (code) {
|
|
102
|
-
issues.push(new CookieIssue(code, cookieIssueDetails, issuesModel, issueId));
|
|
112
|
+
issues.push(new CookieIssue(code, cookieIssueDetails, issuesModel, issueId, frameManager));
|
|
103
113
|
}
|
|
104
114
|
}
|
|
105
115
|
}
|
|
@@ -223,7 +233,7 @@ export class CookieIssue extends Issue<Protocol.Audits.CookieIssueDetails> {
|
|
|
223
233
|
}
|
|
224
234
|
|
|
225
235
|
override isCausedByThirdParty(): boolean {
|
|
226
|
-
const outermostFrame =
|
|
236
|
+
const outermostFrame = this.#frameManager.getOutermostFrame();
|
|
227
237
|
return isCausedByThirdParty(outermostFrame, this.details().cookieUrl, this.details().siteForCookies);
|
|
228
238
|
}
|
|
229
239
|
|
|
@@ -257,15 +267,17 @@ export class CookieIssue extends Issue<Protocol.Audits.CookieIssueDetails> {
|
|
|
257
267
|
return;
|
|
258
268
|
}
|
|
259
269
|
|
|
260
|
-
static fromInspectorIssue(
|
|
261
|
-
|
|
270
|
+
static fromInspectorIssue(issuesModel: SDK.IssuesModel.IssuesModel|null,
|
|
271
|
+
inspectorIssue: Protocol.Audits.InspectorIssue,
|
|
272
|
+
frameManager: SDK.FrameManager.FrameManager): CookieIssue[] {
|
|
262
273
|
const cookieIssueDetails = inspectorIssue.details.cookieIssueDetails;
|
|
263
274
|
if (!cookieIssueDetails) {
|
|
264
275
|
console.warn('Cookie issue without details received.');
|
|
265
276
|
return [];
|
|
266
277
|
}
|
|
267
278
|
|
|
268
|
-
return CookieIssue.createIssuesFromCookieIssueDetails(cookieIssueDetails, issuesModel, inspectorIssue.issueId
|
|
279
|
+
return CookieIssue.createIssuesFromCookieIssueDetails(cookieIssueDetails, issuesModel, inspectorIssue.issueId,
|
|
280
|
+
frameManager);
|
|
269
281
|
}
|
|
270
282
|
|
|
271
283
|
static getSubCategory(code: string): CookieIssueSubCategory {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import * as Common from '../../core/common/common.js';
|
|
5
|
+
import type * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as Host from '../../core/host/host.js';
|
|
7
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
8
|
import type * as Platform from '../../core/platform/platform.js';
|
|
@@ -49,7 +49,6 @@ export const enum IssueCategory {
|
|
|
49
49
|
CONTENT_SECURITY_POLICY = 'ContentSecurityPolicy',
|
|
50
50
|
LOW_TEXT_CONTRAST = 'LowTextContrast',
|
|
51
51
|
CORS = 'Cors',
|
|
52
|
-
ATTRIBUTION_REPORTING = 'AttributionReporting',
|
|
53
52
|
QUIRKS_MODE = 'QuirksMode',
|
|
54
53
|
PERMISSION_ELEMENT = 'PermissionElement',
|
|
55
54
|
SELECTIVE_PERMISSIONS_INTERVENTION = 'SelectivePermissionsIntervention',
|
|
@@ -112,8 +111,8 @@ export function unionIssueKind(a: IssueKind, b: IssueKind): IssueKind {
|
|
|
112
111
|
return IssueKind.IMPROVEMENT;
|
|
113
112
|
}
|
|
114
113
|
|
|
115
|
-
export function getShowThirdPartyIssuesSetting(): Common.Settings.Setting<boolean> {
|
|
116
|
-
return
|
|
114
|
+
export function getShowThirdPartyIssuesSetting(settings: Common.Settings.Settings): Common.Settings.Setting<boolean> {
|
|
115
|
+
return settings.createSetting('show-third-party-issues', true);
|
|
117
116
|
}
|
|
118
117
|
|
|
119
118
|
export interface AffectedElement {
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import type * as Protocol from '../../generated/protocol.js';
|
|
7
7
|
|
|
8
|
-
import {AttributionReportingIssue} from './AttributionReportingIssue.js';
|
|
9
8
|
import {ContentSecurityPolicyIssue} from './ContentSecurityPolicyIssue.js';
|
|
10
9
|
import {CookieDeprecationMetadataIssue} from './CookieDeprecationMetadataIssue.js';
|
|
11
10
|
import {CookieIssue} from './CookieIssue.js';
|
|
@@ -71,7 +70,6 @@ export class AggregatedIssue extends Issue {
|
|
|
71
70
|
#selectivePermissionsInterventionIssues = new Set<SelectivePermissionsInterventionIssue>();
|
|
72
71
|
#sharedArrayBufferIssues = new Set<SharedArrayBufferIssue>();
|
|
73
72
|
#quirksModeIssues = new Set<QuirksModeIssue>();
|
|
74
|
-
#attributionReportingIssues = new Set<AttributionReportingIssue>();
|
|
75
73
|
#genericIssues = new Set<GenericIssue>();
|
|
76
74
|
#elementAccessibilityIssues = new Set<ElementAccessibilityIssue>();
|
|
77
75
|
#representative?: Issue;
|
|
@@ -158,10 +156,6 @@ export class AggregatedIssue extends Issue {
|
|
|
158
156
|
return this.#quirksModeIssues;
|
|
159
157
|
}
|
|
160
158
|
|
|
161
|
-
getAttributionReportingIssues(): ReadonlySet<AttributionReportingIssue> {
|
|
162
|
-
return this.#attributionReportingIssues;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
159
|
getGenericIssues(): ReadonlySet<GenericIssue> {
|
|
166
160
|
return this.#genericIssues;
|
|
167
161
|
}
|
|
@@ -273,9 +267,6 @@ export class AggregatedIssue extends Issue {
|
|
|
273
267
|
if (issue instanceof QuirksModeIssue) {
|
|
274
268
|
this.#quirksModeIssues.add(issue);
|
|
275
269
|
}
|
|
276
|
-
if (issue instanceof AttributionReportingIssue) {
|
|
277
|
-
this.#attributionReportingIssues.add(issue);
|
|
278
|
-
}
|
|
279
270
|
if (issue instanceof GenericIssue) {
|
|
280
271
|
this.#genericIssues.add(issue);
|
|
281
272
|
}
|
|
@@ -6,7 +6,7 @@ import * as Common from '../../core/common/common.js';
|
|
|
6
6
|
import type * as Protocol from '../../generated/protocol.js';
|
|
7
7
|
|
|
8
8
|
import type {Issue} from './Issue.js';
|
|
9
|
-
import {Events as IssueManagerEvents, type IssueAddedEvent, IssuesManager} from './IssuesManager.js';
|
|
9
|
+
import {Events as IssueManagerEvents, type IssueAddedEvent, type IssuesManager} from './IssuesManager.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* A class that facilitates resolving an issueId to an issue. See `ResolverBase` for more info.
|
|
@@ -15,7 +15,7 @@ export class IssueResolver extends Common.ResolverBase.ResolverBase<Protocol.Aud
|
|
|
15
15
|
#issuesListener: Common.EventTarget.EventDescriptor|null = null;
|
|
16
16
|
#issuesManager: IssuesManager;
|
|
17
17
|
|
|
18
|
-
constructor(issuesManager: IssuesManager
|
|
18
|
+
constructor(issuesManager: IssuesManager) {
|
|
19
19
|
super();
|
|
20
20
|
this.#issuesManager = issuesManager;
|
|
21
21
|
}
|