chrome-devtools-frontend 1.0.1028626 → 1.0.1029795
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/config/gni/devtools_grd_files.gni +6 -5
- package/config/gni/devtools_image_files.gni +1 -0
- package/front_end/Images/src/clear-warning_icon.svg +99 -0
- package/front_end/core/common/WasmDisassembly.ts +6 -1
- package/front_end/core/host/ResourceLoader.ts +17 -3
- package/front_end/core/i18n/locales/en-US.json +9 -3
- package/front_end/core/i18n/locales/en-XL.json +9 -3
- package/front_end/core/sdk/NetworkManager.ts +3 -1
- package/front_end/core/sdk/Script.ts +39 -13
- package/front_end/generated/InspectorBackendCommands.js +6 -6
- package/front_end/generated/SupportedCSSProperties.js +2 -4
- package/front_end/generated/protocol.ts +29 -10
- package/front_end/models/bindings/ContentProviderBasedProject.ts +7 -1
- package/front_end/models/issues_manager/AttributionReportingIssue.ts +26 -40
- package/front_end/models/issues_manager/DeprecationIssue.ts +17 -2
- package/front_end/models/issues_manager/descriptions/arInsecureContext.md +7 -0
- package/front_end/models/issues_manager/descriptions/arInvalidEligibleHeader.md +19 -0
- package/front_end/models/issues_manager/descriptions/arInvalidRegisterSourceHeader.md +5 -0
- package/front_end/models/issues_manager/descriptions/arInvalidRegisterTriggerHeader.md +5 -0
- package/front_end/models/issues_manager/descriptions/arPermissionPolicyDisabled.md +7 -4
- package/front_end/models/issues_manager/descriptions/arUntrustworthyReportingOrigin.md +10 -0
- package/front_end/models/text_utils/ContentProvider.ts +9 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +3 -23
- package/front_end/panels/elements/StylesSidebarPane.ts +31 -1
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +13 -42
- package/front_end/panels/network/components/RequestHeadersView.ts +58 -28
- package/front_end/panels/network/network-meta.ts +16 -0
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +80 -22
- package/front_end/panels/timeline/TimelineLoader.ts +2 -1
- package/front_end/ui/legacy/SplitWidget.ts +2 -0
- package/front_end/ui/legacy/TextPrompt.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +9 -51
- package/package.json +1 -1
- package/front_end/models/issues_manager/descriptions/arAttributionSourceUntrustworthyFrameOrigin.md +0 -4
- package/front_end/models/issues_manager/descriptions/arAttributionSourceUntrustworthyOrigin.md +0 -5
- package/front_end/models/issues_manager/descriptions/arAttributionUntrustworthyFrameOrigin.md +0 -4
- package/front_end/models/issues_manager/descriptions/arAttributionUntrustworthyOrigin.md +0 -4
- package/front_end/models/issues_manager/descriptions/arInvalidHeader.md +0 -3
@@ -10,34 +10,32 @@ import {type MarkdownIssueDescription} from './MarkdownIssueDescription.js';
|
|
10
10
|
|
11
11
|
export const enum IssueCode {
|
12
12
|
PermissionPolicyDisabled = 'AttributionReportingIssue::PermissionPolicyDisabled',
|
13
|
-
AttributionSourceUntrustworthyFrameOrigin = 'AttributionReportingIssue::AttributionSourceUntrustworthyFrameOrigin',
|
14
|
-
AttributionSourceUntrustworthyOrigin = 'AttributionReportingIssue::AttributionSourceUntrustworthyOrigin',
|
15
|
-
AttributionUntrustworthyFrameOrigin = 'AttributionReportingIssue::AttributionUntrustworthyFrameOrigin',
|
16
|
-
AttributionUntrustworthyOrigin = 'AttributionReportingIssue::AttributionUntrustworthyOrigin',
|
17
13
|
UntrustworthyReportingOrigin = 'AttributionReportingIssue::UntrustworthyReportingOrigin',
|
18
14
|
InsecureContext = 'AttributionReportingIssue::InsecureContext',
|
19
|
-
|
15
|
+
InvalidRegisterSourceHeader = 'AttributionReportingIssue::InvalidRegisterSourceHeader',
|
20
16
|
InvalidRegisterTriggerHeader = 'AttributionReportingIssue::InvalidRegisterTriggerHeader',
|
17
|
+
InvalidEligibleHeader = 'AttributionReportingIssue::InvalidEligibleHeader',
|
18
|
+
// TODO(apaseltiner): Remove this once old issue types are removed from
|
19
|
+
// protocol.
|
20
|
+
Unknown = 'AttributionReportingIssue::Unknown',
|
21
21
|
}
|
22
22
|
|
23
23
|
function getIssueCode(details: Protocol.Audits.AttributionReportingIssueDetails): IssueCode {
|
24
24
|
switch (details.violationType) {
|
25
25
|
case Protocol.Audits.AttributionReportingIssueType.PermissionPolicyDisabled:
|
26
26
|
return IssueCode.PermissionPolicyDisabled;
|
27
|
-
case Protocol.Audits.AttributionReportingIssueType.AttributionSourceUntrustworthyOrigin:
|
28
|
-
return details.frame !== undefined ? IssueCode.AttributionSourceUntrustworthyFrameOrigin :
|
29
|
-
IssueCode.AttributionSourceUntrustworthyOrigin;
|
30
|
-
case Protocol.Audits.AttributionReportingIssueType.AttributionUntrustworthyOrigin:
|
31
|
-
return details.frame !== undefined ? IssueCode.AttributionUntrustworthyFrameOrigin :
|
32
|
-
IssueCode.AttributionUntrustworthyOrigin;
|
33
27
|
case Protocol.Audits.AttributionReportingIssueType.UntrustworthyReportingOrigin:
|
34
28
|
return IssueCode.UntrustworthyReportingOrigin;
|
35
29
|
case Protocol.Audits.AttributionReportingIssueType.InsecureContext:
|
36
30
|
return IssueCode.InsecureContext;
|
37
31
|
case Protocol.Audits.AttributionReportingIssueType.InvalidHeader:
|
38
|
-
return IssueCode.
|
32
|
+
return IssueCode.InvalidRegisterSourceHeader;
|
39
33
|
case Protocol.Audits.AttributionReportingIssueType.InvalidRegisterTriggerHeader:
|
40
34
|
return IssueCode.InvalidRegisterTriggerHeader;
|
35
|
+
case Protocol.Audits.AttributionReportingIssueType.InvalidEligibleHeader:
|
36
|
+
return IssueCode.InvalidEligibleHeader;
|
37
|
+
default:
|
38
|
+
return IssueCode.Unknown;
|
41
39
|
}
|
42
40
|
}
|
43
41
|
|
@@ -61,47 +59,35 @@ export class AttributionReportingIssue extends Issue<IssueCode> {
|
|
61
59
|
file: 'arPermissionPolicyDisabled.md',
|
62
60
|
links: [],
|
63
61
|
};
|
64
|
-
case IssueCode.
|
62
|
+
case IssueCode.UntrustworthyReportingOrigin:
|
65
63
|
return {
|
66
|
-
file: '
|
64
|
+
file: 'arUntrustworthyReportingOrigin.md',
|
67
65
|
links: [],
|
68
66
|
};
|
69
|
-
case IssueCode.
|
67
|
+
case IssueCode.InsecureContext:
|
70
68
|
return {
|
71
|
-
file: '
|
72
|
-
links: [
|
73
|
-
{
|
74
|
-
link:
|
75
|
-
'https://developer.chrome.com/docs/privacy-sandbox/attribution-reporting-event-guide/#html-attribute-attributiondestination-required',
|
76
|
-
linkTitle: 'attributiondestination attribute',
|
77
|
-
},
|
78
|
-
{
|
79
|
-
link:
|
80
|
-
'https://developer.chrome.com/docs/privacy-sandbox/attribution-reporting-event-guide/#html-attribute-attributionreportto',
|
81
|
-
linkTitle: 'attributionreportto attribute',
|
82
|
-
},
|
83
|
-
],
|
69
|
+
file: 'arInsecureContext.md',
|
70
|
+
links: [],
|
84
71
|
};
|
85
|
-
case IssueCode.
|
72
|
+
case IssueCode.InvalidRegisterSourceHeader:
|
86
73
|
return {
|
87
|
-
file: '
|
74
|
+
file: 'arInvalidRegisterSourceHeader.md',
|
88
75
|
links: [],
|
89
76
|
};
|
90
|
-
case IssueCode.
|
77
|
+
case IssueCode.InvalidRegisterTriggerHeader:
|
91
78
|
return {
|
92
|
-
file: '
|
79
|
+
file: 'arInvalidRegisterTriggerHeader.md',
|
93
80
|
links: [],
|
94
81
|
};
|
95
|
-
case IssueCode.
|
96
|
-
return null;
|
97
|
-
case IssueCode.InsecureContext:
|
98
|
-
return null;
|
99
|
-
case IssueCode.InvalidHeader:
|
82
|
+
case IssueCode.InvalidEligibleHeader:
|
100
83
|
return {
|
101
|
-
file: '
|
102
|
-
links: [
|
84
|
+
file: 'arInvalidEligibleHeader.md',
|
85
|
+
links: [{
|
86
|
+
link: 'https://tools.ietf.org/id/draft-ietf-httpbis-header-structure-15.html#rfc.section.4.2.2',
|
87
|
+
linkTitle: 'Structured Headers RFC',
|
88
|
+
}],
|
103
89
|
};
|
104
|
-
case IssueCode.
|
90
|
+
case IssueCode.Unknown:
|
105
91
|
return null;
|
106
92
|
}
|
107
93
|
}
|
@@ -27,9 +27,14 @@ const UIStrings = {
|
|
27
27
|
*/
|
28
28
|
title: 'Deprecated Feature Used',
|
29
29
|
|
30
|
-
// Store alphabetized messages per DeprecationIssueType in this block.
|
31
30
|
/**
|
32
|
-
* @description
|
31
|
+
* @description We show this warning when 1) an "authorization" header is
|
32
|
+
* attached to the request by scripts, 2) there is no "authorization" in
|
33
|
+
* the "access-control-allow-headers" header in the response, and 3) there
|
34
|
+
* is a wildcard symbol ("*") in the "access-control-allow-header" header
|
35
|
+
* in the response. This is allowed now, but we're planning to reject such
|
36
|
+
* responses and require responses to have an "access-control-allow-headers"
|
37
|
+
* containing "authorization".
|
33
38
|
*/
|
34
39
|
authorizationCoveredByWildcard:
|
35
40
|
'Authorization will not be covered by the wildcard symbol (*) in CORS `Access-Control-Allow-Headers` handling.',
|
@@ -181,6 +186,11 @@ const UIStrings = {
|
|
181
186
|
*/
|
182
187
|
openWebDatabaseInsecureContext:
|
183
188
|
'WebSQL in non-secure contexts is deprecated and will be removed in M107. Please use Web Storage or Indexed Database.',
|
189
|
+
/**
|
190
|
+
* @description Warning displayed to developers when persistent storage type is used to notify that storage type is deprecated.
|
191
|
+
*/
|
192
|
+
persistentQuotaType:
|
193
|
+
'`StorageType.persistent` is deprecated. Please use standardized `navigator.storage` instead.',
|
184
194
|
/**
|
185
195
|
* @description This issue indicates that a `<source>` element with a `<picture>` parent was using an `src` attribute, which is not valid and is ignored by the browser. The `srcset` attribute should be used instead.
|
186
196
|
*/
|
@@ -441,6 +451,11 @@ export class DeprecationIssue extends Issue {
|
|
441
451
|
feature = 5175124599767040;
|
442
452
|
milestone = 105;
|
443
453
|
break;
|
454
|
+
case Protocol.Audits.DeprecationIssueType.PersistentQuotaType:
|
455
|
+
messageFunction = i18nLazyString(UIStrings.persistentQuotaType);
|
456
|
+
feature = 5176235376246784;
|
457
|
+
milestone = 106;
|
458
|
+
break;
|
444
459
|
case Protocol.Audits.DeprecationIssueType.PictureSourceSrc:
|
445
460
|
messageFunction = i18nLazyString(UIStrings.pictureSourceSrc);
|
446
461
|
break;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Ensure that the attribution registration context is secure
|
2
|
+
|
3
|
+
This page tried to register a source or trigger using the Attribution Reporting
|
4
|
+
API but failed because the page that initiated the registration was not secure.
|
5
|
+
|
6
|
+
The registration context must use HTTPS unless it is `localhost` or
|
7
|
+
`127.0.0.1`.
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Ensure that the `Attribution-Reporting-Eligible` header is valid
|
2
|
+
|
3
|
+
This page sent a request containing an `Attribution-Reporting-Eligible` header,
|
4
|
+
but the header value was not a valid structured dictionary, causing any source
|
5
|
+
or trigger registration in the response to be ignored.
|
6
|
+
|
7
|
+
The header should contain a structured dictionary as follows:
|
8
|
+
|
9
|
+
To allow the response to register an event source:
|
10
|
+
`Attribution-Reporting-Eligible: event-source`
|
11
|
+
|
12
|
+
To allow the response to register a trigger:
|
13
|
+
`Attribution-Reporting-Eligible: trigger`
|
14
|
+
|
15
|
+
To allow the response to register an event source or a trigger:
|
16
|
+
`Attribution-Reporting-Eligible: event-source, trigger`
|
17
|
+
|
18
|
+
To prevent the response from registering anything:
|
19
|
+
`Attribution-Reporting-Eligible: `
|
@@ -1,6 +1,9 @@
|
|
1
|
-
# Ensure the
|
1
|
+
# Ensure that the `attribution-reporting` permission policy is enabled
|
2
2
|
|
3
|
-
This page
|
3
|
+
This page tried to use the Attribution Reporting API but failed because the
|
4
|
+
`attribution-reporting` permission policy is not enabled.
|
4
5
|
|
5
|
-
This API is enabled by default in the top-level context and in same-origin
|
6
|
-
be explicitly opted-in for cross-origin frames. Add the
|
6
|
+
This API is enabled by default in the top-level context and in same-origin
|
7
|
+
child frames, but must be explicitly opted-in for cross-origin frames. Add the
|
8
|
+
permission policy as follows:
|
9
|
+
`<iframe src="..." allow="attribution-reporting">`.
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Ensure that attribution reporting origins are trustworthy
|
2
|
+
|
3
|
+
This page tried to register a source or trigger using the Attribution Reporting
|
4
|
+
API but failed because the reporting origin was not potentially trustworthy.
|
5
|
+
|
6
|
+
The reporting origin is typically the server that sets the
|
7
|
+
`Attribution-Reporting-Register-Source` or
|
8
|
+
`Attribution-Reporting-Register-Trigger` header.
|
9
|
+
|
10
|
+
The reporting origin must use HTTPS unless it is `localhost` or `127.0.0.1`.
|
@@ -59,4 +59,12 @@ export const contentAsDataURL = function(
|
|
59
59
|
export type DeferredContent = {
|
60
60
|
content: string,
|
61
61
|
isEncoded: boolean,
|
62
|
-
}|{
|
62
|
+
}|{
|
63
|
+
content: '',
|
64
|
+
isEncoded: false,
|
65
|
+
wasmDisassemblyInfo: Common.WasmDisassembly.WasmDisassembly,
|
66
|
+
}|{
|
67
|
+
content: null,
|
68
|
+
error: string,
|
69
|
+
isEncoded: boolean,
|
70
|
+
};
|
@@ -26,6 +26,8 @@ import {cssRuleValidatorsMap, type AuthoringHint} from './CSSRuleValidator.js';
|
|
26
26
|
const FlexboxEditor = ElementsComponents.StylePropertyEditor.FlexboxEditor;
|
27
27
|
const GridEditor = ElementsComponents.StylePropertyEditor.GridEditor;
|
28
28
|
|
29
|
+
export const activeHints = new WeakMap<Element, AuthoringHint>();
|
30
|
+
|
29
31
|
const UIStrings = {
|
30
32
|
/**
|
31
33
|
*@description Text in Color Swatch Popover Icon of the Elements panel
|
@@ -719,11 +721,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
719
721
|
const showAuthoringHint = authoringHint !== null && this.property.parsedOk;
|
720
722
|
if (showAuthoringHint) {
|
721
723
|
const hintIcon = UI.Icon.Icon.create('mediumicon-info', 'hint');
|
722
|
-
|
723
|
-
new UI.PopoverHelper.PopoverHelper(hintIcon, event => this.handleHintPopoverRequest(authoringHint, event));
|
724
|
-
hintPopover.setHasPadding(true);
|
725
|
-
hintPopover.setTimeout(0, 100);
|
726
|
-
|
724
|
+
activeHints.set(hintIcon, authoringHint);
|
727
725
|
this.listItemElement.append(hintIcon);
|
728
726
|
}
|
729
727
|
|
@@ -836,24 +834,6 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
836
834
|
return null;
|
837
835
|
}
|
838
836
|
|
839
|
-
private handleHintPopoverRequest(authoringHint: AuthoringHint, event: Event): UI.PopoverHelper.PopoverRequest|null {
|
840
|
-
const link = event.composedPath()[0];
|
841
|
-
Platform.DCHECK(() => link instanceof Element, 'Link is not an instance of Element');
|
842
|
-
|
843
|
-
return {
|
844
|
-
box: (link as Element).boxInWindow(),
|
845
|
-
show: async(popover: UI.GlassPane.GlassPane): Promise<boolean> => {
|
846
|
-
const node = this.node();
|
847
|
-
if (!node) {
|
848
|
-
return false;
|
849
|
-
}
|
850
|
-
const popupElement = new ElementsComponents.CSSHintDetailsView.CSSHintDetailsView(authoringHint);
|
851
|
-
popover.contentElement.insertAdjacentElement('beforeend', popupElement);
|
852
|
-
return true;
|
853
|
-
},
|
854
|
-
};
|
855
|
-
}
|
856
|
-
|
857
837
|
private mouseUp(event: MouseEvent): void {
|
858
838
|
const activeTreeElement = parentMap.get(this.parentPaneInternal);
|
859
839
|
parentMap.delete(this.parentPaneInternal);
|
@@ -60,7 +60,7 @@ import {StyleEditorWidget} from './StyleEditorWidget.js';
|
|
60
60
|
import {StylePropertyHighlighter} from './StylePropertyHighlighter.js';
|
61
61
|
import stylesSidebarPaneStyles from './stylesSidebarPane.css.js';
|
62
62
|
|
63
|
-
import {type StylePropertyTreeElement} from './StylePropertyTreeElement.js';
|
63
|
+
import {activeHints, type StylePropertyTreeElement} from './StylePropertyTreeElement.js';
|
64
64
|
import {
|
65
65
|
StylePropertiesSection,
|
66
66
|
BlankStylePropertiesSection,
|
@@ -213,6 +213,7 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
|
|
213
213
|
private needsForceUpdate: boolean;
|
214
214
|
private readonly resizeThrottler: Common.Throttler.Throttler;
|
215
215
|
private readonly imagePreviewPopover: ImagePreviewPopover;
|
216
|
+
#hintPopoverHelper: UI.PopoverHelper.PopoverHelper;
|
216
217
|
activeCSSAngle: InlineEditor.CSSAngle.CSSAngle|null;
|
217
218
|
#urlToChangeTracker: Map<Platform.DevToolsPath.UrlString, ChangeTracker> = new Map();
|
218
219
|
#copyChangesButton?: UI.Toolbar.ToolbarButton;
|
@@ -282,6 +283,35 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
|
|
282
283
|
}, () => this.node());
|
283
284
|
|
284
285
|
this.activeCSSAngle = null;
|
286
|
+
|
287
|
+
this.#hintPopoverHelper = new UI.PopoverHelper.PopoverHelper(this.contentElement, event => {
|
288
|
+
const icon = event.composedPath()[0] as Element;
|
289
|
+
|
290
|
+
if (!icon) {
|
291
|
+
return null;
|
292
|
+
}
|
293
|
+
|
294
|
+
if (!icon.matches('.hint')) {
|
295
|
+
return null;
|
296
|
+
}
|
297
|
+
|
298
|
+
const hint = activeHints.get(icon);
|
299
|
+
|
300
|
+
if (!hint) {
|
301
|
+
return null;
|
302
|
+
}
|
303
|
+
|
304
|
+
return {
|
305
|
+
box: icon.boxInWindow(),
|
306
|
+
show: async(popover: UI.GlassPane.GlassPane): Promise<boolean> => {
|
307
|
+
const popupElement = new ElementsComponents.CSSHintDetailsView.CSSHintDetailsView(hint);
|
308
|
+
popover.contentElement.appendChild(popupElement);
|
309
|
+
return true;
|
310
|
+
},
|
311
|
+
};
|
312
|
+
});
|
313
|
+
this.#hintPopoverHelper.setTimeout(200);
|
314
|
+
this.#hintPopoverHelper.setHasPadding(true);
|
285
315
|
}
|
286
316
|
|
287
317
|
swatchPopoverHelper(): InlineEditor.SwatchPopoverHelper.SwatchPopoverHelper {
|
@@ -14,11 +14,6 @@ const UIStrings = {
|
|
14
14
|
* @description Label for number of rows in the issue details table.
|
15
15
|
*/
|
16
16
|
nViolations: '{n, plural, =1 {# violation} other {# violations}}',
|
17
|
-
/**
|
18
|
-
* @description Noun, label for the column showing the associated frame in the issue details table.
|
19
|
-
* The associated frame can either be the "main frame" (or main window), or an HTML iframe.
|
20
|
-
*/
|
21
|
-
frame: 'Frame',
|
22
17
|
/**
|
23
18
|
* @description Noun, label for the column showing the associated HTML element in the issue details table.
|
24
19
|
*/
|
@@ -60,31 +55,19 @@ export class AttributionReportingIssueDetailsView extends AffectedResourcesView
|
|
60
55
|
issues: Iterable<IssuesManager.AttributionReportingIssue.AttributionReportingIssue>): void {
|
61
56
|
const header = document.createElement('tr');
|
62
57
|
switch (issueCode) {
|
63
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.
|
64
|
-
|
65
|
-
|
66
|
-
this.appendColumnTitle(header, i18nString(UIStrings.untrustworthyOrigin));
|
67
|
-
break;
|
68
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.AttributionUntrustworthyOrigin:
|
58
|
+
case IssuesManager.AttributionReportingIssue.IssueCode.InvalidRegisterSourceHeader:
|
59
|
+
case IssuesManager.AttributionReportingIssue.IssueCode.InvalidRegisterTriggerHeader:
|
60
|
+
case IssuesManager.AttributionReportingIssue.IssueCode.InvalidEligibleHeader:
|
69
61
|
this.appendColumnTitle(header, i18nString(UIStrings.request));
|
70
|
-
this.appendColumnTitle(header, i18nString(UIStrings.
|
71
|
-
break;
|
72
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.AttributionSourceUntrustworthyFrameOrigin:
|
73
|
-
this.appendColumnTitle(header, i18nString(UIStrings.frame));
|
74
|
-
this.appendColumnTitle(header, i18nString(UIStrings.element));
|
75
|
-
this.appendColumnTitle(header, i18nString(UIStrings.untrustworthyOrigin));
|
62
|
+
this.appendColumnTitle(header, i18nString(UIStrings.invalidHeaderValue));
|
76
63
|
break;
|
77
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.
|
64
|
+
case IssuesManager.AttributionReportingIssue.IssueCode.InsecureContext:
|
65
|
+
case IssuesManager.AttributionReportingIssue.IssueCode.UntrustworthyReportingOrigin:
|
78
66
|
this.appendColumnTitle(header, i18nString(UIStrings.element));
|
79
|
-
this.appendColumnTitle(header, i18nString(UIStrings.untrustworthyOrigin));
|
80
|
-
break;
|
81
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.InvalidHeader:
|
82
|
-
this.appendColumnTitle(header, i18nString(UIStrings.frame));
|
83
67
|
this.appendColumnTitle(header, i18nString(UIStrings.request));
|
84
|
-
this.appendColumnTitle(header, i18nString(UIStrings.
|
68
|
+
this.appendColumnTitle(header, i18nString(UIStrings.untrustworthyOrigin));
|
85
69
|
break;
|
86
70
|
case IssuesManager.AttributionReportingIssue.IssueCode.PermissionPolicyDisabled:
|
87
|
-
this.appendColumnTitle(header, i18nString(UIStrings.frame));
|
88
71
|
this.appendColumnTitle(header, i18nString(UIStrings.element));
|
89
72
|
this.appendColumnTitle(header, i18nString(UIStrings.request));
|
90
73
|
break;
|
@@ -108,21 +91,19 @@ export class AttributionReportingIssueDetailsView extends AffectedResourcesView
|
|
108
91
|
const details = issue.issueDetails;
|
109
92
|
|
110
93
|
switch (issueCode) {
|
111
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.
|
112
|
-
|
113
|
-
|
114
|
-
break;
|
115
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.AttributionUntrustworthyOrigin:
|
94
|
+
case IssuesManager.AttributionReportingIssue.IssueCode.InvalidRegisterSourceHeader:
|
95
|
+
case IssuesManager.AttributionReportingIssue.IssueCode.InvalidRegisterTriggerHeader:
|
96
|
+
case IssuesManager.AttributionReportingIssue.IssueCode.InvalidEligibleHeader:
|
116
97
|
this.#appendRequestOrEmptyCell(element, details.request);
|
117
98
|
this.appendIssueDetailCell(element, details.invalidParameter || '');
|
118
99
|
break;
|
119
|
-
case IssuesManager.AttributionReportingIssue.IssueCode.
|
120
|
-
|
100
|
+
case IssuesManager.AttributionReportingIssue.IssueCode.InsecureContext:
|
101
|
+
case IssuesManager.AttributionReportingIssue.IssueCode.UntrustworthyReportingOrigin:
|
102
|
+
await this.#appendElementOrEmptyCell(element, issue);
|
121
103
|
this.#appendRequestOrEmptyCell(element, details.request);
|
122
104
|
this.appendIssueDetailCell(element, details.invalidParameter || '');
|
123
105
|
break;
|
124
106
|
case IssuesManager.AttributionReportingIssue.IssueCode.PermissionPolicyDisabled:
|
125
|
-
this.#appendFrameOrEmptyCell(element, issue);
|
126
107
|
await this.#appendElementOrEmptyCell(element, issue);
|
127
108
|
this.#appendRequestOrEmptyCell(element, details.request);
|
128
109
|
break;
|
@@ -131,16 +112,6 @@ export class AttributionReportingIssueDetailsView extends AffectedResourcesView
|
|
131
112
|
this.affectedResources.appendChild(element);
|
132
113
|
}
|
133
114
|
|
134
|
-
#appendFrameOrEmptyCell(
|
135
|
-
parent: HTMLElement, issue: IssuesManager.AttributionReportingIssue.AttributionReportingIssue): void {
|
136
|
-
const details = issue.issueDetails;
|
137
|
-
if (details.frame) {
|
138
|
-
parent.appendChild(this.createFrameCell(details.frame.frameId, issue.getCategory()));
|
139
|
-
} else {
|
140
|
-
this.appendIssueDetailCell(parent, '');
|
141
|
-
}
|
142
|
-
}
|
143
|
-
|
144
115
|
async #appendElementOrEmptyCell(
|
145
116
|
parent: HTMLElement, issue: IssuesManager.AttributionReportingIssue.AttributionReportingIssue): Promise<void> {
|
146
117
|
const details = issue.issueDetails;
|
@@ -6,7 +6,6 @@ import * 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 * as Platform from '../../../core/platform/platform.js';
|
9
|
-
import {assertNotNullOrUndefined} from '../../../core/platform/platform.js';
|
10
9
|
import * as SDK from '../../../core/sdk/sdk.js';
|
11
10
|
import * as Protocol from '../../../generated/protocol.js';
|
12
11
|
import * as IssuesManager from '../../../models/issues_manager/issues_manager.js';
|
@@ -174,12 +173,16 @@ export class RequestHeadersView extends UI.Widget.VBox {
|
|
174
173
|
wasShown(): void {
|
175
174
|
this.#request.addEventListener(SDK.NetworkRequest.Events.RemoteAddressChanged, this.#refreshHeadersView, this);
|
176
175
|
this.#request.addEventListener(SDK.NetworkRequest.Events.FinishedLoading, this.#refreshHeadersView, this);
|
176
|
+
this.#request.addEventListener(SDK.NetworkRequest.Events.RequestHeadersChanged, this.#refreshHeadersView, this);
|
177
|
+
this.#request.addEventListener(SDK.NetworkRequest.Events.ResponseHeadersChanged, this.#refreshHeadersView, this);
|
177
178
|
this.#refreshHeadersView();
|
178
179
|
}
|
179
180
|
|
180
181
|
willHide(): void {
|
181
182
|
this.#request.removeEventListener(SDK.NetworkRequest.Events.RemoteAddressChanged, this.#refreshHeadersView, this);
|
182
183
|
this.#request.removeEventListener(SDK.NetworkRequest.Events.FinishedLoading, this.#refreshHeadersView, this);
|
184
|
+
this.#request.removeEventListener(SDK.NetworkRequest.Events.RequestHeadersChanged, this.#refreshHeadersView, this);
|
185
|
+
this.#request.removeEventListener(SDK.NetworkRequest.Events.ResponseHeadersChanged, this.#refreshHeadersView, this);
|
183
186
|
}
|
184
187
|
|
185
188
|
#refreshHeadersView(): void {
|
@@ -212,7 +215,9 @@ export class RequestHeadersComponent extends HTMLElement {
|
|
212
215
|
}
|
213
216
|
|
214
217
|
#render(): void {
|
215
|
-
|
218
|
+
if (!this.#request) {
|
219
|
+
return;
|
220
|
+
}
|
216
221
|
|
217
222
|
// Disabled until https://crbug.com/1079231 is fixed.
|
218
223
|
// clang-format off
|
@@ -224,8 +229,10 @@ export class RequestHeadersComponent extends HTMLElement {
|
|
224
229
|
// clang-format on
|
225
230
|
}
|
226
231
|
|
227
|
-
#renderResponseHeaders(): LitHtml.
|
228
|
-
|
232
|
+
#renderResponseHeaders(): LitHtml.LitTemplate {
|
233
|
+
if (!this.#request) {
|
234
|
+
return LitHtml.nothing;
|
235
|
+
}
|
229
236
|
|
230
237
|
const headersWithIssues = [];
|
231
238
|
if (this.#request.wasBlocked()) {
|
@@ -299,8 +306,10 @@ export class RequestHeadersComponent extends HTMLElement {
|
|
299
306
|
// clang-format on
|
300
307
|
}
|
301
308
|
|
302
|
-
#renderRequestHeaders(): LitHtml.
|
303
|
-
|
309
|
+
#renderRequestHeaders(): LitHtml.LitTemplate {
|
310
|
+
if (!this.#request) {
|
311
|
+
return LitHtml.nothing;
|
312
|
+
}
|
304
313
|
|
305
314
|
const headers = this.#request.requestHeaders().slice();
|
306
315
|
headers.sort(function(a, b) {
|
@@ -337,8 +346,7 @@ export class RequestHeadersComponent extends HTMLElement {
|
|
337
346
|
}
|
338
347
|
|
339
348
|
#maybeRenderProvisionalHeadersWarning(): LitHtml.LitTemplate {
|
340
|
-
|
341
|
-
if (this.#request.requestHeadersText() !== undefined) {
|
349
|
+
if (!this.#request || this.#request.requestHeadersText() !== undefined) {
|
342
350
|
return LitHtml.nothing;
|
343
351
|
}
|
344
352
|
|
@@ -350,14 +358,16 @@ export class RequestHeadersComponent extends HTMLElement {
|
|
350
358
|
} else {
|
351
359
|
cautionText = i18nString(UIStrings.provisionalHeadersAreShown);
|
352
360
|
}
|
361
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
362
|
+
// clang-format off
|
353
363
|
return html`
|
354
364
|
<div class="call-to-action">
|
355
365
|
<div class="call-to-action-body">
|
356
366
|
<div class="explanation" title=${cautionTitle}>
|
357
367
|
<${IconButton.Icon.Icon.litTagName} class="inline-icon" .data=${{
|
358
|
-
|
359
|
-
|
360
|
-
|
368
|
+
iconName: 'clear-warning_icon',
|
369
|
+
width: '12px',
|
370
|
+
height: '12px',
|
361
371
|
} as IconButton.Icon.IconData}>
|
362
372
|
</${IconButton.Icon.Icon.litTagName}>
|
363
373
|
${cautionText} <x-link href="https://developer.chrome.com/docs/devtools/network/reference/#provisional-headers" class="link">${i18nString(UIStrings.learnMore)}</x-link>
|
@@ -365,6 +375,7 @@ export class RequestHeadersComponent extends HTMLElement {
|
|
365
375
|
</div>
|
366
376
|
</div>
|
367
377
|
`;
|
378
|
+
// clang-format on
|
368
379
|
}
|
369
380
|
|
370
381
|
#renderHeader(header: HeaderDescriptor): LitHtml.TemplateResult {
|
@@ -373,13 +384,15 @@ export class RequestHeadersComponent extends HTMLElement {
|
|
373
384
|
return html`
|
374
385
|
<div class="row">
|
375
386
|
<div class="header-name">
|
376
|
-
${header.headerNotSet ?
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
` : ''}${header.name}:
|
387
|
+
${header.headerNotSet ?
|
388
|
+
html`<div class="header-badge header-badge-text">${i18n.i18n.lockedString('not-set')}</div>` :
|
389
|
+
LitHtml.nothing
|
390
|
+
}${header.name}:
|
381
391
|
</div>
|
382
|
-
<div
|
392
|
+
<div
|
393
|
+
class="header-value ${header.headerValueIncorrect ? 'header-warning' : ''}"
|
394
|
+
@copy=${():void => Host.userMetrics.actionTaken(Host.UserMetrics.Action.NetworkPanelCopyValue)}
|
395
|
+
>
|
383
396
|
${header.value?.toString() || ''}
|
384
397
|
${this.#maybeRenderHeaderValueSuffix(header)}
|
385
398
|
</div>
|
@@ -399,10 +412,10 @@ export class RequestHeadersComponent extends HTMLElement {
|
|
399
412
|
// clang-format off
|
400
413
|
return html`
|
401
414
|
<${IconButton.Icon.Icon.litTagName} class="inline-icon" title=${titleText} .data=${{
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
415
|
+
iconName: 'clear-warning_icon',
|
416
|
+
width: '12px',
|
417
|
+
height: '12px',
|
418
|
+
} as IconButton.Icon.IconData}>
|
406
419
|
</${IconButton.Icon.Icon.litTagName}>
|
407
420
|
`;
|
408
421
|
// clang-format on
|
@@ -533,8 +546,10 @@ export class RequestHeadersComponent extends HTMLElement {
|
|
533
546
|
`;
|
534
547
|
}
|
535
548
|
|
536
|
-
#renderGeneralSection(): LitHtml.
|
537
|
-
|
549
|
+
#renderGeneralSection(): LitHtml.LitTemplate {
|
550
|
+
if (!this.#request) {
|
551
|
+
return LitHtml.nothing;
|
552
|
+
}
|
538
553
|
|
539
554
|
let coloredCircleClassName = 'red-circle';
|
540
555
|
if (this.#request.statusCode < 300 || this.#request.statusCode === 304) {
|
@@ -574,28 +589,43 @@ export class RequestHeadersComponent extends HTMLElement {
|
|
574
589
|
>
|
575
590
|
<div class="row">
|
576
591
|
<div class="header-name">${i18nString(UIStrings.requestUrl)}:</div>
|
577
|
-
<div
|
592
|
+
<div
|
593
|
+
class="header-value"
|
594
|
+
@copy=${():void => Host.userMetrics.actionTaken(Host.UserMetrics.Action.NetworkPanelCopyValue)}
|
595
|
+
>${this.#request.url()}</div>
|
578
596
|
</div>
|
579
597
|
${this.#request.statusCode? html`
|
580
598
|
<div class="row">
|
581
599
|
<div class="header-name">${i18nString(UIStrings.requestMethod)}:</div>
|
582
|
-
<div
|
600
|
+
<div
|
601
|
+
class="header-value"
|
602
|
+
@copy=${():void => Host.userMetrics.actionTaken(Host.UserMetrics.Action.NetworkPanelCopyValue)}
|
603
|
+
>${this.#request.requestMethod}</div>
|
583
604
|
</div>
|
584
605
|
<div class="row">
|
585
606
|
<div class="header-name">${i18nString(UIStrings.statusCode)}:</div>
|
586
|
-
<div
|
607
|
+
<div
|
608
|
+
class="header-value ${coloredCircleClassName} ${statusTextHasComment ? 'status-with-comment' : ''}"
|
609
|
+
@copy=${():void => Host.userMetrics.actionTaken(Host.UserMetrics.Action.NetworkPanelCopyValue)}
|
610
|
+
>${statusText}</div>
|
587
611
|
</div>
|
588
612
|
` : ''}
|
589
613
|
${this.#request.remoteAddress()? html`
|
590
614
|
<div class="row">
|
591
615
|
<div class="header-name">${i18nString(UIStrings.remoteAddress)}:</div>
|
592
|
-
<div
|
616
|
+
<div
|
617
|
+
class="header-value"
|
618
|
+
@copy=${():void => Host.userMetrics.actionTaken(Host.UserMetrics.Action.NetworkPanelCopyValue)}
|
619
|
+
>${this.#request.remoteAddress()}</div>
|
593
620
|
</div>
|
594
621
|
` : ''}
|
595
622
|
${this.#request.referrerPolicy()? html`
|
596
623
|
<div class="row">
|
597
624
|
<div class="header-name">${i18nString(UIStrings.referrerPolicy)}:</div>
|
598
|
-
<div
|
625
|
+
<div
|
626
|
+
class="header-value"
|
627
|
+
@copy=${():void => Host.userMetrics.actionTaken(Host.UserMetrics.Action.NetworkPanelCopyValue)}
|
628
|
+
>${this.#request.referrerPolicy()}</div>
|
599
629
|
</div>
|
600
630
|
` : ''}
|
601
631
|
</${Category.litTagName}>
|
@@ -108,6 +108,11 @@ const UIStrings = {
|
|
108
108
|
*@description Title of a setting under the Network category that can be invoked through the Command Menu
|
109
109
|
*/
|
110
110
|
dontGroupNetworkLogItemsByFrame: 'Don\'t group network log items by frame',
|
111
|
+
/**
|
112
|
+
* @description Label of a checkbox in the DevTools settings UI.
|
113
|
+
*/
|
114
|
+
enableUNCLoading:
|
115
|
+
'Allow `DevTools` to load resources, such as source maps, from Windows Shares via `UNC` paths. Disabled by default for security reasons.',
|
111
116
|
};
|
112
117
|
const str_ = i18n.i18n.registerUIStrings('panels/network/network-meta.ts', UIStrings);
|
113
118
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
@@ -316,6 +321,17 @@ Common.Settings.registerSettingExtension({
|
|
316
321
|
],
|
317
322
|
});
|
318
323
|
|
324
|
+
// While this setting is used by the Network module, we place it under the
|
325
|
+
// "sources" category as source map loading is the dominant use case.
|
326
|
+
Common.Settings.registerSettingExtension({
|
327
|
+
category: Common.Settings.SettingCategory.SOURCES,
|
328
|
+
storageType: Common.Settings.SettingStorageType.Synced,
|
329
|
+
title: i18nLazyString(UIStrings.enableUNCLoading),
|
330
|
+
settingName: 'network.enable-unc-loading',
|
331
|
+
settingType: Common.Settings.SettingType.BOOLEAN,
|
332
|
+
defaultValue: false,
|
333
|
+
});
|
334
|
+
|
319
335
|
UI.ViewManager.registerLocationResolver({
|
320
336
|
name: UI.ViewManager.ViewLocationValues.NETWORK_SIDEBAR,
|
321
337
|
category: UI.ViewManager.ViewLocationCategoryValues.NETWORK,
|