chrome-devtools-frontend 1.0.1698733 → 1.0.1700561
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/devtools-verification/SKILL.md +19 -0
- package/.agents/skills/{repro-flaky-tests → fix-tests}/SKILL.md +2 -2
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +2 -2
- package/front_end/core/sdk/DOMModel.ts +3 -5
- package/front_end/core/sdk/NetworkManager.ts +2 -2
- package/front_end/core/sdk/OverlayModel.ts +11 -12
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +3 -0
- package/front_end/core/sdk/SourceMapScopeChainEntry.ts +84 -32
- package/front_end/core/sdk/StorageBucketsModel.ts +2 -0
- package/front_end/entrypoints/main/GlobalAiButton.ts +2 -6
- package/front_end/entrypoints/main/MainImpl.ts +8 -1
- package/front_end/generated/InspectorBackendCommands.ts +12 -2
- package/front_end/generated/SupportedCSSProperties.ts +14 -0
- package/front_end/generated/protocol-mapping.d.ts +48 -1
- package/front_end/generated/protocol-proxy-api.d.ts +37 -1
- package/front_end/generated/protocol.ts +131 -0
- package/front_end/models/bindings/NetworkProject.ts +30 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +62 -0
- package/front_end/models/change_tracker/ChangeTracker.ts +1 -1
- package/front_end/models/comment_manager/CD4ABridge.ts +2 -2
- package/front_end/models/comment_manager/CommentManager.ts +18 -0
- package/front_end/models/emulation/DeviceModeModel.ts +1 -1
- package/front_end/models/extensions/ExtensionAPI.ts +4 -2
- package/front_end/models/issues_manager/CookieIssue.ts +0 -15
- package/front_end/models/persistence/NetworkPersistenceManager.ts +29 -4
- package/front_end/models/source_map_scopes/NamesResolver.ts +34 -4
- package/front_end/models/source_map_scopes/ScopeChainModel.ts +31 -7
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +281 -3
- package/front_end/panels/accessibility/accessibilityAnnouncementRecordingView.css +85 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -2
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +5 -8
- package/front_end/panels/animation/AnimationTimeline.ts +1 -1
- package/front_end/panels/application/AppManifestView.ts +128 -134
- package/front_end/panels/application/CrashReportContextView.ts +6 -6
- package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +17 -17
- package/front_end/panels/application/DeviceBoundSessionsView.ts +136 -137
- package/front_end/panels/application/IndexedDBModel.ts +3 -0
- package/front_end/panels/application/IndexedDBViews.ts +1 -1
- package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -0
- package/front_end/panels/application/OriginTrialTreeView.ts +18 -23
- package/front_end/panels/application/ReportingApiTreeElement.ts +3 -3
- package/front_end/panels/application/ReportingApiView.ts +6 -14
- package/front_end/panels/application/application-meta.ts +7 -7
- package/front_end/panels/application/components/AdsView.ts +63 -1
- package/front_end/panels/application/components/adsView.css +11 -1
- package/front_end/panels/common/CommentThreadWidget.ts +20 -22
- package/front_end/panels/common/CommentsOverlayWidget.ts +115 -9
- package/front_end/panels/common/CommentsStatusBarPill.ts +13 -1
- package/front_end/panels/common/ExtensionServer.ts +43 -34
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +1 -1
- package/front_end/panels/common/commentThreadWidget.css +6 -0
- package/front_end/panels/common/common-meta.ts +4 -1
- package/front_end/panels/elements/CSSRuleValidator.ts +1 -1
- package/front_end/panels/elements/ElementsPanel.ts +4 -4
- package/front_end/panels/elements/ElementsTreeElement.ts +9 -2
- package/front_end/panels/elements/ElementsTreeOutline.ts +25 -33
- package/front_end/panels/elements/elementsTreeOutline.css +8 -4
- package/front_end/panels/event_listeners/EventListenersView.ts +9 -4
- package/front_end/panels/issues/IssuesPane.ts +34 -22
- package/front_end/panels/lighthouse/LighthouseController.ts +1 -1
- package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +1 -1
- package/front_end/panels/network/RequestPayloadView.ts +17 -15
- package/front_end/panels/recorder/RecordingView.ts +32 -53
- package/front_end/panels/recorder/StepView.ts +19 -4
- package/front_end/panels/recorder/TimelineSection.ts +1 -1
- package/front_end/panels/recorder/controlButton.css +6 -0
- package/front_end/panels/recorder/recordingView.css +11 -2
- package/front_end/panels/settings/BackendLinkingSettingsTab.ts +2 -1
- package/front_end/panels/settings/EditFileSystemView.ts +1 -1
- package/front_end/panels/sources/CallStackSidebarPane.ts +1 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +137 -56
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +17 -15
- package/front_end/panels/timeline/components/DetailsView.ts +3 -3
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +0 -2
- package/front_end/panels/timeline/components/LiveMetricsView.ts +59 -64
- package/front_end/panels/timeline/components/OriginMap.ts +1 -1
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -3
- package/front_end/panels/timeline/components/liveMetricsView.css +1 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/lighthouse/README.chromium +2 -2
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1580 -1524
- package/front_end/third_party/lighthouse/locales/ar-XB.json +111 -72
- package/front_end/third_party/lighthouse/locales/ar.json +113 -74
- package/front_end/third_party/lighthouse/locales/bg.json +112 -73
- package/front_end/third_party/lighthouse/locales/ca.json +112 -73
- package/front_end/third_party/lighthouse/locales/cs.json +112 -73
- package/front_end/third_party/lighthouse/locales/da.json +112 -73
- package/front_end/third_party/lighthouse/locales/de.json +112 -73
- package/front_end/third_party/lighthouse/locales/el.json +112 -73
- package/front_end/third_party/lighthouse/locales/en-GB.json +111 -72
- package/front_end/third_party/lighthouse/locales/en-US.json +102 -66
- package/front_end/third_party/lighthouse/locales/en-XA.json +111 -72
- package/front_end/third_party/lighthouse/locales/en-XL.json +102 -66
- package/front_end/third_party/lighthouse/locales/es-419.json +112 -73
- package/front_end/third_party/lighthouse/locales/es.json +112 -73
- package/front_end/third_party/lighthouse/locales/fi.json +112 -73
- package/front_end/third_party/lighthouse/locales/fil.json +112 -73
- package/front_end/third_party/lighthouse/locales/fr.json +112 -73
- package/front_end/third_party/lighthouse/locales/he.json +112 -73
- package/front_end/third_party/lighthouse/locales/hi.json +112 -73
- package/front_end/third_party/lighthouse/locales/hr.json +112 -73
- package/front_end/third_party/lighthouse/locales/hu.json +112 -73
- package/front_end/third_party/lighthouse/locales/id.json +112 -73
- package/front_end/third_party/lighthouse/locales/it.json +113 -74
- package/front_end/third_party/lighthouse/locales/ja.json +112 -73
- package/front_end/third_party/lighthouse/locales/ko.json +112 -73
- package/front_end/third_party/lighthouse/locales/lt.json +112 -73
- package/front_end/third_party/lighthouse/locales/lv.json +112 -73
- package/front_end/third_party/lighthouse/locales/nl.json +112 -73
- package/front_end/third_party/lighthouse/locales/no.json +112 -73
- package/front_end/third_party/lighthouse/locales/pl.json +112 -73
- package/front_end/third_party/lighthouse/locales/pt-PT.json +112 -73
- package/front_end/third_party/lighthouse/locales/pt.json +112 -73
- package/front_end/third_party/lighthouse/locales/ro.json +112 -73
- package/front_end/third_party/lighthouse/locales/ru.json +112 -73
- package/front_end/third_party/lighthouse/locales/sk.json +112 -73
- package/front_end/third_party/lighthouse/locales/sl.json +112 -73
- package/front_end/third_party/lighthouse/locales/sr-Latn.json +112 -73
- package/front_end/third_party/lighthouse/locales/sr.json +112 -73
- package/front_end/third_party/lighthouse/locales/sv.json +124 -85
- package/front_end/third_party/lighthouse/locales/ta.json +112 -73
- package/front_end/third_party/lighthouse/locales/te.json +112 -73
- package/front_end/third_party/lighthouse/locales/th.json +112 -73
- package/front_end/third_party/lighthouse/locales/tr.json +113 -74
- package/front_end/third_party/lighthouse/locales/uk.json +112 -73
- package/front_end/third_party/lighthouse/locales/vi.json +112 -73
- package/front_end/third_party/lighthouse/locales/zh-HK.json +112 -73
- package/front_end/third_party/lighthouse/locales/zh-TW.json +113 -74
- package/front_end/third_party/lighthouse/locales/zh.json +113 -74
- package/front_end/third_party/lighthouse/report/bundle.d.ts +4 -4
- package/front_end/third_party/lighthouse/report/bundle.js +10 -3
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +2 -2
- package/front_end/third_party/lit/lit.ts +3 -0
- package/front_end/third_party/lit/package.json +3 -0
- package/front_end/third_party/lit/rebuild.sh +3 -2
- package/front_end/ui/comments/CommentAnchorResolver.ts +8 -2
- package/front_end/ui/comments/CommentOverlayManager.ts +2 -1
- package/front_end/ui/components/buttons/Button.ts +19 -1
- package/front_end/ui/legacy/ContextMenu.ts +16 -1
- package/front_end/ui/legacy/InspectorView.ts +4 -3
- package/front_end/ui/legacy/PlusButton.ts +5 -6
- package/front_end/ui/legacy/TabbedPane.ts +121 -80
- package/front_end/ui/legacy/Treeoutline.ts +37 -6
- package/front_end/ui/legacy/UIUtils.ts +7 -0
- package/front_end/ui/legacy/Widget.ts +33 -0
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +3 -0
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +14 -4
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +157 -171
- package/front_end/ui/lit/lit.ts +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +7 -0
- package/inspector_overlay/highlight_anchor.ts +197 -0
- package/inspector_overlay/tool_highlight.ts +8 -0
- package/package.json +1 -1
- package/.agents/skills/devtools-ci/SKILL.md +0 -65
- package/.agents/skills/evaluate-ai-css-completion/SKILL.md +0 -143
- package/.agents/skills/evaluate-ai-css-completion/scripts/evaluate.js +0 -104
- package/.agents/skills/fixing-skipped-tests/SKILL.md +0 -32
- package/.agents/skills/gerrit-cli/SKILL.md +0 -74
- package/.agents/skills/gerrit-cli/references/commands.md +0 -169
- package/.agents/skills/gerrit-cli/references/workflows.md +0 -63
- package/.agents/skills/gerrit-cli/scripts/import_upstream.py +0 -85
- package/front_end/models/issues_manager/descriptions/cookieExcludeBlockedWithinRelatedWebsiteSet.md +0 -4
|
@@ -428,6 +428,9 @@ export class IndexedDBModel extends SDK.SDKModel.SDKModel<EventTypes> implements
|
|
|
428
428
|
|
|
429
429
|
storageBucketDeleted(_event: Protocol.Storage.StorageBucketDeletedEvent): void {
|
|
430
430
|
}
|
|
431
|
+
|
|
432
|
+
privateVerificationTokensUpdated(): void {
|
|
433
|
+
}
|
|
431
434
|
}
|
|
432
435
|
|
|
433
436
|
SDK.SDKModel.SDKModel.register(IndexedDBModel, {capabilities: SDK.Target.Capability.STORAGE, autostart: false});
|
|
@@ -289,7 +289,7 @@ const populateContextMenu = (e: CustomEvent<UI.ContextMenu.ContextMenu>): void =
|
|
|
289
289
|
const renderDataGrid = (input: IndexedDBDataViewInput): LitTemplate => {
|
|
290
290
|
const keyPath = input.isIndex && input.index ? input.index.keyPath : input.objectStore.keyPath;
|
|
291
291
|
// clang-format off
|
|
292
|
-
return html`<devtools-data-grid row-height="auto" striped style="flex: auto;" name=${i18nString(UIStrings.indexedDb)} .template=${html`
|
|
292
|
+
return html`<devtools-data-grid row-height="auto" striped deletable style="flex: auto;" name=${i18nString(UIStrings.indexedDb)} .template=${html`
|
|
293
293
|
<style>${indexedDBViewsStyles}</style>
|
|
294
294
|
<table>
|
|
295
295
|
<tr>
|
|
@@ -153,6 +153,7 @@ export abstract class KeyValueStorageItemsView extends UI.Widget.VBox {
|
|
|
153
153
|
<devtools-data-grid
|
|
154
154
|
.name=${`${id}-datagrid-with-preview`}
|
|
155
155
|
striped
|
|
156
|
+
deletable
|
|
156
157
|
style="flex: auto"
|
|
157
158
|
@sort=${(e: CustomEvent<{columnId: string, ascending: boolean}>) => input.onSort(e.detail.ascending)}
|
|
158
159
|
@refresh=${input.onRefresh}
|
|
@@ -20,53 +20,48 @@ const {widget} = UI.Widget;
|
|
|
20
20
|
|
|
21
21
|
const UIStrings = {
|
|
22
22
|
/**
|
|
23
|
-
* @description Label for the
|
|
23
|
+
* @description Label for the origin field in an origin trial token.
|
|
24
24
|
*/
|
|
25
25
|
origin: 'Origin',
|
|
26
26
|
/**
|
|
27
|
-
* @description Label for
|
|
28
|
-
* This field is only shown when token has unknown trial name as the token
|
|
29
|
-
* will be put into 'UNKNOWN' group.
|
|
27
|
+
* @description Label for the trial name field in an origin trial token.
|
|
30
28
|
*/
|
|
31
|
-
trialName: 'Trial
|
|
29
|
+
trialName: 'Trial name',
|
|
32
30
|
/**
|
|
33
|
-
* @description Label for
|
|
31
|
+
* @description Label for the expiry time field in an origin trial token.
|
|
34
32
|
*/
|
|
35
|
-
expiryTime: 'Expiry
|
|
33
|
+
expiryTime: 'Expiry time',
|
|
36
34
|
/**
|
|
37
|
-
* @description Label for
|
|
35
|
+
* @description Label for the usage restriction field in an origin trial token.
|
|
38
36
|
*/
|
|
39
|
-
usageRestriction: 'Usage
|
|
37
|
+
usageRestriction: 'Usage restriction',
|
|
40
38
|
/**
|
|
41
|
-
* @description Label for
|
|
39
|
+
* @description Label for the third party field in an origin trial token.
|
|
42
40
|
*/
|
|
43
|
-
isThirdParty: 'Third
|
|
41
|
+
isThirdParty: 'Third party',
|
|
44
42
|
/**
|
|
45
|
-
* @description Label for
|
|
46
|
-
*An Origin Trial Token contains an origin URL. The `matchSubDomains` field describes whether the token
|
|
47
|
-
*only applies to the origin URL or to all subdomains of the origin URL as well.
|
|
48
|
-
*The field contains either 'true' or 'false'.
|
|
43
|
+
* @description Label for the subdomain matching field in an origin trial token.
|
|
49
44
|
*/
|
|
50
|
-
matchSubDomains: 'Subdomain
|
|
45
|
+
matchSubDomains: 'Subdomain matching',
|
|
51
46
|
/**
|
|
52
|
-
* @description Label for the raw
|
|
47
|
+
* @description Label for the raw token text in an origin trial token.
|
|
53
48
|
*/
|
|
54
|
-
rawTokenText: 'Raw
|
|
49
|
+
rawTokenText: 'Raw token',
|
|
55
50
|
/**
|
|
56
|
-
* @description Label for
|
|
51
|
+
* @description Label for the token status field in an origin trial token.
|
|
57
52
|
*/
|
|
58
|
-
status: 'Token
|
|
53
|
+
status: 'Token status',
|
|
59
54
|
/**
|
|
60
|
-
* @description Label for
|
|
55
|
+
* @description Label for a token node in the origin trials tree view.
|
|
61
56
|
*/
|
|
62
57
|
token: 'Token',
|
|
63
58
|
/**
|
|
64
|
-
* @description Label for a badge showing the number of
|
|
59
|
+
* @description Label for a badge showing the number of origin trial tokens.
|
|
65
60
|
* @example {2} PH1
|
|
66
61
|
*/
|
|
67
62
|
tokens: '{PH1} tokens',
|
|
68
63
|
/**
|
|
69
|
-
* @description Label shown when there are no
|
|
64
|
+
* @description Label shown when there are no origin trial tokens in the frame details view of the Application panel.
|
|
70
65
|
*/
|
|
71
66
|
noTrialTokens: 'No trial tokens',
|
|
72
67
|
} as const;
|
|
@@ -14,13 +14,13 @@ import type {ResourcesPanel} from './ResourcesPanel.js';
|
|
|
14
14
|
|
|
15
15
|
const UIStrings = {
|
|
16
16
|
/**
|
|
17
|
-
* @description Label for an item in the
|
|
17
|
+
* @description Label for an item in the sidebar of the Application panel.
|
|
18
18
|
*/
|
|
19
19
|
reportingApi: 'Reporting API',
|
|
20
20
|
/**
|
|
21
|
-
* @description Label for the
|
|
21
|
+
* @description Label for the crash report context item in the sidebar of the Application panel.
|
|
22
22
|
*/
|
|
23
|
-
crashReportContext: 'Crash
|
|
23
|
+
crashReportContext: 'Crash report context',
|
|
24
24
|
} as const;
|
|
25
25
|
const str_ = i18n.i18n.registerUIStrings('panels/application/ReportingApiTreeElement.ts', UIStrings);
|
|
26
26
|
export const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -17,29 +17,21 @@ const {widget} = UI.Widget;
|
|
|
17
17
|
|
|
18
18
|
const UIStrings = {
|
|
19
19
|
/**
|
|
20
|
-
* @description
|
|
21
|
-
* A report contains information on issues or events that were encountered by a web browser.
|
|
22
|
-
* An endpoint is a URL where the report is sent to.
|
|
23
|
-
* (https://developer.chrome.com/docs/capabilities/web-apis/reporting-api)
|
|
20
|
+
* @description Header text in an empty state view when no report or endpoint has been detected in the reporting API view of the Application panel.
|
|
24
21
|
*/
|
|
25
22
|
noReportOrEndpoint: 'No report or endpoint',
|
|
26
23
|
/**
|
|
27
|
-
* @description
|
|
28
|
-
* A report contains information on issues or events that were encountered by a web browser.
|
|
29
|
-
* An endpoint is a URL where the report is sent to.
|
|
30
|
-
* (https://developer.chrome.com/docs/capabilities/web-apis/reporting-api)
|
|
24
|
+
* @description Explanatory text in an empty state view describing the reporting API view of the Application panel.
|
|
31
25
|
*/
|
|
32
|
-
reportingApiDescription: '
|
|
26
|
+
reportingApiDescription: 'Inspect `Reporting API` reports and endpoints',
|
|
33
27
|
/**
|
|
34
|
-
* @description
|
|
35
|
-
*report body (https://developers.google.com/web/updates/2018/09/reportingapi#sending).
|
|
28
|
+
* @description Header text in an empty state view when no report is selected in the reporting API view of the Application panel.
|
|
36
29
|
*/
|
|
37
30
|
noReportSelected: 'No report selected',
|
|
38
31
|
/**
|
|
39
|
-
* @description
|
|
40
|
-
*report body (https://developers.google.com/web/updates/2018/09/reportingapi#sending).
|
|
32
|
+
* @description Explanatory text instructing the user how to display a report body in the reporting API view of the Application panel.
|
|
41
33
|
*/
|
|
42
|
-
clickToDisplayBody: 'Click
|
|
34
|
+
clickToDisplayBody: 'Click any report to display its body',
|
|
43
35
|
} as const;
|
|
44
36
|
const str_ = i18n.i18n.registerUIStrings('panels/application/ReportingApiView.ts', UIStrings);
|
|
45
37
|
export const i18nString: i18n.LocalizeString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -12,31 +12,31 @@ import * as PreloadingHelper from './preloading/helper/helper.js';
|
|
|
12
12
|
|
|
13
13
|
const UIStrings = {
|
|
14
14
|
/**
|
|
15
|
-
* @description
|
|
15
|
+
* @description Title of the Application panel.
|
|
16
16
|
*/
|
|
17
17
|
application: 'Application',
|
|
18
18
|
/**
|
|
19
|
-
* @description Command for showing the
|
|
19
|
+
* @description Command in the command menu for showing the Application panel.
|
|
20
20
|
*/
|
|
21
21
|
showApplication: 'Show Application',
|
|
22
22
|
/**
|
|
23
|
-
* @description
|
|
23
|
+
* @description Search tag for the Application panel in the command menu.
|
|
24
24
|
*/
|
|
25
25
|
pwa: 'pwa',
|
|
26
26
|
/**
|
|
27
|
-
* @description
|
|
27
|
+
* @description Title of an action in the Application panel to clear site data.
|
|
28
28
|
*/
|
|
29
29
|
clearSiteData: 'Clear site data',
|
|
30
30
|
/**
|
|
31
|
-
* @description Title of an action
|
|
31
|
+
* @description Title of an action in the Application panel to clear all site data including third-party cookies.
|
|
32
32
|
*/
|
|
33
33
|
clearSiteDataIncludingThirdparty: 'Clear site data (including third-party cookies)',
|
|
34
34
|
/**
|
|
35
|
-
* @description Title of an action under the
|
|
35
|
+
* @description Title of an action under the background services category that can be invoked through the command menu.
|
|
36
36
|
*/
|
|
37
37
|
startRecordingEvents: 'Start recording events',
|
|
38
38
|
/**
|
|
39
|
-
* @description Title of an action under the
|
|
39
|
+
* @description Title of an action under the background services category that can be invoked through the command menu.
|
|
40
40
|
*/
|
|
41
41
|
stopRecordingEvents: 'Stop recording events',
|
|
42
42
|
} as const;
|
|
@@ -23,6 +23,12 @@ const {html} = Lit;
|
|
|
23
23
|
const {repeat} = Lit.Directives;
|
|
24
24
|
const {bindToSetting} = UI.UIUtils;
|
|
25
25
|
|
|
26
|
+
const DENSITY_DOC_URL = 'https://developer.chrome.com/docs/ads/metrics/density';
|
|
27
|
+
const COUNT_DOC_URL = 'https://developer.chrome.com/docs/ads/metrics/count';
|
|
28
|
+
const CPU_USAGE_DOC_URL = 'https://developer.chrome.com/docs/ads/metrics/weight-cpu';
|
|
29
|
+
const NETWORK_USAGE_DOC_URL = 'https://developer.chrome.com/docs/ads/metrics/weight-network';
|
|
30
|
+
const AD_DETECTION_DOC_URL = 'https://developer.chrome.com/docs/ads/detection';
|
|
31
|
+
|
|
26
32
|
const UIStrings = {
|
|
27
33
|
/**
|
|
28
34
|
* @description Title for the metrics table.
|
|
@@ -32,18 +38,34 @@ const UIStrings = {
|
|
|
32
38
|
* @description Title for a metric showing the percentage of the viewport covered by ads.
|
|
33
39
|
*/
|
|
34
40
|
viewportAdDensity: 'Viewport ad density',
|
|
41
|
+
/**
|
|
42
|
+
* @description Tooltip text explaining the viewport ad density metric in the ads view of the Application panel.
|
|
43
|
+
*/
|
|
44
|
+
viewportAdDensityExplanation: 'Percentage of the viewport covered by ads',
|
|
35
45
|
/**
|
|
36
46
|
* @description Title for a metric showing the number of ads in the viewport.
|
|
37
47
|
*/
|
|
38
48
|
viewportAdCount: 'Viewport ad count',
|
|
49
|
+
/**
|
|
50
|
+
* @description Tooltip text explaining the viewport ad count metric in the ads view of the Application panel.
|
|
51
|
+
*/
|
|
52
|
+
viewportAdCountExplanation: 'Number of ads in the viewport',
|
|
39
53
|
/**
|
|
40
54
|
* @description Title for a metric showing the total CPU usage by ads.
|
|
41
55
|
*/
|
|
42
56
|
totalCpuUsage: 'Total CPU usage by ads',
|
|
57
|
+
/**
|
|
58
|
+
* @description Tooltip text explaining the total CPU usage metric in the ads view of the Application panel.
|
|
59
|
+
*/
|
|
60
|
+
totalCpuUsageExplanation: 'Total CPU time consumed by ads',
|
|
43
61
|
/**
|
|
44
62
|
* @description Title for a metric showing the total network usage by ads.
|
|
45
63
|
*/
|
|
46
64
|
totalNetworkUsage: 'Total network usage by ads',
|
|
65
|
+
/**
|
|
66
|
+
* @description Tooltip text explaining the total network usage metric in the ads view of the Application panel.
|
|
67
|
+
*/
|
|
68
|
+
totalNetworkUsageExplanation: 'Total network data consumed by ads',
|
|
47
69
|
/**
|
|
48
70
|
* @description Subtext showing the average value of a metric.
|
|
49
71
|
* @example {5.00%} PH1
|
|
@@ -231,6 +253,26 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
231
253
|
});
|
|
232
254
|
};
|
|
233
255
|
|
|
256
|
+
const renderMetricTooltip = (tooltipId: string, explanation: string, url: string): Lit.LitTemplate => {
|
|
257
|
+
return html`
|
|
258
|
+
<devtools-icon
|
|
259
|
+
name="info"
|
|
260
|
+
class="small metric-info-icon"
|
|
261
|
+
tabindex="0"
|
|
262
|
+
role="button"
|
|
263
|
+
aria-details=${tooltipId}
|
|
264
|
+
aria-label=${explanation}
|
|
265
|
+
></devtools-icon>
|
|
266
|
+
<devtools-tooltip id=${tooltipId} variant="rich" prefer-span-left @copy=${stopPropagation}>
|
|
267
|
+
<span>${explanation}</span>
|
|
268
|
+
 
|
|
269
|
+
<devtools-link href=${url} jslogcontext="learn-more">
|
|
270
|
+
${i18nString(UIStrings.learnMore)}
|
|
271
|
+
</devtools-link>
|
|
272
|
+
</devtools-tooltip>
|
|
273
|
+
`;
|
|
274
|
+
};
|
|
275
|
+
|
|
234
276
|
// clang-format off
|
|
235
277
|
Lit.render(html`
|
|
236
278
|
<style>${adsViewStyles}</style>
|
|
@@ -245,6 +287,11 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
245
287
|
PH1: formatAverage(metrics.averageViewportAdDensityByArea, true),
|
|
246
288
|
})}</span>
|
|
247
289
|
</dd>
|
|
290
|
+
${renderMetricTooltip(
|
|
291
|
+
'density-metric-tooltip',
|
|
292
|
+
i18nString(UIStrings.viewportAdDensityExplanation),
|
|
293
|
+
DENSITY_DOC_URL,
|
|
294
|
+
)}
|
|
248
295
|
</div>
|
|
249
296
|
<div class="metric-box">
|
|
250
297
|
<dt class="metric-title">${i18nString(UIStrings.viewportAdCount)}</dt>
|
|
@@ -254,18 +301,33 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
254
301
|
PH1: formatAverage(metrics.averageViewportAdCount, false),
|
|
255
302
|
})}</span>
|
|
256
303
|
</dd>
|
|
304
|
+
${renderMetricTooltip(
|
|
305
|
+
'count-metric-tooltip',
|
|
306
|
+
i18nString(UIStrings.viewportAdCountExplanation),
|
|
307
|
+
COUNT_DOC_URL,
|
|
308
|
+
)}
|
|
257
309
|
</div>
|
|
258
310
|
<div class="metric-box">
|
|
259
311
|
<dt class="metric-title">${i18nString(UIStrings.totalCpuUsage)}</dt>
|
|
260
312
|
<dd class="metric-value">
|
|
261
313
|
<span>${formatCpu(metrics.totalAdCpuTime)}</span>
|
|
262
314
|
</dd>
|
|
315
|
+
${renderMetricTooltip(
|
|
316
|
+
'cpu-metric-tooltip',
|
|
317
|
+
i18nString(UIStrings.totalCpuUsageExplanation),
|
|
318
|
+
CPU_USAGE_DOC_URL,
|
|
319
|
+
)}
|
|
263
320
|
</div>
|
|
264
321
|
<div class="metric-box">
|
|
265
322
|
<dt class="metric-title">${i18nString(UIStrings.totalNetworkUsage)}</dt>
|
|
266
323
|
<dd class="metric-value">
|
|
267
324
|
<span>${formatNetwork(metrics.totalAdNetworkBytes)}</span>
|
|
268
325
|
</dd>
|
|
326
|
+
${renderMetricTooltip(
|
|
327
|
+
'network-metric-tooltip',
|
|
328
|
+
i18nString(UIStrings.totalNetworkUsageExplanation),
|
|
329
|
+
NETWORK_USAGE_DOC_URL,
|
|
330
|
+
)}
|
|
269
331
|
</div>
|
|
270
332
|
</dl>
|
|
271
333
|
<hr class="divider">
|
|
@@ -374,7 +436,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
374
436
|
<span>
|
|
375
437
|
${i18nString(UIStrings.adDetectionMistakes)}
|
|
376
438
|
 
|
|
377
|
-
<devtools-link
|
|
439
|
+
<devtools-link href=${AD_DETECTION_DOC_URL} jslogcontext="learn-more">
|
|
378
440
|
${i18nString(UIStrings.learnMore)}
|
|
379
441
|
</devtools-link>
|
|
380
442
|
</span>
|
|
@@ -29,17 +29,20 @@
|
|
|
29
29
|
|
|
30
30
|
.metric-box {
|
|
31
31
|
background-color: var(--sys-color-surface);
|
|
32
|
-
padding: var(--sys-size-
|
|
32
|
+
padding: var(--sys-size-4);
|
|
33
33
|
display: flex;
|
|
34
34
|
flex-direction: column;
|
|
35
35
|
align-items: center;
|
|
36
36
|
justify-content: center;
|
|
37
|
+
position: relative;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
.metric-title {
|
|
40
41
|
font-size: var(--sys-typescale-body4-size);
|
|
41
42
|
color: var(--sys-color-on-surface-subtle);
|
|
42
43
|
margin: 0 0 var(--sys-size-3);
|
|
44
|
+
padding: 0 var(--sys-size-8);
|
|
45
|
+
text-align: center;
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
.metric-value {
|
|
@@ -59,6 +62,13 @@
|
|
|
59
62
|
color: var(--sys-color-on-surface-subtle);
|
|
60
63
|
}
|
|
61
64
|
|
|
65
|
+
.metric-info-icon {
|
|
66
|
+
position: absolute;
|
|
67
|
+
top: var(--sys-size-4);
|
|
68
|
+
right: var(--sys-size-4);
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
}
|
|
71
|
+
|
|
62
72
|
.metrics-title,
|
|
63
73
|
.ad-frames-title,
|
|
64
74
|
.ad-scripts-title,
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import '../../ui/components/tooltips/tooltips.js';
|
|
6
6
|
|
|
7
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
|
+
import type * as SDK from '../../core/sdk/sdk.js';
|
|
8
9
|
import type * as CommentManager from '../../models/comment_manager/comment_manager.js';
|
|
9
10
|
import * as Input from '../../ui/components/input/input.js';
|
|
10
11
|
import * as MarkdownView from '../../ui/components/markdown_view/markdown_view.js';
|
|
@@ -12,14 +13,12 @@ import * as UI from '../../ui/legacy/legacy.js';
|
|
|
12
13
|
import * as Lit from '../../ui/lit/lit.js';
|
|
13
14
|
|
|
14
15
|
import commentThreadWidgetStyles from './commentThreadWidget.css.js';
|
|
16
|
+
import {DOMNodeLink} from './DOMLinkifier.js';
|
|
15
17
|
|
|
16
18
|
const {html, render, Directives: {createRef, ref}} = Lit;
|
|
19
|
+
const {widget} = UI.Widget;
|
|
17
20
|
|
|
18
21
|
const UIStrings = {
|
|
19
|
-
/**
|
|
20
|
-
* @description Link text in the info tooltip for learning more about comments sent to the agent.
|
|
21
|
-
*/
|
|
22
|
-
learnMore: 'Learn more',
|
|
23
22
|
/**
|
|
24
23
|
* @description Text next to the checkmark in the comment thread header indicating that comments have been sent to
|
|
25
24
|
* the agent.
|
|
@@ -37,7 +36,7 @@ const UIStrings = {
|
|
|
37
36
|
/**
|
|
38
37
|
* @description Label for the aria-label of the add comment button.
|
|
39
38
|
*/
|
|
40
|
-
|
|
39
|
+
sendToAgent: 'Send to agent',
|
|
41
40
|
/**
|
|
42
41
|
* @description aria-label for the comment text area.
|
|
43
42
|
*/
|
|
@@ -49,19 +48,26 @@ const UIStringsNotTranslate = {
|
|
|
49
48
|
* @description Disclaimer text in the comment thread info tooltip.
|
|
50
49
|
*/
|
|
51
50
|
inputDisclaimer:
|
|
52
|
-
'Comment strings, DOM hierarchy snippets, tracked CSS and DOM changes, Visual Element (VE) paths and signatures, and tracked presenter changes are sent to the connected third-party agent to assist with debugging and code updates
|
|
51
|
+
'Comment strings, DOM hierarchy snippets, tracked CSS and DOM changes, Visual Element (VE) paths and signatures, and tracked presenter changes are sent to the connected third-party agent to assist with debugging and code updates',
|
|
53
52
|
} as const;
|
|
54
53
|
|
|
55
54
|
const str_ = i18n.i18n.registerUIStrings('panels/common/CommentThreadWidget.ts', UIStrings);
|
|
56
55
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
57
56
|
const lockedString = i18n.i18n.lockedString;
|
|
58
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Either the DOM node the thread is anchored to, or a plain text label for anchors that are not
|
|
60
|
+
* DOM nodes (e.g. network requests).
|
|
61
|
+
*/
|
|
62
|
+
export type Title = {
|
|
63
|
+
node: SDK.DOMModel.DOMNode,
|
|
64
|
+
}|{text: string};
|
|
65
|
+
|
|
59
66
|
export interface ViewInput {
|
|
60
|
-
title:
|
|
67
|
+
title: Title;
|
|
61
68
|
comments: CommentManager.CommentManager.Comment[];
|
|
62
69
|
commentText: string;
|
|
63
70
|
textAreaRef: Lit.Directives.Ref<HTMLTextAreaElement>;
|
|
64
|
-
onLearnMoreClick: () => void;
|
|
65
71
|
onAddComment: (text: string) => void;
|
|
66
72
|
onCommentTextChange: (event: Event) => void;
|
|
67
73
|
}
|
|
@@ -77,7 +83,9 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
|
|
|
77
83
|
<div class="comment-thread-widget ${hasComment ? 'submitted' : ''}">
|
|
78
84
|
<div class="header">
|
|
79
85
|
<span class="selected-item">
|
|
80
|
-
|
|
86
|
+
${'node' in input.title ?
|
|
87
|
+
widget(DOMNodeLink, {node: input.title.node}) :
|
|
88
|
+
html`<span class="selected-item-text">${input.title.text}</span>`}
|
|
81
89
|
</span>
|
|
82
90
|
${hasComment ? html`
|
|
83
91
|
<div class="sent-status">
|
|
@@ -139,18 +147,13 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
|
|
|
139
147
|
>
|
|
140
148
|
<div class="info-tooltip-container">
|
|
141
149
|
${lockedString(UIStringsNotTranslate.inputDisclaimer)}
|
|
142
|
-
<button
|
|
143
|
-
class="tooltip-link"
|
|
144
|
-
role="link"
|
|
145
|
-
@click=${input.onLearnMoreClick}
|
|
146
|
-
>${i18nString(UIStrings.learnMore)}</button>
|
|
147
150
|
</div>
|
|
148
151
|
</devtools-tooltip>
|
|
149
152
|
<devtools-button
|
|
150
|
-
aria-label=${i18nString(UIStrings.
|
|
153
|
+
aria-label=${i18nString(UIStrings.sendToAgent)}
|
|
151
154
|
.disabled=${!input.commentText.trim()}
|
|
152
155
|
@click=${() => input.onAddComment(input.commentText)}>
|
|
153
|
-
${i18nString(UIStrings.
|
|
156
|
+
${i18nString(UIStrings.sendToAgent)}
|
|
154
157
|
</devtools-button>
|
|
155
158
|
</div>
|
|
156
159
|
` : Lit.nothing}
|
|
@@ -162,7 +165,7 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTML
|
|
|
162
165
|
type View = typeof DEFAULT_VIEW;
|
|
163
166
|
|
|
164
167
|
export class CommentThreadWidget extends UI.Widget.Widget {
|
|
165
|
-
title =
|
|
168
|
+
title: Title = {text: ''};
|
|
166
169
|
#comments: CommentManager.CommentManager.Comment[] = [];
|
|
167
170
|
#commentText = '';
|
|
168
171
|
#textAreaRef = createRef<HTMLTextAreaElement>();
|
|
@@ -187,10 +190,6 @@ export class CommentThreadWidget extends UI.Widget.Widget {
|
|
|
187
190
|
this.requestUpdate();
|
|
188
191
|
}
|
|
189
192
|
|
|
190
|
-
#handleLearnMoreClick = (): void => {
|
|
191
|
-
// TODO: wire up the learn more click
|
|
192
|
-
};
|
|
193
|
-
|
|
194
193
|
#handleAddComment = (text: string): void => {
|
|
195
194
|
const commentText = text.trim();
|
|
196
195
|
if (commentText && this.onAddComment) {
|
|
@@ -212,7 +211,6 @@ export class CommentThreadWidget extends UI.Widget.Widget {
|
|
|
212
211
|
comments: this.#comments,
|
|
213
212
|
commentText: this.#commentText,
|
|
214
213
|
textAreaRef: this.#textAreaRef,
|
|
215
|
-
onLearnMoreClick: this.#handleLearnMoreClick,
|
|
216
214
|
onAddComment: this.#handleAddComment,
|
|
217
215
|
onCommentTextChange: this.#handleCommentTextChange,
|
|
218
216
|
};
|