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
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// Copyright 2022 The Chromium Authors
|
|
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 * as SDK from '../../core/sdk/sdk.js';
|
|
8
|
-
import type * as Protocol from '../../generated/protocol.js';
|
|
9
|
-
import {createIcon} from '../../ui/kit/kit.js';
|
|
10
|
-
import * as UI from '../../ui/legacy/legacy.js';
|
|
11
|
-
|
|
12
|
-
import {ApplicationPanelTreeElement} from './ApplicationPanelTreeElement.js';
|
|
13
|
-
import {InterestGroupStorageView} from './InterestGroupStorageView.js';
|
|
14
|
-
import type {ResourcesPanel} from './ResourcesPanel.js';
|
|
15
|
-
|
|
16
|
-
const UIStrings = {
|
|
17
|
-
/**
|
|
18
|
-
* @description Label for an item in the Application Panel Sidebar of the Application panel
|
|
19
|
-
* An interest group is an ad targeting group stored on the browser that can
|
|
20
|
-
* be used to show a certain set of advertisements in the future as the
|
|
21
|
-
* outcome of a FLEDGE auction. (https://developer.chrome.com/blog/fledge-api/)
|
|
22
|
-
*/
|
|
23
|
-
interestGroups: 'Interest groups',
|
|
24
|
-
} as const;
|
|
25
|
-
const str_ = i18n.i18n.registerUIStrings('panels/application/InterestGroupTreeElement.ts', UIStrings);
|
|
26
|
-
export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
27
|
-
|
|
28
|
-
export class InterestGroupTreeElement extends ApplicationPanelTreeElement {
|
|
29
|
-
private view: InterestGroupStorageView;
|
|
30
|
-
|
|
31
|
-
constructor(storagePanel: ResourcesPanel) {
|
|
32
|
-
super(storagePanel, i18nString(UIStrings.interestGroups), false, 'interest-groups');
|
|
33
|
-
const interestGroupIcon = createIcon('database');
|
|
34
|
-
this.setLeadingIcons([interestGroupIcon]);
|
|
35
|
-
this.view = new InterestGroupStorageView(this);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
override get itemURL(): Platform.DevToolsPath.UrlString {
|
|
39
|
-
return 'interest-groups://' as Platform.DevToolsPath.UrlString;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
async getInterestGroupDetails(owner: string, name: string): Promise<object|null> {
|
|
43
|
-
const mainTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
|
|
44
|
-
if (!mainTarget) {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
const response = await mainTarget.storageAgent().invoke_getInterestGroupDetails({ownerOrigin: owner, name});
|
|
48
|
-
return response.details;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
override onselect(selectedByUser?: boolean): boolean {
|
|
52
|
-
super.onselect(selectedByUser);
|
|
53
|
-
this.showView(this.view);
|
|
54
|
-
UI.UIUserMetrics.UIUserMetrics.instance().panelShown('interest-groups');
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
addEvent(event: Protocol.Storage.InterestGroupAccessedEvent): void {
|
|
59
|
-
this.view.addEvent(event);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
clearEvents(): void {
|
|
63
|
-
this.view.clearEvents();
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
// Copyright 2022 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
5
|
-
|
|
6
|
-
import '../../../ui/legacy/components/data_grid/data_grid.js';
|
|
7
|
-
|
|
8
|
-
import * as i18n from '../../../core/i18n/i18n.js';
|
|
9
|
-
import type * as Protocol from '../../../generated/protocol.js';
|
|
10
|
-
import * as UI from '../../../ui/legacy/legacy.js';
|
|
11
|
-
import * as Lit from '../../../ui/lit/lit.js';
|
|
12
|
-
|
|
13
|
-
import interestGroupAccessGridStyles from './interestGroupAccessGrid.css.js';
|
|
14
|
-
|
|
15
|
-
const {html} = Lit;
|
|
16
|
-
|
|
17
|
-
const UIStrings = {
|
|
18
|
-
/**
|
|
19
|
-
* @description Hover text for an info icon in the Interest Group Event panel
|
|
20
|
-
* An interest group is an ad targeting group stored on the browser that can
|
|
21
|
-
* be used to show a certain set of advertisements in the future as the
|
|
22
|
-
* outcome of a FLEDGE auction.
|
|
23
|
-
*/
|
|
24
|
-
allInterestGroupStorageEvents: 'All interest group storage events.',
|
|
25
|
-
/**
|
|
26
|
-
* @description Text in InterestGroupStorage Items View of the Application panel
|
|
27
|
-
* Date and time of an Interest Group storage event in a locale-
|
|
28
|
-
* dependent format.
|
|
29
|
-
*/
|
|
30
|
-
eventTime: 'Event Time',
|
|
31
|
-
/**
|
|
32
|
-
* @description Text in InterestGroupStorage Items View of the Application panel
|
|
33
|
-
* Type of interest group event such as 'join', 'bid', 'win', or 'leave'.
|
|
34
|
-
*/
|
|
35
|
-
eventType: 'Access Type',
|
|
36
|
-
/**
|
|
37
|
-
* @description Text in InterestGroupStorage Items View of the Application panel
|
|
38
|
-
* Owner of the interest group. The origin that controls the
|
|
39
|
-
* content of information associated with the interest group such as which
|
|
40
|
-
* ads get displayed.
|
|
41
|
-
*/
|
|
42
|
-
groupOwner: 'Owner',
|
|
43
|
-
/**
|
|
44
|
-
* @description Text in InterestGroupStorage Items View of the Application panel
|
|
45
|
-
* Name of the interest group. The name is unique per-owner and identifies the
|
|
46
|
-
* interest group.
|
|
47
|
-
*/
|
|
48
|
-
groupName: 'Name',
|
|
49
|
-
/**
|
|
50
|
-
* @description Text shown when no interest groups are detected.
|
|
51
|
-
* An interest group is an ad targeting group stored on the browser that can
|
|
52
|
-
* be used to show a certain set of advertisements in the future as the
|
|
53
|
-
* outcome of a FLEDGE auction.
|
|
54
|
-
*/
|
|
55
|
-
noEvents: 'No interest group events detected',
|
|
56
|
-
/**
|
|
57
|
-
* @description Text shown when no interest groups are detected and explains what this page is about.
|
|
58
|
-
* An interest group is an ad targeting group stored on the browser that can
|
|
59
|
-
* be used to show a certain set of advertisements in the future as the
|
|
60
|
-
* outcome of a FLEDGE auction.
|
|
61
|
-
*/
|
|
62
|
-
interestGroupDescription: 'On this page you can inspect and analyze interest groups',
|
|
63
|
-
} as const;
|
|
64
|
-
const str_ = i18n.i18n.registerUIStrings('panels/application/components/InterestGroupAccessGrid.ts', UIStrings);
|
|
65
|
-
export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
66
|
-
|
|
67
|
-
export class InterestGroupAccessGrid extends HTMLElement {
|
|
68
|
-
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
69
|
-
#datastores: Protocol.Storage.InterestGroupAccessedEvent[] = [];
|
|
70
|
-
|
|
71
|
-
connectedCallback(): void {
|
|
72
|
-
this.#render();
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// eslint-disable-next-line @devtools/set-data-type-reference
|
|
76
|
-
set data(data: Protocol.Storage.InterestGroupAccessedEvent[]) {
|
|
77
|
-
this.#datastores = data;
|
|
78
|
-
this.#render();
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
#render(): void {
|
|
82
|
-
// clang-format off
|
|
83
|
-
Lit.render(html`
|
|
84
|
-
<style>${interestGroupAccessGridStyles}</style>
|
|
85
|
-
<style>${UI.inspectorCommonStyles}</style>
|
|
86
|
-
${this.#datastores.length === 0 ?
|
|
87
|
-
html`
|
|
88
|
-
<div class="empty-state">
|
|
89
|
-
<span class="empty-state-header">${i18nString(UIStrings.noEvents)}</span>
|
|
90
|
-
<span class="empty-state-description">${i18nString(UIStrings.interestGroupDescription)}</span>
|
|
91
|
-
</div>`:
|
|
92
|
-
html`
|
|
93
|
-
<div>
|
|
94
|
-
<span class="heading">Interest Groups</span>
|
|
95
|
-
<devtools-icon class="info-icon medium" name="info"
|
|
96
|
-
title=${i18nString(UIStrings.allInterestGroupStorageEvents)}>
|
|
97
|
-
</devtools-icon>
|
|
98
|
-
${this.#renderGrid()}
|
|
99
|
-
</div>`}
|
|
100
|
-
`, this.#shadow, {host: this});
|
|
101
|
-
// clang-format on
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
#renderGrid(): Lit.TemplateResult {
|
|
105
|
-
// clang-format off
|
|
106
|
-
return html`
|
|
107
|
-
<devtools-data-grid striped inline>
|
|
108
|
-
<table>
|
|
109
|
-
<tr>
|
|
110
|
-
<th id="event-time" sortable weight="10">${i18nString(UIStrings.eventTime)}</td>
|
|
111
|
-
<th id="event-type" sortable weight="5">${i18nString(UIStrings.eventType)}</td>
|
|
112
|
-
<th id="event-group-owner" sortable weight="10">${i18nString(UIStrings.groupOwner)}</td>
|
|
113
|
-
<th id="event-group-name" sortable weight="10">${i18nString(UIStrings.groupName)}</td>
|
|
114
|
-
</tr>
|
|
115
|
-
${this.#datastores.map(event => html`
|
|
116
|
-
<tr @select=${() => this.dispatchEvent(new CustomEvent('select', {detail: event}))}>
|
|
117
|
-
<td>${new Date(1e3 * event.accessTime).toLocaleString()}</td>
|
|
118
|
-
<td>${event.type}</td>
|
|
119
|
-
<td>${event.ownerOrigin}</td>
|
|
120
|
-
<td>${event.name}</td>
|
|
121
|
-
</tr>
|
|
122
|
-
`)}
|
|
123
|
-
</table>
|
|
124
|
-
</devtools-data-grid>`;
|
|
125
|
-
// clang-format on
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
customElements.define('devtools-interest-group-access-grid', InterestGroupAccessGrid);
|
|
130
|
-
|
|
131
|
-
declare global {
|
|
132
|
-
interface HTMLElementTagNameMap {
|
|
133
|
-
'devtools-interest-group-access-grid': InterestGroupAccessGrid;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2021 The Chromium Authors
|
|
3
|
-
* Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
:host {
|
|
7
|
-
display: flex;
|
|
8
|
-
padding: 20px;
|
|
9
|
-
height: 100%;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.heading {
|
|
13
|
-
font-size: 15px;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
devtools-data-grid {
|
|
17
|
-
margin-top: 20px;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.info-icon {
|
|
21
|
-
vertical-align: text-bottom;
|
|
22
|
-
height: 14px;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.no-events-message {
|
|
26
|
-
margin-top: 20px;
|
|
27
|
-
}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
// Copyright 2021 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
|
-
|
|
6
|
-
import * as Host from '../../core/host/host.js';
|
|
7
|
-
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
|
-
import type * as Protocol from '../../generated/protocol.js';
|
|
9
|
-
import * as IssuesManager from '../../models/issues_manager/issues_manager.js';
|
|
10
|
-
|
|
11
|
-
import {AffectedItem, AffectedResourcesView} from './AffectedResourcesView.js';
|
|
12
|
-
|
|
13
|
-
const UIStrings = {
|
|
14
|
-
/**
|
|
15
|
-
* @description Label for number of rows in the issue details table.
|
|
16
|
-
*/
|
|
17
|
-
nViolations: '{n, plural, =1 {# violation} other {# violations}}',
|
|
18
|
-
/**
|
|
19
|
-
* @description Noun, label for the column showing the associated HTML element in the issue details table.
|
|
20
|
-
*/
|
|
21
|
-
element: 'Element',
|
|
22
|
-
/**
|
|
23
|
-
* @description Noun, label for the column showing the invalid header value in the issue details table.
|
|
24
|
-
*/
|
|
25
|
-
invalidHeaderValue: 'Invalid Header Value',
|
|
26
|
-
/**
|
|
27
|
-
* @description Noun, label for the column showing the associated network request in the issue details table.
|
|
28
|
-
*/
|
|
29
|
-
request: 'Request',
|
|
30
|
-
/**
|
|
31
|
-
* @description Label for the column showing the invalid URL used in an HTML anchor element ("a link").
|
|
32
|
-
* A origin is (roughly said) the front part of a URL.
|
|
33
|
-
*/
|
|
34
|
-
untrustworthyOrigin: 'Untrustworthy origin',
|
|
35
|
-
} as const;
|
|
36
|
-
const str_ = i18n.i18n.registerUIStrings('panels/issues/AttributionReportingIssueDetailsView.ts', UIStrings);
|
|
37
|
-
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
38
|
-
|
|
39
|
-
export class AttributionReportingIssueDetailsView extends AffectedResourcesView {
|
|
40
|
-
protected override getResourceNameWithCount(count: number): string {
|
|
41
|
-
return i18nString(UIStrings.nViolations, {n: count});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
override update(): void {
|
|
45
|
-
this.clear();
|
|
46
|
-
const issues = this.issue.getAttributionReportingIssues();
|
|
47
|
-
const issue = issues.values().next();
|
|
48
|
-
if (issue.done) {
|
|
49
|
-
this.updateAffectedResourceCount(0);
|
|
50
|
-
} else {
|
|
51
|
-
this.#appendDetails(issue.value.code(), issues);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
#appendDetails(
|
|
56
|
-
issueCode: IssuesManager.AttributionReportingIssue.IssueCode,
|
|
57
|
-
issues: Iterable<IssuesManager.AttributionReportingIssue.AttributionReportingIssue>): void {
|
|
58
|
-
const header = document.createElement('tr');
|
|
59
|
-
switch (issueCode) {
|
|
60
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_REGISTER_SOURCE_HEADER:
|
|
61
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_REGISTER_TRIGGER_HEADER:
|
|
62
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_REGISTER_OS_SOURCE_HEADER:
|
|
63
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_REGISTER_OS_TRIGGER_HEADER:
|
|
64
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.OS_SOURCE_IGNORED:
|
|
65
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.OS_TRIGGER_IGNORED:
|
|
66
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.SOURCE_IGNORED:
|
|
67
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.TRIGGER_IGNORED:
|
|
68
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_INFO_HEADER:
|
|
69
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.NAVIGATION_REGISTRATION_UNIQUE_SCOPE_ALREADY_SET:
|
|
70
|
-
this.appendColumnTitle(header, i18nString(UIStrings.request));
|
|
71
|
-
this.appendColumnTitle(header, i18nString(UIStrings.invalidHeaderValue));
|
|
72
|
-
break;
|
|
73
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.INSECURE_CONTEXT:
|
|
74
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.UNTRUSTWORTHY_REPORTING_ORIGIN:
|
|
75
|
-
this.appendColumnTitle(header, i18nString(UIStrings.element));
|
|
76
|
-
this.appendColumnTitle(header, i18nString(UIStrings.request));
|
|
77
|
-
this.appendColumnTitle(header, i18nString(UIStrings.untrustworthyOrigin));
|
|
78
|
-
break;
|
|
79
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.PERMISSION_POLICY_DISABLED:
|
|
80
|
-
this.appendColumnTitle(header, i18nString(UIStrings.element));
|
|
81
|
-
this.appendColumnTitle(header, i18nString(UIStrings.request));
|
|
82
|
-
break;
|
|
83
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.SOURCE_AND_TRIGGER_HEADERS:
|
|
84
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.WEB_AND_OS_HEADERS:
|
|
85
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.NO_WEB_OR_OS_SUPPORT:
|
|
86
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.NO_REGISTER_SOURCE_HEADER:
|
|
87
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.NO_REGISTER_TRIGGER_HEADER:
|
|
88
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.NO_REGISTER_OS_SOURCE_HEADER:
|
|
89
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.NO_REGISTER_OS_TRIGGER_HEADER:
|
|
90
|
-
this.appendColumnTitle(header, i18nString(UIStrings.request));
|
|
91
|
-
break;
|
|
92
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.NAVIGATION_REGISTRATION_WITHOUT_TRANSIENT_USER_ACTIVATION:
|
|
93
|
-
this.appendColumnTitle(header, i18nString(UIStrings.element));
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
this.affectedResources.appendChild(header);
|
|
98
|
-
let count = 0;
|
|
99
|
-
for (const issue of issues) {
|
|
100
|
-
count++;
|
|
101
|
-
void this.#appendDetail(issueCode, issue);
|
|
102
|
-
}
|
|
103
|
-
this.updateAffectedResourceCount(count);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
async #appendDetail(
|
|
107
|
-
issueCode: IssuesManager.AttributionReportingIssue.IssueCode,
|
|
108
|
-
issue: IssuesManager.AttributionReportingIssue.AttributionReportingIssue): Promise<void> {
|
|
109
|
-
const element = document.createElement('tr');
|
|
110
|
-
element.classList.add('affected-resource-directive');
|
|
111
|
-
|
|
112
|
-
const details = issue.details();
|
|
113
|
-
|
|
114
|
-
switch (issueCode) {
|
|
115
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_REGISTER_SOURCE_HEADER:
|
|
116
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_REGISTER_TRIGGER_HEADER:
|
|
117
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_REGISTER_OS_SOURCE_HEADER:
|
|
118
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_REGISTER_OS_TRIGGER_HEADER:
|
|
119
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.OS_SOURCE_IGNORED:
|
|
120
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.OS_TRIGGER_IGNORED:
|
|
121
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.SOURCE_IGNORED:
|
|
122
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.TRIGGER_IGNORED:
|
|
123
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.INVALID_INFO_HEADER:
|
|
124
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.NAVIGATION_REGISTRATION_UNIQUE_SCOPE_ALREADY_SET:
|
|
125
|
-
this.#appendRequestOrEmptyCell(element, details.request);
|
|
126
|
-
this.appendIssueDetailCell(element, details.invalidParameter || '');
|
|
127
|
-
break;
|
|
128
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.INSECURE_CONTEXT:
|
|
129
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.UNTRUSTWORTHY_REPORTING_ORIGIN:
|
|
130
|
-
await this.#appendElementOrEmptyCell(element, issue);
|
|
131
|
-
this.#appendRequestOrEmptyCell(element, details.request);
|
|
132
|
-
this.appendIssueDetailCell(element, details.invalidParameter || '');
|
|
133
|
-
break;
|
|
134
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.PERMISSION_POLICY_DISABLED:
|
|
135
|
-
await this.#appendElementOrEmptyCell(element, issue);
|
|
136
|
-
this.#appendRequestOrEmptyCell(element, details.request);
|
|
137
|
-
break;
|
|
138
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.SOURCE_AND_TRIGGER_HEADERS:
|
|
139
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.WEB_AND_OS_HEADERS:
|
|
140
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.NO_WEB_OR_OS_SUPPORT:
|
|
141
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.NO_REGISTER_SOURCE_HEADER:
|
|
142
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.NO_REGISTER_TRIGGER_HEADER:
|
|
143
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.NO_REGISTER_OS_SOURCE_HEADER:
|
|
144
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.NO_REGISTER_OS_TRIGGER_HEADER:
|
|
145
|
-
this.#appendRequestOrEmptyCell(element, details.request);
|
|
146
|
-
break;
|
|
147
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.NAVIGATION_REGISTRATION_WITHOUT_TRANSIENT_USER_ACTIVATION:
|
|
148
|
-
await this.#appendElementOrEmptyCell(element, issue);
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
this.affectedResources.appendChild(element);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
async #appendElementOrEmptyCell(
|
|
156
|
-
parent: HTMLElement, issue: IssuesManager.AttributionReportingIssue.AttributionReportingIssue): Promise<void> {
|
|
157
|
-
const details = issue.details();
|
|
158
|
-
if (details.violatingNodeId !== undefined) {
|
|
159
|
-
const target = issue.model()?.target() || null;
|
|
160
|
-
parent.appendChild(await this.createElementCell(
|
|
161
|
-
{backendNodeId: details.violatingNodeId, target, nodeName: 'Attribution source element'},
|
|
162
|
-
issue.getCategory()));
|
|
163
|
-
} else {
|
|
164
|
-
this.appendIssueDetailCell(parent, '');
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
#appendRequestOrEmptyCell(parent: HTMLElement, request?: Protocol.Audits.AffectedRequest): void {
|
|
169
|
-
if (!request) {
|
|
170
|
-
this.appendIssueDetailCell(parent, '');
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
const opts = {
|
|
175
|
-
additionalOnClickAction(): void {
|
|
176
|
-
Host.userMetrics.issuesPanelResourceOpened(
|
|
177
|
-
IssuesManager.Issue.IssueCategory.ATTRIBUTION_REPORTING, AffectedItem.REQUEST);
|
|
178
|
-
},
|
|
179
|
-
};
|
|
180
|
-
parent.appendChild(this.createRequestCell(request, opts));
|
|
181
|
-
}
|
|
182
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Copyright 2023 The Chromium Authors
|
|
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 ControlButton from './ControlButton.js';
|
|
6
|
-
import * as CreateRecordingView from './CreateRecordingView.js';
|
|
7
|
-
import * as RecordingListView from './RecordingListView.js';
|
|
8
|
-
import * as RecordingView from './RecordingView.js';
|
|
9
|
-
import * as ReplaySection from './ReplaySection.js';
|
|
10
|
-
import * as SelectorPicker from './SelectorPicker.js';
|
|
11
|
-
import * as StepEditor from './StepEditor.js';
|
|
12
|
-
import * as StepView from './StepView.js';
|
|
13
|
-
import * as TimelineSection from './TimelineSection.js';
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
ControlButton,
|
|
17
|
-
CreateRecordingView,
|
|
18
|
-
RecordingListView,
|
|
19
|
-
RecordingView,
|
|
20
|
-
ReplaySection,
|
|
21
|
-
SelectorPicker,
|
|
22
|
-
StepEditor,
|
|
23
|
-
StepView,
|
|
24
|
-
TimelineSection,
|
|
25
|
-
};
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
// Copyright 2023 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
export const mod = (a: number, n: number): number => {
|
|
6
|
-
return ((a % n) + n) % n;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export function assert<T>(
|
|
10
|
-
predicate: T,
|
|
11
|
-
message = 'Assertion failed!',
|
|
12
|
-
): asserts predicate {
|
|
13
|
-
if (!predicate) {
|
|
14
|
-
throw new Error(message);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export type Keys<T> = T extends T ? keyof T : never;
|
|
19
|
-
|
|
20
|
-
export type RequiredKeys<T> = {
|
|
21
|
-
[K in keyof T] -?: Record<string|number|symbol, unknown> extends Pick<T, K>? never : K;
|
|
22
|
-
}[keyof T];
|
|
23
|
-
|
|
24
|
-
export type OptionalKeys<T> = {
|
|
25
|
-
[K in keyof T] -?: Record<string|number|symbol, unknown> extends Pick<T, K>? K : never;
|
|
26
|
-
}[keyof T];
|
|
27
|
-
|
|
28
|
-
export type DeepImmutable<T> = {
|
|
29
|
-
readonly[K in keyof T]: DeepImmutable<T[K]>;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export type DeepMutable<T> = {
|
|
33
|
-
-readonly[K in keyof T]: DeepMutable<T[K]>;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export type DeepPartial<T> = {
|
|
37
|
-
[K in keyof T]?: DeepPartial<Exclude<T[K], undefined>>;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export type Mutable<T> = {
|
|
41
|
-
-readonly[K in keyof T]: T[K];
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const deepFreeze = <T extends object>(object: T): DeepImmutable<T> => {
|
|
45
|
-
for (const name of Reflect.ownKeys(object)) {
|
|
46
|
-
const value = object[name as keyof T];
|
|
47
|
-
if ((value && typeof value === 'object') || typeof value === 'function') {
|
|
48
|
-
deepFreeze(value);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return Object.freeze(object);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export class InsertAssignment<T> {
|
|
55
|
-
value: T;
|
|
56
|
-
constructor(value: T) {
|
|
57
|
-
this.value = value;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export class ArrayAssignments<T> {
|
|
62
|
-
value: Record<number, T>;
|
|
63
|
-
constructor(value: Record<number, T>) {
|
|
64
|
-
this.value = value;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export type Assignments<T> = T extends Readonly<Array<infer R>>?
|
|
69
|
-
R[]|ArrayAssignments<Assignments<R>|InsertAssignment<R>>:
|
|
70
|
-
{[K in keyof T]: Assignments<T[K]>};
|
|
71
|
-
|
|
72
|
-
export const immutableDeepAssign = <T>(
|
|
73
|
-
object: DeepImmutable<T>,
|
|
74
|
-
assignments: DeepImmutable<DeepPartial<Assignments<T>>>,
|
|
75
|
-
): DeepImmutable<T> => {
|
|
76
|
-
if (assignments instanceof ArrayAssignments) {
|
|
77
|
-
assert(Array.isArray(object), `Expected an array. Got ${typeof object}.`);
|
|
78
|
-
const updatedObject = [...object] as Mutable<typeof object>;
|
|
79
|
-
const keys = Object.keys(assignments.value)
|
|
80
|
-
.sort(
|
|
81
|
-
(a, b) => Number(b) - Number(a),
|
|
82
|
-
) as Array<keyof typeof updatedObject>;
|
|
83
|
-
for (const key of keys) {
|
|
84
|
-
const update = assignments.value[Number(key)];
|
|
85
|
-
if (update === undefined) {
|
|
86
|
-
updatedObject.splice(Number(key), 1);
|
|
87
|
-
} else if (update instanceof InsertAssignment) {
|
|
88
|
-
updatedObject.splice(Number(key), 0, update.value);
|
|
89
|
-
} else {
|
|
90
|
-
updatedObject[Number(key)] = immutableDeepAssign(
|
|
91
|
-
updatedObject[key],
|
|
92
|
-
update,
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return Object.freeze(updatedObject);
|
|
97
|
-
}
|
|
98
|
-
if (typeof assignments === 'object' && !Array.isArray(assignments)) {
|
|
99
|
-
assert(!Array.isArray(object), 'Expected an object. Got an array.');
|
|
100
|
-
const updatedObject = {...object} as Mutable<typeof object>;
|
|
101
|
-
const keys = Object.keys(assignments) as Array<keyof typeof assignments&keyof typeof updatedObject>;
|
|
102
|
-
for (const key of keys) {
|
|
103
|
-
const update = assignments[key];
|
|
104
|
-
if (update === undefined) {
|
|
105
|
-
delete updatedObject[key];
|
|
106
|
-
} else {
|
|
107
|
-
updatedObject[key] = immutableDeepAssign(
|
|
108
|
-
updatedObject[key],
|
|
109
|
-
update as typeof updatedObject[typeof key],
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return Object.freeze(updatedObject);
|
|
114
|
-
}
|
|
115
|
-
return assignments as DeepImmutable<T>;
|
|
116
|
-
};
|