chrome-devtools-frontend 1.0.975699 → 1.0.976703
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUTHORS +1 -0
- package/config/gni/devtools_grd_files.gni +8 -0
- package/config/gni/devtools_image_files.gni +2 -0
- package/front_end/Images/src/minus_icon.svg +3 -0
- package/front_end/Images/src/plus_icon.svg +3 -0
- package/front_end/core/host/UserMetrics.ts +23 -23
- package/front_end/core/i18n/locales/en-US.json +6 -0
- package/front_end/core/i18n/locales/en-XL.json +6 -0
- package/front_end/core/sdk/CSSContainerQuery.ts +1 -1
- package/front_end/core/sdk/CSSModel.ts +13 -9
- package/front_end/generated/InspectorBackendCommands.js +7 -6
- package/front_end/generated/protocol.ts +11 -9
- package/front_end/models/issues_manager/Issue.ts +1 -1
- package/front_end/models/issues_manager/IssuesManager.ts +3 -9
- package/front_end/models/issues_manager/SameSiteCookieIssue.ts +74 -78
- package/front_end/models/issues_manager/issues_manager.ts +2 -2
- package/front_end/models/persistence/NetworkPersistenceManager.ts +1 -1
- package/front_end/panels/elements/ClassesPaneWidget.ts +1 -1
- package/front_end/panels/elements/ComputedStyleModel.ts +1 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +1 -1
- package/front_end/panels/elements/LayersWidget.ts +4 -3
- package/front_end/panels/elements/MetricsSidebarPane.ts +2 -2
- package/front_end/panels/elements/PlatformFontsWidget.ts +1 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +1 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +10 -8
- package/front_end/panels/emulation/MediaQueryInspector.ts +1 -1
- package/front_end/panels/issues/IssueView.ts +1 -1
- package/front_end/panels/issues/IssuesPane.ts +1 -1
- package/front_end/panels/network/NetworkLogView.ts +1 -1
- package/front_end/panels/settings/components/SyncSection.ts +5 -17
- package/front_end/panels/sources/CSSPlugin.ts +77 -22
- package/front_end/panels/sources/SourcesView.ts +23 -10
- package/front_end/panels/sources/components/HeadersView.css +32 -0
- package/front_end/panels/sources/components/HeadersView.ts +89 -0
- package/front_end/panels/sources/components/components.ts +9 -0
- package/front_end/ui/components/chrome_link/ChromeLink.ts +62 -0
- package/front_end/ui/components/chrome_link/chromeLink.css +12 -0
- package/front_end/ui/components/chrome_link/chrome_link.ts +9 -0
- package/package.json +1 -1
@@ -37,12 +37,11 @@ const UIStrings = {
|
|
37
37
|
const str_ = i18n.i18n.registerUIStrings('models/issues_manager/SameSiteCookieIssue.ts', UIStrings);
|
38
38
|
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
39
39
|
|
40
|
-
export class
|
41
|
-
#issueDetails: Protocol.Audits.
|
40
|
+
export class CookieIssue extends Issue {
|
41
|
+
#issueDetails: Protocol.Audits.CookieIssueDetails;
|
42
42
|
|
43
43
|
constructor(
|
44
|
-
code: string, issueDetails: Protocol.Audits.
|
45
|
-
issuesModel: SDK.IssuesModel.IssuesModel) {
|
44
|
+
code: string, issueDetails: Protocol.Audits.CookieIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel) {
|
46
45
|
super(code, issuesModel);
|
47
46
|
this.#issueDetails = issueDetails;
|
48
47
|
}
|
@@ -62,35 +61,34 @@ export class SameSiteCookieIssue extends Issue {
|
|
62
61
|
}
|
63
62
|
|
64
63
|
/**
|
65
|
-
* Returns an array of issues from a given
|
64
|
+
* Returns an array of issues from a given CookieIssueDetails.
|
66
65
|
*/
|
67
|
-
static
|
68
|
-
|
69
|
-
|
70
|
-
const issues: SameSiteCookieIssue[] = [];
|
66
|
+
static createIssuesFromCookieIssueDetails(
|
67
|
+
cookieIssueDetails: Protocol.Audits.CookieIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel): CookieIssue[] {
|
68
|
+
const issues: CookieIssue[] = [];
|
71
69
|
|
72
70
|
// Exclusion reasons have priority. It means a cookie was blocked. Create an issue
|
73
71
|
// for every exclusion reason but ignore warning reasons if the cookie was blocked.
|
74
72
|
// Some exclusion reasons are dependent on warning reasons existing in order to produce an issue.
|
75
|
-
if (
|
76
|
-
for (const exclusionReason of
|
77
|
-
const code =
|
78
|
-
exclusionReason,
|
79
|
-
|
73
|
+
if (cookieIssueDetails.cookieExclusionReasons && cookieIssueDetails.cookieExclusionReasons.length > 0) {
|
74
|
+
for (const exclusionReason of cookieIssueDetails.cookieExclusionReasons) {
|
75
|
+
const code = CookieIssue.codeForCookieIssueDetails(
|
76
|
+
exclusionReason, cookieIssueDetails.cookieWarningReasons, cookieIssueDetails.operation,
|
77
|
+
cookieIssueDetails.cookieUrl);
|
80
78
|
if (code) {
|
81
|
-
issues.push(new
|
79
|
+
issues.push(new CookieIssue(code, cookieIssueDetails, issuesModel));
|
82
80
|
}
|
83
81
|
}
|
84
82
|
return issues;
|
85
83
|
}
|
86
84
|
|
87
|
-
if (
|
88
|
-
for (const warningReason of
|
85
|
+
if (cookieIssueDetails.cookieWarningReasons) {
|
86
|
+
for (const warningReason of cookieIssueDetails.cookieWarningReasons) {
|
89
87
|
// warningReasons should be an empty array here.
|
90
|
-
const code =
|
91
|
-
warningReason, [],
|
88
|
+
const code = CookieIssue.codeForCookieIssueDetails(
|
89
|
+
warningReason, [], cookieIssueDetails.operation, cookieIssueDetails.cookieUrl);
|
92
90
|
if (code) {
|
93
|
-
issues.push(new
|
91
|
+
issues.push(new CookieIssue(code, cookieIssueDetails, issuesModel));
|
94
92
|
}
|
95
93
|
}
|
96
94
|
}
|
@@ -99,36 +97,35 @@ export class SameSiteCookieIssue extends Issue {
|
|
99
97
|
|
100
98
|
/**
|
101
99
|
* Calculates an issue code from a reason, an operation, and an array of warningReasons. All these together
|
102
|
-
* can uniquely identify a specific
|
103
|
-
* warningReasons is only needed for some
|
104
|
-
* It is not required if reason is a
|
100
|
+
* can uniquely identify a specific cookie issue.
|
101
|
+
* warningReasons is only needed for some CookieExclusionReason in order to determine if an issue should be raised.
|
102
|
+
* It is not required if reason is a CookieWarningReason.
|
105
103
|
*/
|
106
|
-
static
|
107
|
-
reason: Protocol.Audits.
|
108
|
-
warningReasons: Protocol.Audits.
|
104
|
+
static codeForCookieIssueDetails(
|
105
|
+
reason: Protocol.Audits.CookieExclusionReason|Protocol.Audits.CookieWarningReason,
|
106
|
+
warningReasons: Protocol.Audits.CookieWarningReason[], operation: Protocol.Audits.CookieOperation,
|
109
107
|
cookieUrl?: string): string|null {
|
110
108
|
const isURLSecure = cookieUrl && (cookieUrl.startsWith('https://') || cookieUrl.startsWith('wss://'));
|
111
109
|
const secure = isURLSecure ? 'Secure' : 'Insecure';
|
112
110
|
|
113
|
-
if (reason === Protocol.Audits.
|
114
|
-
reason === Protocol.Audits.
|
115
|
-
reason === Protocol.Audits.
|
111
|
+
if (reason === Protocol.Audits.CookieExclusionReason.ExcludeSameSiteStrict ||
|
112
|
+
reason === Protocol.Audits.CookieExclusionReason.ExcludeSameSiteLax ||
|
113
|
+
reason === Protocol.Audits.CookieExclusionReason.ExcludeSameSiteUnspecifiedTreatedAsLax) {
|
116
114
|
if (warningReasons && warningReasons.length > 0) {
|
117
|
-
if (warningReasons.includes(Protocol.Audits.
|
115
|
+
if (warningReasons.includes(Protocol.Audits.CookieWarningReason.WarnSameSiteStrictLaxDowngradeStrict)) {
|
118
116
|
return [
|
119
|
-
Protocol.Audits.InspectorIssueCode.
|
117
|
+
Protocol.Audits.InspectorIssueCode.CookieIssue,
|
120
118
|
'ExcludeNavigationContextDowngrade',
|
121
119
|
secure,
|
122
120
|
].join('::');
|
123
121
|
}
|
124
122
|
|
125
|
-
if (warningReasons.includes(
|
126
|
-
|
127
|
-
warningReasons.includes(Protocol.Audits.
|
128
|
-
warningReasons.includes(Protocol.Audits.
|
129
|
-
warningReasons.includes(Protocol.Audits.SameSiteCookieWarningReason.WarnSameSiteLaxCrossDowngradeLax)) {
|
123
|
+
if (warningReasons.includes(Protocol.Audits.CookieWarningReason.WarnSameSiteStrictCrossDowngradeStrict) ||
|
124
|
+
warningReasons.includes(Protocol.Audits.CookieWarningReason.WarnSameSiteStrictCrossDowngradeLax) ||
|
125
|
+
warningReasons.includes(Protocol.Audits.CookieWarningReason.WarnSameSiteLaxCrossDowngradeStrict) ||
|
126
|
+
warningReasons.includes(Protocol.Audits.CookieWarningReason.WarnSameSiteLaxCrossDowngradeLax)) {
|
130
127
|
return [
|
131
|
-
Protocol.Audits.InspectorIssueCode.
|
128
|
+
Protocol.Audits.InspectorIssueCode.CookieIssue,
|
132
129
|
'ExcludeContextDowngrade',
|
133
130
|
operation,
|
134
131
|
secure,
|
@@ -138,8 +135,8 @@ export class SameSiteCookieIssue extends Issue {
|
|
138
135
|
|
139
136
|
// If we have ExcludeSameSiteUnspecifiedTreatedAsLax but no corresponding warnings, then add just
|
140
137
|
// the Issue code for ExcludeSameSiteUnspecifiedTreatedAsLax.
|
141
|
-
if (reason === Protocol.Audits.
|
142
|
-
return [Protocol.Audits.InspectorIssueCode.
|
138
|
+
if (reason === Protocol.Audits.CookieExclusionReason.ExcludeSameSiteUnspecifiedTreatedAsLax) {
|
139
|
+
return [Protocol.Audits.InspectorIssueCode.CookieIssue, reason, operation].join('::');
|
143
140
|
}
|
144
141
|
|
145
142
|
// ExcludeSameSiteStrict and ExcludeSameSiteLax require being paired with an appropriate warning. We didn't
|
@@ -147,18 +144,17 @@ export class SameSiteCookieIssue extends Issue {
|
|
147
144
|
return null;
|
148
145
|
}
|
149
146
|
|
150
|
-
if (reason === Protocol.Audits.
|
151
|
-
return [Protocol.Audits.InspectorIssueCode.
|
147
|
+
if (reason === Protocol.Audits.CookieWarningReason.WarnSameSiteStrictLaxDowngradeStrict) {
|
148
|
+
return [Protocol.Audits.InspectorIssueCode.CookieIssue, reason, secure].join('::');
|
152
149
|
}
|
153
150
|
// These have the same message.
|
154
|
-
if (reason === Protocol.Audits.
|
155
|
-
reason === Protocol.Audits.
|
156
|
-
reason === Protocol.Audits.
|
157
|
-
reason === Protocol.Audits.
|
158
|
-
return [Protocol.Audits.InspectorIssueCode.
|
159
|
-
'::');
|
151
|
+
if (reason === Protocol.Audits.CookieWarningReason.WarnSameSiteStrictCrossDowngradeStrict ||
|
152
|
+
reason === Protocol.Audits.CookieWarningReason.WarnSameSiteStrictCrossDowngradeLax ||
|
153
|
+
reason === Protocol.Audits.CookieWarningReason.WarnSameSiteLaxCrossDowngradeLax ||
|
154
|
+
reason === Protocol.Audits.CookieWarningReason.WarnSameSiteLaxCrossDowngradeStrict) {
|
155
|
+
return [Protocol.Audits.InspectorIssueCode.CookieIssue, 'WarnCrossDowngrade', operation, secure].join('::');
|
160
156
|
}
|
161
|
-
return [Protocol.Audits.InspectorIssueCode.
|
157
|
+
return [Protocol.Audits.InspectorIssueCode.CookieIssue, reason, operation].join('::');
|
162
158
|
}
|
163
159
|
|
164
160
|
cookies(): Iterable<Protocol.Audits.AffectedCookie> {
|
@@ -183,7 +179,7 @@ export class SameSiteCookieIssue extends Issue {
|
|
183
179
|
}
|
184
180
|
|
185
181
|
getCategory(): IssueCategory {
|
186
|
-
return IssueCategory.
|
182
|
+
return IssueCategory.Cookie;
|
187
183
|
}
|
188
184
|
|
189
185
|
getDescription(): MarkdownIssueDescription|null {
|
@@ -207,14 +203,14 @@ export class SameSiteCookieIssue extends Issue {
|
|
207
203
|
}
|
208
204
|
|
209
205
|
static fromInspectorIssue(issuesModel: SDK.IssuesModel.IssuesModel, inspectorIssue: Protocol.Audits.InspectorIssue):
|
210
|
-
|
211
|
-
const
|
212
|
-
if (!
|
213
|
-
console.warn('
|
206
|
+
CookieIssue[] {
|
207
|
+
const cookieIssueDetails = inspectorIssue.details.cookieIssueDetails;
|
208
|
+
if (!cookieIssueDetails) {
|
209
|
+
console.warn('Cookie issue without details received.');
|
214
210
|
return [];
|
215
211
|
}
|
216
212
|
|
217
|
-
return
|
213
|
+
return CookieIssue.createIssuesFromCookieIssueDetails(cookieIssueDetails, issuesModel);
|
218
214
|
}
|
219
215
|
}
|
220
216
|
|
@@ -431,32 +427,32 @@ const samePartyCrossPartyContextSet: LazyMarkdownIssueDescription = {
|
|
431
427
|
};
|
432
428
|
|
433
429
|
const issueDescriptions: Map<string, LazyMarkdownIssueDescription> = new Map([
|
434
|
-
['
|
435
|
-
['
|
430
|
+
['CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::ReadCookie', sameSiteUnspecifiedErrorRead],
|
431
|
+
['CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::SetCookie', sameSiteUnspecifiedErrorSet],
|
436
432
|
// These two don't have a deprecation date yet, but they need to be fixed eventually.
|
437
|
-
['
|
438
|
-
['
|
439
|
-
['
|
440
|
-
['
|
441
|
-
['
|
442
|
-
['
|
443
|
-
['
|
444
|
-
['
|
445
|
-
['
|
446
|
-
['
|
447
|
-
['
|
448
|
-
['
|
449
|
-
['
|
450
|
-
['
|
451
|
-
['
|
433
|
+
['CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::ReadCookie', sameSiteUnspecifiedWarnRead],
|
434
|
+
['CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::SetCookie', sameSiteUnspecifiedWarnSet],
|
435
|
+
['CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::ReadCookie', sameSiteUnspecifiedWarnRead],
|
436
|
+
['CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::SetCookie', sameSiteUnspecifiedWarnSet],
|
437
|
+
['CookieIssue::ExcludeSameSiteNoneInsecure::ReadCookie', sameSiteNoneInsecureErrorRead],
|
438
|
+
['CookieIssue::ExcludeSameSiteNoneInsecure::SetCookie', sameSiteNoneInsecureErrorSet],
|
439
|
+
['CookieIssue::WarnSameSiteNoneInsecure::ReadCookie', sameSiteNoneInsecureWarnRead],
|
440
|
+
['CookieIssue::WarnSameSiteNoneInsecure::SetCookie', sameSiteNoneInsecureWarnSet],
|
441
|
+
['CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Secure', sameSiteWarnStrictLaxDowngradeStrict(true)],
|
442
|
+
['CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Insecure', sameSiteWarnStrictLaxDowngradeStrict(false)],
|
443
|
+
['CookieIssue::WarnCrossDowngrade::ReadCookie::Secure', sameSiteWarnCrossDowngradeRead(true)],
|
444
|
+
['CookieIssue::WarnCrossDowngrade::ReadCookie::Insecure', sameSiteWarnCrossDowngradeRead(false)],
|
445
|
+
['CookieIssue::WarnCrossDowngrade::SetCookie::Secure', sameSiteWarnCrossDowngradeSet(true)],
|
446
|
+
['CookieIssue::WarnCrossDowngrade::SetCookie::Insecure', sameSiteWarnCrossDowngradeSet(false)],
|
447
|
+
['CookieIssue::ExcludeNavigationContextDowngrade::Secure', sameSiteExcludeNavigationContextDowngrade(true)],
|
452
448
|
[
|
453
|
-
'
|
449
|
+
'CookieIssue::ExcludeNavigationContextDowngrade::Insecure',
|
454
450
|
sameSiteExcludeNavigationContextDowngrade(false),
|
455
451
|
],
|
456
|
-
['
|
457
|
-
['
|
458
|
-
['
|
459
|
-
['
|
460
|
-
['
|
461
|
-
['
|
452
|
+
['CookieIssue::ExcludeContextDowngrade::ReadCookie::Secure', sameSiteExcludeContextDowngradeRead(true)],
|
453
|
+
['CookieIssue::ExcludeContextDowngrade::ReadCookie::Insecure', sameSiteExcludeContextDowngradeRead(false)],
|
454
|
+
['CookieIssue::ExcludeContextDowngrade::SetCookie::Secure', sameSiteExcludeContextDowngradeSet(true)],
|
455
|
+
['CookieIssue::ExcludeContextDowngrade::SetCookie::Insecure', sameSiteExcludeContextDowngradeSet(false)],
|
456
|
+
['CookieIssue::ExcludeInvalidSameParty::SetCookie', sameSiteInvalidSameParty],
|
457
|
+
['CookieIssue::ExcludeSamePartyCrossPartyContext::SetCookie', samePartyCrossPartyContextSet],
|
462
458
|
]);
|
@@ -20,7 +20,7 @@ import * as MixedContentIssue from './MixedContentIssue.js';
|
|
20
20
|
import * as NavigatorUserAgentIssue from './NavigatorUserAgentIssue.js';
|
21
21
|
import * as QuirksModeIssue from './QuirksModeIssue.js';
|
22
22
|
import * as RelatedIssue from './RelatedIssue.js';
|
23
|
-
import * as
|
23
|
+
import * as CookieIssue from './SameSiteCookieIssue.js';
|
24
24
|
import * as SharedArrayBufferIssue from './SharedArrayBufferIssue.js';
|
25
25
|
import * as SourceFrameIssuesManager from './SourceFrameIssuesManager.js';
|
26
26
|
import * as TrustedWebActivityIssue from './TrustedWebActivityIssue.js';
|
@@ -30,6 +30,7 @@ export {
|
|
30
30
|
ClientHintIssue,
|
31
31
|
ContentSecurityPolicyIssue,
|
32
32
|
ContrastCheckTrigger,
|
33
|
+
CookieIssue,
|
33
34
|
CorsIssue,
|
34
35
|
CrossOriginEmbedderPolicyIssue,
|
35
36
|
DeprecationIssue,
|
@@ -44,7 +45,6 @@ export {
|
|
44
45
|
NavigatorUserAgentIssue,
|
45
46
|
QuirksModeIssue,
|
46
47
|
RelatedIssue,
|
47
|
-
SameSiteCookieIssue,
|
48
48
|
SharedArrayBufferIssue,
|
49
49
|
SourceFrameIssuesManager,
|
50
50
|
TrustedWebActivityIssue,
|
@@ -421,7 +421,7 @@ export class NetworkPersistenceManager extends Common.ObjectWrapper.ObjectWrappe
|
|
421
421
|
await this.#innerUpdateInterceptionPatterns();
|
422
422
|
}
|
423
423
|
|
424
|
-
|
424
|
+
updateInterceptionPatterns(): void {
|
425
425
|
void this.updateInterceptionThrottler.schedule(this.#innerUpdateInterceptionPatterns.bind(this));
|
426
426
|
}
|
427
427
|
|
@@ -313,7 +313,7 @@ export class ClassNamePrompt extends UI.TextPrompt.TextPrompt {
|
|
313
313
|
if (stylesheet.frameId !== this.selectedFrameId) {
|
314
314
|
continue;
|
315
315
|
}
|
316
|
-
const cssPromise = cssModel.
|
316
|
+
const cssPromise = cssModel.getClassNames(stylesheet.id).then(classes => {
|
317
317
|
for (const className of classes) {
|
318
318
|
completions.add(className);
|
319
319
|
}
|
@@ -106,7 +106,7 @@ export class ComputedStyleModel extends Common.ObjectWrapper.ObjectWrapper<Event
|
|
106
106
|
}
|
107
107
|
|
108
108
|
if (!this.computedStylePromise) {
|
109
|
-
this.computedStylePromise = cssModel.
|
109
|
+
this.computedStylePromise = cssModel.getComputedStyle(nodeId).then(verifyOutdated.bind(this, elementNode));
|
110
110
|
}
|
111
111
|
|
112
112
|
return this.computedStylePromise;
|
@@ -1996,7 +1996,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
1996
1996
|
return;
|
1997
1997
|
}
|
1998
1998
|
|
1999
|
-
const styles = await node.domModel().cssModel().
|
1999
|
+
const styles = await node.domModel().cssModel().getComputedStyle(nodeId);
|
2000
2000
|
for (const styleAdorner of this.styleAdorners) {
|
2001
2001
|
this.removeAdorner(styleAdorner);
|
2002
2002
|
}
|
@@ -84,8 +84,9 @@ export class LayersWidget extends UI.Widget.Widget {
|
|
84
84
|
const makeTreeNode = (parentId: string) =>
|
85
85
|
(layer: Protocol.CSS.CSSLayerData): TreeOutline.TreeOutlineUtils.TreeNode<string> => {
|
86
86
|
const subLayers = layer.subLayers;
|
87
|
-
const
|
88
|
-
const
|
87
|
+
const name = SDK.CSSModel.CSSModel.readableLayerName(layer.name);
|
88
|
+
const treeNodeData = layer.order + ': ' + name;
|
89
|
+
const id = parentId ? parentId + '.' + name : name;
|
89
90
|
if (!subLayers) {
|
90
91
|
return {treeNodeData, id};
|
91
92
|
}
|
@@ -96,7 +97,7 @@ export class LayersWidget extends UI.Widget.Widget {
|
|
96
97
|
Promise.resolve(subLayers.sort((layer1, layer2) => layer1.order - layer2.order).map(makeTreeNode(id))),
|
97
98
|
};
|
98
99
|
};
|
99
|
-
const rootLayer = await this.cssModel.
|
100
|
+
const rootLayer = await this.cssModel.getRootLayer(node.id);
|
100
101
|
this.layerTreeComponent.data = {
|
101
102
|
defaultRenderer: TreeOutline.TreeOutline.defaultRenderer,
|
102
103
|
tree: [makeTreeNode('')(rootLayer)],
|
@@ -88,8 +88,8 @@ export class MetricsSidebarPane extends ElementsSidebarPane {
|
|
88
88
|
}
|
89
89
|
|
90
90
|
const promises = [
|
91
|
-
cssModel.
|
92
|
-
cssModel.
|
91
|
+
cssModel.getComputedStyle(node.id).then(callback.bind(this)),
|
92
|
+
cssModel.getInlineStyles(node.id).then(inlineStyleResult => {
|
93
93
|
if (inlineStyleResult && this.node() === node) {
|
94
94
|
this.inlineStyle = inlineStyleResult.inlineStyle;
|
95
95
|
}
|
@@ -88,7 +88,7 @@ export class PlatformFontsWidget extends UI.ThrottledWidget.ThrottledWidget {
|
|
88
88
|
return Promise.resolve();
|
89
89
|
}
|
90
90
|
|
91
|
-
return cssModel.
|
91
|
+
return cssModel.getPlatformFonts(node.id).then(this.refreshUI.bind(this, node));
|
92
92
|
}
|
93
93
|
|
94
94
|
private refreshUI(node: SDK.DOMModel.DOMNode, platformFonts: Protocol.CSS.PlatformFontUsage[]|null): void {
|
@@ -278,7 +278,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
278
278
|
const cssModel = this.parentPaneInternal.cssModel();
|
279
279
|
const node = this.node();
|
280
280
|
if (cssModel && node && typeof node.id !== 'undefined') {
|
281
|
-
const contrastInfo = new ColorPicker.ContrastInfo.ContrastInfo(await cssModel.
|
281
|
+
const contrastInfo = new ColorPicker.ContrastInfo.ContrastInfo(await cssModel.getBackgroundColors(node.id));
|
282
282
|
swatchIcon.setContrastInfo(contrastInfo);
|
283
283
|
}
|
284
284
|
}
|
@@ -875,7 +875,7 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
|
|
875
875
|
if (parentRule instanceof SDK.CSSRule.CSSStyleRule) {
|
876
876
|
const layers = parentRule.layers;
|
877
877
|
if ((layers.length || lastLayers) && lastLayers !== layers) {
|
878
|
-
const block = SectionBlock.createLayerBlock(
|
878
|
+
const block = SectionBlock.createLayerBlock(parentRule);
|
879
879
|
blocks.push(block);
|
880
880
|
sawLayers = true;
|
881
881
|
lastLayers = layers;
|
@@ -1430,18 +1430,21 @@ export class SectionBlock {
|
|
1430
1430
|
return new SectionBlock(separatorElement);
|
1431
1431
|
}
|
1432
1432
|
|
1433
|
-
static createLayerBlock(
|
1433
|
+
static createLayerBlock(rule: SDK.CSSRule.CSSStyleRule): SectionBlock {
|
1434
1434
|
const separatorElement = document.createElement('div');
|
1435
1435
|
separatorElement.className = 'sidebar-separator layer-separator';
|
1436
1436
|
UI.UIUtils.createTextChild(separatorElement.createChild('div'), i18nString(UIStrings.layer));
|
1437
|
-
|
1438
|
-
|
1437
|
+
const layers = rule.layers;
|
1438
|
+
if (!layers.length && rule.origin === Protocol.CSS.StyleSheetOrigin.UserAgent) {
|
1439
|
+
const name = rule.origin === Protocol.CSS.StyleSheetOrigin.UserAgent ? '\xa0user\xa0agent\xa0stylesheet' :
|
1440
|
+
'\xa0implicit\xa0outer\xa0layer';
|
1441
|
+
UI.UIUtils.createTextChild(separatorElement.createChild('div'), name);
|
1439
1442
|
return new SectionBlock(separatorElement);
|
1440
1443
|
}
|
1441
1444
|
const layerLink = separatorElement.createChild('button') as HTMLButtonElement;
|
1442
1445
|
layerLink.className = 'link';
|
1443
1446
|
layerLink.title = i18nString(UIStrings.clickToRevealLayer);
|
1444
|
-
const name = layers.map(layer => layer.text
|
1447
|
+
const name = layers.map(layer => SDK.CSSModel.CSSModel.readableLayerName(layer.text)).join('.');
|
1445
1448
|
layerLink.textContent = name;
|
1446
1449
|
layerLink.onclick = (): Promise<void> => LayersWidget.LayersWidget.instance().revealLayer(name);
|
1447
1450
|
return new SectionBlock(separatorElement);
|
@@ -3192,13 +3195,12 @@ export class CSSPropertyPrompt extends UI.TextPrompt.TextPrompt {
|
|
3192
3195
|
if (!node || this.selectedNodeComputedStyles) {
|
3193
3196
|
return;
|
3194
3197
|
}
|
3195
|
-
this.selectedNodeComputedStyles = await node.domModel().cssModel().
|
3198
|
+
this.selectedNodeComputedStyles = await node.domModel().cssModel().getComputedStyle(node.id);
|
3196
3199
|
const parentNode = node.parentNode;
|
3197
3200
|
if (parentNode) {
|
3198
|
-
this.parentNodeComputedStyles = await parentNode.domModel().cssModel().
|
3201
|
+
this.parentNodeComputedStyles = await parentNode.domModel().cssModel().getComputedStyle(parentNode.id);
|
3199
3202
|
}
|
3200
3203
|
};
|
3201
|
-
|
3202
3204
|
for (const result of results) {
|
3203
3205
|
await ensureComputedStyles();
|
3204
3206
|
// Using parent node's computed styles does not work in all cases. For example:
|
@@ -165,7 +165,7 @@ export class MediaQueryInspector extends UI.Widget.Widget implements
|
|
165
165
|
return Promise.resolve();
|
166
166
|
}
|
167
167
|
|
168
|
-
return this.cssModel.
|
168
|
+
return this.cssModel.getMediaQueries().then(this.rebuildMediaQueries.bind(this));
|
169
169
|
}
|
170
170
|
|
171
171
|
private squashAdjacentEqual(models: MediaQueryUIModel[]): MediaQueryUIModel[] {
|
@@ -131,7 +131,7 @@ class AffectedRequestsView extends AffectedResourcesView {
|
|
131
131
|
const issueTypeToNetworkHeaderMap =
|
132
132
|
new Map<IssuesManager.Issue.IssueCategory, NetworkForward.UIRequestLocation.UIRequestTabs>([
|
133
133
|
[
|
134
|
-
IssuesManager.Issue.IssueCategory.
|
134
|
+
IssuesManager.Issue.IssueCategory.Cookie,
|
135
135
|
NetworkForward.UIRequestLocation.UIRequestTabs.Cookies,
|
136
136
|
],
|
137
137
|
[
|
@@ -127,7 +127,7 @@ class IssueCategoryView extends UI.TreeOutline.TreeElement {
|
|
127
127
|
return i18nString(UIStrings.crossOriginEmbedderPolicy);
|
128
128
|
case IssuesManager.Issue.IssueCategory.MixedContent:
|
129
129
|
return i18nString(UIStrings.mixedContent);
|
130
|
-
case IssuesManager.Issue.IssueCategory.
|
130
|
+
case IssuesManager.Issue.IssueCategory.Cookie:
|
131
131
|
return i18nString(UIStrings.samesiteCookie);
|
132
132
|
case IssuesManager.Issue.IssueCategory.HeavyAd:
|
133
133
|
return i18nString(UIStrings.heavyAds);
|
@@ -1716,7 +1716,7 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
1716
1716
|
return false;
|
1717
1717
|
}
|
1718
1718
|
if (this.onlyIssuesFilterUI.checked() &&
|
1719
|
-
!IssuesManager.RelatedIssue.hasIssueOfCategory(request, IssuesManager.Issue.IssueCategory.
|
1719
|
+
!IssuesManager.RelatedIssue.hasIssueOfCategory(request, IssuesManager.Issue.IssueCategory.Cookie)) {
|
1720
1720
|
return false;
|
1721
1721
|
}
|
1722
1722
|
if (this.onlyBlockedRequestsUI.checked() && !request.wasBlocked() && !request.corsErrorStatus()) {
|
@@ -8,7 +8,7 @@ import type * as Host from '../../../core/host/host.js';
|
|
8
8
|
import * as i18n from '../../../core/i18n/i18n.js';
|
9
9
|
import * as LitHtml from '../../../ui/lit-html/lit-html.js';
|
10
10
|
import * as Settings from '../../../ui/components/settings/settings.js';
|
11
|
-
import * as
|
11
|
+
import * as ChromeLink from '../../../ui/components/chrome_link/chrome_link.js';
|
12
12
|
|
13
13
|
import syncSectionStyles from './syncSection.css.js';
|
14
14
|
|
@@ -92,9 +92,8 @@ function renderAccountInfoOrWarning(syncInfo: Host.InspectorFrontendHostAPI.Sync
|
|
92
92
|
// clang-format off
|
93
93
|
return LitHtml.html`
|
94
94
|
<span class="warning">
|
95
|
-
${i18nString(UIStrings.syncDisabled)}
|
96
|
-
|
97
|
-
@keydown=${(e: Event): void => openSettingsTab(link, e)}>${i18nString(UIStrings.settings)}</x-link>
|
95
|
+
${i18nString(UIStrings.syncDisabled)}
|
96
|
+
<${ChromeLink.ChromeLink.ChromeLink.litTagName} .href=${link}>${i18nString(UIStrings.settings)}</${ChromeLink.ChromeLink.ChromeLink.litTagName}>
|
98
97
|
</span>`;
|
99
98
|
// clang-format on
|
100
99
|
}
|
@@ -104,9 +103,8 @@ function renderAccountInfoOrWarning(syncInfo: Host.InspectorFrontendHostAPI.Sync
|
|
104
103
|
// clang-format off
|
105
104
|
return LitHtml.html`
|
106
105
|
<span class="warning">
|
107
|
-
${i18nString(UIStrings.preferencesSyncDisabled)}
|
108
|
-
|
109
|
-
@keydown=${(e: Event): void => openSettingsTab(link, e)}>${i18nString(UIStrings.settings)}</x-link>
|
106
|
+
${i18nString(UIStrings.preferencesSyncDisabled)}
|
107
|
+
<${ChromeLink.ChromeLink.ChromeLink.litTagName} .href=${link}>${i18nString(UIStrings.settings)}</${ChromeLink.ChromeLink.ChromeLink.litTagName}>
|
110
108
|
</span>`;
|
111
109
|
// clang-format on
|
112
110
|
}
|
@@ -120,16 +118,6 @@ function renderAccountInfoOrWarning(syncInfo: Host.InspectorFrontendHostAPI.Sync
|
|
120
118
|
</div>`;
|
121
119
|
}
|
122
120
|
|
123
|
-
// Navigating to a chrome:// link via a normal anchor doesn't work, so we "navigate"
|
124
|
-
// there using CDP.
|
125
|
-
function openSettingsTab(url: string, event: Event): void {
|
126
|
-
if (event.type === 'click' || (event.type === 'keydown' && self.isEnterOrSpaceKey(event))) {
|
127
|
-
const mainTarget = SDK.TargetManager.TargetManager.instance().mainTarget();
|
128
|
-
mainTarget && mainTarget.targetAgent().invoke_createTarget({url});
|
129
|
-
event.consume(true);
|
130
|
-
}
|
131
|
-
}
|
132
|
-
|
133
121
|
ComponentHelpers.CustomElements.defineComponent('devtools-sync-section', SyncSection);
|
134
122
|
|
135
123
|
declare global {
|