chrome-devtools-frontend 1.0.967135 → 1.0.968254
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 +21 -0
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/i18n/locales/en-US.json +9 -0
- package/front_end/core/i18n/locales/en-XL.json +9 -0
- package/front_end/core/root/Runtime.ts +1 -0
- package/front_end/core/sdk/CSSQuery.ts +1 -1
- package/front_end/core/sdk/CSSRule.ts +6 -6
- package/front_end/core/sdk/CSSSupports.ts +30 -0
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/devtools_compatibility.js +0 -36
- package/front_end/entrypoints/main/MainImpl.ts +4 -0
- package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +265 -0
- package/front_end/models/issues_manager/IssuesManager.ts +5 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsHttpNotFound.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsInvalidResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsNoResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestApprovalDeclined.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestCanceled.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientIdMetadataHttpNotFound.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientIdMetadataInvalidResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientIdMetadataNoResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestErrorFetchingSignin.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestErrorIdToken.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenHttpNotFound.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenInvalidRequest.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenInvalidResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenNoResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestInvalidSigninResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestTooManyRequests.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownHttpNotFound.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownInvalidResponse.md +1 -0
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownNoResponse.md +1 -0
- package/front_end/panels/application/InterestGroupStorageView.ts +21 -7
- package/front_end/panels/application/components/InterestGroupAccessGrid.ts +10 -2
- package/front_end/panels/application/components/interestGroupAccessGrid.css +1 -1
- package/front_end/panels/application/interestGroupStorageView.css +4 -0
- package/front_end/panels/console/ConsoleViewMessage.ts +3 -5
- package/front_end/panels/console/ErrorStackParser.ts +5 -3
- package/front_end/panels/elements/StylesSidebarPane.ts +33 -8
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +6 -3
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
- package/front_end/ui/components/settings/settingCheckbox.css +2 -0
- package/front_end/ui/components/text_editor/config.ts +1 -0
- package/front_end/ui/legacy/components/object_ui/ObjectPopoverHelper.ts +13 -34
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/objectPopover.css +0 -25
- package/package.json +2 -1
- package/scripts/build/tests/plugins_test.js +30 -0
- package/scripts/devtools_paths.js +1 -29
@@ -304,6 +304,25 @@ grd_files_release_sources = [
|
|
304
304
|
"front_end/models/issues_manager/descriptions/cspURLViolation.md",
|
305
305
|
"front_end/models/issues_manager/descriptions/deprecation.md",
|
306
306
|
"front_end/models/issues_manager/descriptions/deprecationNavigatorUserAgent.md",
|
307
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsHttpNotFound.md",
|
308
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsInvalidResponse.md",
|
309
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsNoResponse.md",
|
310
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestApprovalDeclined.md",
|
311
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestCanceled.md",
|
312
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestClientIdMetadataHttpNotFound.md",
|
313
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestClientIdMetadataInvalidResponse.md",
|
314
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestClientIdMetadataNoResponse.md",
|
315
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestErrorFetchingSignin.md",
|
316
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestErrorIdToken.md",
|
317
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenHttpNotFound.md",
|
318
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenInvalidRequest.md",
|
319
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenInvalidResponse.md",
|
320
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenNoResponse.md",
|
321
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestInvalidSigninResponse.md",
|
322
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestTooManyRequests.md",
|
323
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownHttpNotFound.md",
|
324
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownInvalidResponse.md",
|
325
|
+
"front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownNoResponse.md",
|
307
326
|
"front_end/models/issues_manager/descriptions/genericCrossOriginPortalPostMessageError.md",
|
308
327
|
"front_end/models/issues_manager/descriptions/heavyAd.md",
|
309
328
|
"front_end/models/issues_manager/descriptions/mixedContent.md",
|
@@ -576,6 +595,7 @@ grd_files_debug_sources = [
|
|
576
595
|
"front_end/core/sdk/CSSRule.js",
|
577
596
|
"front_end/core/sdk/CSSStyleDeclaration.js",
|
578
597
|
"front_end/core/sdk/CSSStyleSheetHeader.js",
|
598
|
+
"front_end/core/sdk/CSSSupports.js",
|
579
599
|
"front_end/core/sdk/CategorizedBreakpoint.js",
|
580
600
|
"front_end/core/sdk/ChildTargetManager.js",
|
581
601
|
"front_end/core/sdk/CompilerSourceMappingContentProvider.js",
|
@@ -702,6 +722,7 @@ grd_files_debug_sources = [
|
|
702
722
|
"front_end/models/issues_manager/CorsIssue.js",
|
703
723
|
"front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.js",
|
704
724
|
"front_end/models/issues_manager/DeprecationIssue.js",
|
725
|
+
"front_end/models/issues_manager/FederatedAuthRequestIssue.js",
|
705
726
|
"front_end/models/issues_manager/GenericIssue.js",
|
706
727
|
"front_end/models/issues_manager/HeavyAdIssue.js",
|
707
728
|
"front_end/models/issues_manager/Issue.js",
|
@@ -585,7 +585,8 @@ export enum DevtoolsExperiments {
|
|
585
585
|
'preciseChanges' = 53,
|
586
586
|
'bfcacheDisplayTree' = 54,
|
587
587
|
'stylesPaneCSSChanges' = 55,
|
588
|
-
'
|
588
|
+
'headerOverrides' = 56,
|
589
|
+
'MaxValue' = 57,
|
589
590
|
}
|
590
591
|
/* eslint-enable @typescript-eslint/naming-convention */
|
591
592
|
|
@@ -1337,6 +1337,9 @@
|
|
1337
1337
|
"models/issues_manager/CrossOriginEmbedderPolicyIssue.ts | samesiteAndSameorigin": {
|
1338
1338
|
"message": "Same-Site and Same-Origin"
|
1339
1339
|
},
|
1340
|
+
"models/issues_manager/FederatedAuthRequestIssue.ts | fedCm": {
|
1341
|
+
"message": "Federated Credential Management API"
|
1342
|
+
},
|
1340
1343
|
"models/issues_manager/GenericIssue.ts | crossOriginPortalPostMessage": {
|
1341
1344
|
"message": "Portals - Same-origin communication channels"
|
1342
1345
|
},
|
@@ -2966,6 +2969,9 @@
|
|
2966
2969
|
"panels/application/components/InterestGroupAccessGrid.ts | groupOwner": {
|
2967
2970
|
"message": "Owner"
|
2968
2971
|
},
|
2972
|
+
"panels/application/components/InterestGroupAccessGrid.ts | noEvents": {
|
2973
|
+
"message": "No interest group events recorded."
|
2974
|
+
},
|
2969
2975
|
"panels/application/components/OriginTrialTreeView.ts | expiryTime": {
|
2970
2976
|
"message": "Expiry Time"
|
2971
2977
|
},
|
@@ -3197,6 +3203,9 @@
|
|
3197
3203
|
"panels/application/InterestGroupStorageView.ts | clickToDisplayBody": {
|
3198
3204
|
"message": "Click on any interest group event to display the group's current state"
|
3199
3205
|
},
|
3206
|
+
"panels/application/InterestGroupStorageView.ts | noDataAvailable": {
|
3207
|
+
"message": "No details available for the selected interest group. The browser may have left the group."
|
3208
|
+
},
|
3200
3209
|
"panels/application/InterestGroupTreeElement.ts | interestGroups": {
|
3201
3210
|
"message": "Interest Groups"
|
3202
3211
|
},
|
@@ -1337,6 +1337,9 @@
|
|
1337
1337
|
"models/issues_manager/CrossOriginEmbedderPolicyIssue.ts | samesiteAndSameorigin": {
|
1338
1338
|
"message": "Ŝám̂é-Ŝít̂é âńd̂ Śâḿê-Ór̂íĝín̂"
|
1339
1339
|
},
|
1340
|
+
"models/issues_manager/FederatedAuthRequestIssue.ts | fedCm": {
|
1341
|
+
"message": "F̂éd̂ér̂át̂éd̂ Ćr̂éd̂én̂t́îál̂ Ḿâńâǵêḿêńt̂ ÁP̂Í"
|
1342
|
+
},
|
1340
1343
|
"models/issues_manager/GenericIssue.ts | crossOriginPortalPostMessage": {
|
1341
1344
|
"message": "P̂ór̂t́âĺŝ - Śâḿê-ór̂íĝín̂ ćôḿm̂ún̂íĉát̂íôń ĉh́âńn̂él̂ś"
|
1342
1345
|
},
|
@@ -2966,6 +2969,9 @@
|
|
2966
2969
|
"panels/application/components/InterestGroupAccessGrid.ts | groupOwner": {
|
2967
2970
|
"message": "Ôẃn̂ér̂"
|
2968
2971
|
},
|
2972
|
+
"panels/application/components/InterestGroupAccessGrid.ts | noEvents": {
|
2973
|
+
"message": "N̂ó îńt̂ér̂éŝt́ ĝŕôúp̂ év̂én̂t́ŝ ŕêćôŕd̂éd̂."
|
2974
|
+
},
|
2969
2975
|
"panels/application/components/OriginTrialTreeView.ts | expiryTime": {
|
2970
2976
|
"message": "Êx́p̂ír̂ý T̂ím̂é"
|
2971
2977
|
},
|
@@ -3197,6 +3203,9 @@
|
|
3197
3203
|
"panels/application/InterestGroupStorageView.ts | clickToDisplayBody": {
|
3198
3204
|
"message": "Ĉĺîćk̂ ón̂ án̂ý îńt̂ér̂éŝt́ ĝŕôúp̂ év̂én̂t́ t̂ó d̂íŝṕl̂áŷ t́ĥé ĝŕôúp̂'ś ĉúr̂ŕêńt̂ śt̂át̂é"
|
3199
3205
|
},
|
3206
|
+
"panels/application/InterestGroupStorageView.ts | noDataAvailable": {
|
3207
|
+
"message": "N̂ó d̂ét̂áîĺŝ áv̂áîĺâb́l̂é f̂ór̂ t́ĥé ŝél̂éĉt́êd́ îńt̂ér̂éŝt́ ĝŕôúp̂. T́ĥé b̂ŕôẃŝér̂ ḿâý ĥáv̂é l̂éf̂t́ t̂h́ê ǵr̂óûṕ."
|
3208
|
+
},
|
3200
3209
|
"panels/application/InterestGroupTreeElement.ts | interestGroups": {
|
3201
3210
|
"message": "Îńt̂ér̂éŝt́ Ĝŕôúp̂ś"
|
3202
3211
|
},
|
@@ -274,6 +274,7 @@ export enum ExperimentName {
|
|
274
274
|
FULL_ACCESSIBILITY_TREE = 'fullAccessibilityTree',
|
275
275
|
PRECISE_CHANGES = 'preciseChanges',
|
276
276
|
STYLES_PANE_CSS_CHANGES = 'stylesPaneCSSChanges',
|
277
|
+
HEADER_OVERRIDES = 'headerOverrides',
|
277
278
|
}
|
278
279
|
|
279
280
|
// TODO(crbug.com/1167717): Make this a const enum again
|
@@ -9,7 +9,7 @@ import type {CSSModel, Edit} from './CSSModel.js';
|
|
9
9
|
import {CSSLocation} from './CSSModel.js';
|
10
10
|
import type {CSSStyleSheetHeader} from './CSSStyleSheetHeader.js';
|
11
11
|
|
12
|
-
type CSSQueryPayload = Protocol.CSS.CSSMedia|Protocol.CSS.CSSContainerQuery;
|
12
|
+
type CSSQueryPayload = Protocol.CSS.CSSMedia|Protocol.CSS.CSSContainerQuery|Protocol.CSS.CSSSupports;
|
13
13
|
|
14
14
|
export abstract class CSSQuery {
|
15
15
|
text = '';
|
@@ -7,6 +7,7 @@ import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
7
7
|
|
8
8
|
import {CSSContainerQuery} from './CSSContainerQuery.js';
|
9
9
|
import {CSSMedia} from './CSSMedia.js';
|
10
|
+
import {CSSSupports} from './CSSSupports.js';
|
10
11
|
|
11
12
|
import type {CSSModel, Edit} from './CSSModel.js';
|
12
13
|
import {CSSStyleDeclaration, Type} from './CSSStyleDeclaration.js';
|
@@ -99,6 +100,7 @@ export class CSSStyleRule extends CSSRule {
|
|
99
100
|
selectors!: CSSValue[];
|
100
101
|
media: CSSMedia[];
|
101
102
|
containerQueries: CSSContainerQuery[];
|
103
|
+
supports: CSSSupports[];
|
102
104
|
wasUsed: boolean;
|
103
105
|
constructor(cssModel: CSSModel, payload: Protocol.CSS.CSSRule, wasUsed?: boolean) {
|
104
106
|
// TODO(crbug.com/1011811): Replace with spread operator or better types once Closure is gone.
|
@@ -108,6 +110,7 @@ export class CSSStyleRule extends CSSRule {
|
|
108
110
|
this.containerQueries = payload.containerQueries ?
|
109
111
|
CSSContainerQuery.parseContainerQueriesPayload(cssModel, payload.containerQueries) :
|
110
112
|
[];
|
113
|
+
this.supports = payload.supports ? CSSSupports.parseSupportsPayload(cssModel, payload.supports) : [];
|
111
114
|
this.wasUsed = wasUsed || false;
|
112
115
|
}
|
113
116
|
|
@@ -191,12 +194,9 @@ export class CSSStyleRule extends CSSRule {
|
|
191
194
|
this.selectors[i].rebase(edit);
|
192
195
|
}
|
193
196
|
}
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
for (const containerQuery of this.containerQueries) {
|
198
|
-
containerQuery.rebase(edit);
|
199
|
-
}
|
197
|
+
this.media.forEach(media => media.rebase(edit));
|
198
|
+
this.containerQueries.forEach(cq => cq.rebase(edit));
|
199
|
+
this.supports.forEach(supports => supports.rebase(edit));
|
200
200
|
|
201
201
|
super.rebase(edit);
|
202
202
|
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
// Copyright 2022 The Chromium Authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
3
|
+
// found in the LICENSE file.
|
4
|
+
|
5
|
+
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
6
|
+
import type * as Protocol from '../../generated/protocol.js';
|
7
|
+
|
8
|
+
import type {CSSModel} from './CSSModel.js';
|
9
|
+
import {CSSQuery} from './CSSQuery.js';
|
10
|
+
|
11
|
+
export class CSSSupports extends CSSQuery {
|
12
|
+
static parseSupportsPayload(cssModel: CSSModel, payload: Protocol.CSS.CSSSupports[]): CSSSupports[] {
|
13
|
+
return payload.map(supports => new CSSSupports(cssModel, supports));
|
14
|
+
}
|
15
|
+
|
16
|
+
constructor(cssModel: CSSModel, payload: Protocol.CSS.CSSSupports) {
|
17
|
+
super(cssModel);
|
18
|
+
this.reinitialize(payload);
|
19
|
+
}
|
20
|
+
|
21
|
+
reinitialize(payload: Protocol.CSS.CSSSupports): void {
|
22
|
+
this.text = payload.text;
|
23
|
+
this.range = payload.range ? TextUtils.TextRange.TextRange.fromObject(payload.range) : null;
|
24
|
+
this.styleSheetId = payload.styleSheetId;
|
25
|
+
}
|
26
|
+
|
27
|
+
active(): boolean {
|
28
|
+
return true;
|
29
|
+
}
|
30
|
+
}
|
@@ -34,6 +34,7 @@ import * as CSSQuery from './CSSQuery.js';
|
|
34
34
|
import * as CSSRule from './CSSRule.js';
|
35
35
|
import * as CSSStyleDeclaration from './CSSStyleDeclaration.js';
|
36
36
|
import * as CSSStyleSheetHeader from './CSSStyleSheetHeader.js';
|
37
|
+
import * as CSSSupports from './CSSSupports.js';
|
37
38
|
import * as DebuggerModel from './DebuggerModel.js';
|
38
39
|
import * as DOMDebuggerModel from './DOMDebuggerModel.js';
|
39
40
|
import * as DOMModel from './DOMModel.js';
|
@@ -101,6 +102,7 @@ export {
|
|
101
102
|
CSSRule,
|
102
103
|
CSSStyleDeclaration,
|
103
104
|
CSSStyleSheetHeader,
|
105
|
+
CSSSupports,
|
104
106
|
DebuggerModel,
|
105
107
|
DOMDebuggerModel,
|
106
108
|
DOMModel,
|
@@ -1481,42 +1481,6 @@
|
|
1481
1481
|
installObjectObserve();
|
1482
1482
|
}
|
1483
1483
|
|
1484
|
-
if (majorVersion <= 45) {
|
1485
|
-
/**
|
1486
|
-
* @param {string} property
|
1487
|
-
* @return {!CSSValue|null}
|
1488
|
-
* @this {CSSStyleDeclaration}
|
1489
|
-
*/
|
1490
|
-
function getValue(property) {
|
1491
|
-
// Note that |property| comes from another context, so we can't use === here.
|
1492
|
-
// eslint-disable-next-line eqeqeq
|
1493
|
-
if (property == 'padding-left') {
|
1494
|
-
return /** @type {!CSSValue} */ ({
|
1495
|
-
/**
|
1496
|
-
* @return {number}
|
1497
|
-
* @this {!{__paddingLeft: number}}
|
1498
|
-
*/
|
1499
|
-
getFloatValue: function() {
|
1500
|
-
return this.__paddingLeft;
|
1501
|
-
},
|
1502
|
-
__paddingLeft: parseFloat(this.paddingLeft)
|
1503
|
-
});
|
1504
|
-
}
|
1505
|
-
throw new Error('getPropertyCSSValue is undefined');
|
1506
|
-
}
|
1507
|
-
|
1508
|
-
window.CSSStyleDeclaration.prototype.getPropertyCSSValue = getValue;
|
1509
|
-
|
1510
|
-
function CSSPrimitiveValue() {
|
1511
|
-
}
|
1512
|
-
CSSPrimitiveValue.CSS_PX = 5;
|
1513
|
-
window.CSSPrimitiveValue = CSSPrimitiveValue;
|
1514
|
-
}
|
1515
|
-
|
1516
|
-
if (majorVersion <= 45) {
|
1517
|
-
styleRules.push('* { min-width: 0; min-height: 0; }');
|
1518
|
-
}
|
1519
|
-
|
1520
1484
|
if (majorVersion <= 71) {
|
1521
1485
|
styleRules.push(
|
1522
1486
|
'.coverage-toolbar-container, .animation-timeline-toolbar-container, .computed-properties { flex-basis: auto; }');
|
@@ -372,6 +372,10 @@ export class MainImpl {
|
|
372
372
|
Root.Runtime.experiments.register(
|
373
373
|
Root.Runtime.ExperimentName.STYLES_PANE_CSS_CHANGES, 'Sync CSS changes in the Styles pane');
|
374
374
|
|
375
|
+
// Local overrides for response headers
|
376
|
+
Root.Runtime.experiments.register(
|
377
|
+
Root.Runtime.ExperimentName.HEADER_OVERRIDES, 'Local overrides for response headers');
|
378
|
+
|
375
379
|
Root.Runtime.experiments.enableExperimentsByDefault([
|
376
380
|
'sourceOrderViewer',
|
377
381
|
'hideIssuesFeature',
|
@@ -0,0 +1,265 @@
|
|
1
|
+
// Copyright 2022 The Chromium Authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
3
|
+
// found in the LICENSE file.
|
4
|
+
|
5
|
+
import * as i18n from '../../core/i18n/i18n.js';
|
6
|
+
import type * as SDK from '../../core/sdk/sdk.js';
|
7
|
+
import * as Protocol from '../../generated/protocol.js';
|
8
|
+
|
9
|
+
import {Issue, IssueCategory, IssueKind} from './Issue.js';
|
10
|
+
import type {MarkdownIssueDescription, LazyMarkdownIssueDescription} from './MarkdownIssueDescription.js';
|
11
|
+
import {resolveLazyDescription} from './MarkdownIssueDescription.js';
|
12
|
+
|
13
|
+
const UIStrings = {
|
14
|
+
/**
|
15
|
+
*@description Title for Client Hint specification url link
|
16
|
+
*/
|
17
|
+
fedCm: 'Federated Credential Management API',
|
18
|
+
};
|
19
|
+
const str_ = i18n.i18n.registerUIStrings('models/issues_manager/FederatedAuthRequestIssue.ts', UIStrings);
|
20
|
+
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
21
|
+
|
22
|
+
export class FederatedAuthRequestIssue extends Issue {
|
23
|
+
readonly #issueDetails: Protocol.Audits.FederatedAuthRequestIssueDetails;
|
24
|
+
|
25
|
+
constructor(
|
26
|
+
issueDetails: Protocol.Audits.FederatedAuthRequestIssueDetails, issuesModel: SDK.IssuesModel.IssuesModel) {
|
27
|
+
super(
|
28
|
+
{
|
29
|
+
code: Protocol.Audits.InspectorIssueCode.FederatedAuthRequestIssue,
|
30
|
+
umaCode: [
|
31
|
+
Protocol.Audits.InspectorIssueCode.FederatedAuthRequestIssue,
|
32
|
+
issueDetails.federatedAuthRequestIssueReason,
|
33
|
+
].join('::'),
|
34
|
+
},
|
35
|
+
issuesModel);
|
36
|
+
this.#issueDetails = issueDetails;
|
37
|
+
}
|
38
|
+
|
39
|
+
getCategory(): IssueCategory {
|
40
|
+
return IssueCategory.Other;
|
41
|
+
}
|
42
|
+
|
43
|
+
details(): Protocol.Audits.FederatedAuthRequestIssueDetails {
|
44
|
+
return this.#issueDetails;
|
45
|
+
}
|
46
|
+
|
47
|
+
getDescription(): MarkdownIssueDescription|null {
|
48
|
+
const description = issueDescriptions.get(this.#issueDetails.federatedAuthRequestIssueReason);
|
49
|
+
if (!description) {
|
50
|
+
return null;
|
51
|
+
}
|
52
|
+
return resolveLazyDescription(description);
|
53
|
+
}
|
54
|
+
|
55
|
+
primaryKey(): string {
|
56
|
+
return JSON.stringify(this.#issueDetails);
|
57
|
+
}
|
58
|
+
|
59
|
+
getKind(): IssueKind {
|
60
|
+
return IssueKind.PageError;
|
61
|
+
}
|
62
|
+
|
63
|
+
static fromInspectorIssue(issuesModel: SDK.IssuesModel.IssuesModel, inspectorIssue: Protocol.Audits.InspectorIssue):
|
64
|
+
FederatedAuthRequestIssue[] {
|
65
|
+
const details = inspectorIssue.details.federatedAuthRequestIssueDetails;
|
66
|
+
if (!details) {
|
67
|
+
console.warn('Federated auth request issue without details received.');
|
68
|
+
return [];
|
69
|
+
}
|
70
|
+
return [new FederatedAuthRequestIssue(details, issuesModel)];
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
const issueDescriptions: Map<Protocol.Audits.FederatedAuthRequestIssueReason, LazyMarkdownIssueDescription> = new Map([
|
75
|
+
[
|
76
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.ApprovalDeclined,
|
77
|
+
{
|
78
|
+
file: 'federatedAuthRequestApprovalDeclined.md',
|
79
|
+
links: [{
|
80
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
81
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
82
|
+
}],
|
83
|
+
},
|
84
|
+
],
|
85
|
+
[
|
86
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.TooManyRequests,
|
87
|
+
{
|
88
|
+
file: 'federatedAuthRequestTooManyRequests.md',
|
89
|
+
links: [{
|
90
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
91
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
92
|
+
}],
|
93
|
+
},
|
94
|
+
],
|
95
|
+
[
|
96
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.WellKnownHttpNotFound,
|
97
|
+
{
|
98
|
+
file: 'federatedAuthRequestWellKnownHttpNotFound.md',
|
99
|
+
links: [{
|
100
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
101
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
102
|
+
}],
|
103
|
+
},
|
104
|
+
],
|
105
|
+
[
|
106
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.WellKnownNoResponse,
|
107
|
+
{
|
108
|
+
file: 'federatedAuthRequestWellKnownNoResponse.md',
|
109
|
+
links: [{
|
110
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
111
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
112
|
+
}],
|
113
|
+
},
|
114
|
+
],
|
115
|
+
[
|
116
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.WellKnownInvalidResponse,
|
117
|
+
{
|
118
|
+
file: 'federatedAuthRequestWellKnownInvalidResponse.md',
|
119
|
+
links: [{
|
120
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
121
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
122
|
+
}],
|
123
|
+
},
|
124
|
+
],
|
125
|
+
[
|
126
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.ClientIdMetadataHttpNotFound,
|
127
|
+
{
|
128
|
+
file: 'federatedAuthRequestClientIdMetadataHttpNotFound.md',
|
129
|
+
links: [{
|
130
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
131
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
132
|
+
}],
|
133
|
+
},
|
134
|
+
],
|
135
|
+
[
|
136
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.ClientIdMetadataNoResponse,
|
137
|
+
{
|
138
|
+
file: 'federatedAuthRequestClientIdMetadataNoResponse.md',
|
139
|
+
links: [{
|
140
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
141
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
142
|
+
}],
|
143
|
+
},
|
144
|
+
],
|
145
|
+
[
|
146
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.ClientIdMetadataInvalidResponse,
|
147
|
+
{
|
148
|
+
file: 'federatedAuthRequestClientIdMetadataInvalidResponse.md',
|
149
|
+
links: [{
|
150
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
151
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
152
|
+
}],
|
153
|
+
},
|
154
|
+
],
|
155
|
+
[
|
156
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.ErrorFetchingSignin,
|
157
|
+
{
|
158
|
+
file: 'federatedAuthRequestErrorFetchingSignin.md',
|
159
|
+
links: [{
|
160
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
161
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
162
|
+
}],
|
163
|
+
},
|
164
|
+
],
|
165
|
+
[
|
166
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.InvalidSigninResponse,
|
167
|
+
{
|
168
|
+
file: 'federatedAuthRequestInvalidSigninResponse.md',
|
169
|
+
links: [{
|
170
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
171
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
172
|
+
}],
|
173
|
+
},
|
174
|
+
],
|
175
|
+
[
|
176
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.AccountsHttpNotFound,
|
177
|
+
{
|
178
|
+
file: 'federatedAuthRequestAccountsHttpNotFound.md',
|
179
|
+
links: [{
|
180
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
181
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
182
|
+
}],
|
183
|
+
},
|
184
|
+
],
|
185
|
+
[
|
186
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.AccountsNoResponse,
|
187
|
+
{
|
188
|
+
file: 'federatedAuthRequestAccountsNoResponse.md',
|
189
|
+
links: [{
|
190
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
191
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
192
|
+
}],
|
193
|
+
},
|
194
|
+
],
|
195
|
+
[
|
196
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.AccountsInvalidResponse,
|
197
|
+
{
|
198
|
+
file: 'federatedAuthRequestAccountsInvalidResponse.md',
|
199
|
+
links: [{
|
200
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
201
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
202
|
+
}],
|
203
|
+
},
|
204
|
+
],
|
205
|
+
[
|
206
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.IdTokenHttpNotFound,
|
207
|
+
{
|
208
|
+
file: 'federatedAuthRequestIdTokenHttpNotFound.md',
|
209
|
+
links: [{
|
210
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
211
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
212
|
+
}],
|
213
|
+
},
|
214
|
+
],
|
215
|
+
[
|
216
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.IdTokenNoResponse,
|
217
|
+
{
|
218
|
+
file: 'federatedAuthRequestIdTokenNoResponse.md',
|
219
|
+
links: [{
|
220
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
221
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
222
|
+
}],
|
223
|
+
},
|
224
|
+
],
|
225
|
+
[
|
226
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.IdTokenInvalidResponse,
|
227
|
+
{
|
228
|
+
file: 'federatedAuthRequestIdTokenInvalidResponse.md',
|
229
|
+
links: [{
|
230
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
231
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
232
|
+
}],
|
233
|
+
},
|
234
|
+
],
|
235
|
+
[
|
236
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.IdTokenInvalidRequest,
|
237
|
+
{
|
238
|
+
file: 'federatedAuthRequestIdTokenInvalidRequest.md',
|
239
|
+
links: [{
|
240
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
241
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
242
|
+
}],
|
243
|
+
},
|
244
|
+
],
|
245
|
+
[
|
246
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.ErrorIdToken,
|
247
|
+
{
|
248
|
+
file: 'federatedAuthRequestErrorIdToken.md',
|
249
|
+
links: [{
|
250
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
251
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
252
|
+
}],
|
253
|
+
},
|
254
|
+
],
|
255
|
+
[
|
256
|
+
Protocol.Audits.FederatedAuthRequestIssueReason.Canceled,
|
257
|
+
{
|
258
|
+
file: 'federatedAuthRequestCanceled.md',
|
259
|
+
links: [{
|
260
|
+
link: 'https://fedidcg.github.io/FedCM/',
|
261
|
+
linkTitle: i18nLazyString(UIStrings.fedCm),
|
262
|
+
}],
|
263
|
+
},
|
264
|
+
],
|
265
|
+
]);
|
@@ -13,6 +13,7 @@ import {ContentSecurityPolicyIssue} from './ContentSecurityPolicyIssue.js';
|
|
13
13
|
import {CorsIssue} from './CorsIssue.js';
|
14
14
|
import {CrossOriginEmbedderPolicyIssue, isCrossOriginEmbedderPolicyIssue} from './CrossOriginEmbedderPolicyIssue.js';
|
15
15
|
import {DeprecationIssue} from './DeprecationIssue.js';
|
16
|
+
import {FederatedAuthRequestIssue} from './FederatedAuthRequestIssue.js';
|
16
17
|
import {GenericIssue} from './GenericIssue.js';
|
17
18
|
import {HeavyAdIssue} from './HeavyAdIssue.js';
|
18
19
|
import type {Issue, IssueKind} from './Issue.js';
|
@@ -104,6 +105,10 @@ const issueCodeHandlers = new Map<
|
|
104
105
|
Protocol.Audits.InspectorIssueCode.ClientHintIssue,
|
105
106
|
ClientHintIssue.fromInspectorIssue,
|
106
107
|
],
|
108
|
+
[
|
109
|
+
Protocol.Audits.InspectorIssueCode.FederatedAuthRequestIssue,
|
110
|
+
FederatedAuthRequestIssue.fromInspectorIssue,
|
111
|
+
],
|
107
112
|
]);
|
108
113
|
|
109
114
|
/**
|
package/front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsHttpNotFound.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# The provider's accounts list endpoint cannot be found.
|
package/front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsInvalidResponse.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Provider's accounts list is invalid.
|
package/front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsNoResponse.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# The response body is empty when fetching the provider's accounts list.
|
@@ -0,0 +1 @@
|
|
1
|
+
# User declined the sign-in attempt.
|
@@ -0,0 +1 @@
|
|
1
|
+
# The request has been aborted.
|
@@ -0,0 +1 @@
|
|
1
|
+
# The provider's client metadata endpoint cannot be found.
|
@@ -0,0 +1 @@
|
|
1
|
+
# Provider's client metadata is invalid.
|
@@ -0,0 +1 @@
|
|
1
|
+
# The response body is empty when fetching the provider's client metadata.
|
package/front_end/models/issues_manager/descriptions/federatedAuthRequestErrorFetchingSignin.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Error attempting to reach the provider's sign-in endpoint.
|
@@ -0,0 +1 @@
|
|
1
|
+
# Error retrieving an id token.
|
package/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenHttpNotFound.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# The provider's id token endpoint cannot be found.
|
package/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenInvalidRequest.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# The id token fetching request is invalid.
|
package/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenInvalidResponse.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Provider's id token is invalid.
|
@@ -0,0 +1 @@
|
|
1
|
+
# The response body is empty when fetching the provider's id token.
|
package/front_end/models/issues_manager/descriptions/federatedAuthRequestInvalidSigninResponse.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Provider's sign-in response is invalid.
|
@@ -0,0 +1 @@
|
|
1
|
+
# Only one navigator.credentials.get request may be outstanding at one time.
|
package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownHttpNotFound.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# The provider's .well-known configuration cannot be found.
|
package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownInvalidResponse.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Provider's .well-known configuration is invalid.
|
package/front_end/models/issues_manager/descriptions/federatedAuthRequestWellKnownNoResponse.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# The response body is empty when fetching the provider's .well-known configuration.
|
@@ -18,8 +18,10 @@ const UIStrings = {
|
|
18
18
|
*/
|
19
19
|
clickToDisplayBody: 'Click on any interest group event to display the group\'s current state',
|
20
20
|
/**
|
21
|
-
|
21
|
+
*@description Placeholder text telling the user no details are available for
|
22
|
+
*the selected interest group.
|
22
23
|
*/
|
24
|
+
noDataAvailable: 'No details available for the selected interest group. The browser may have left the group.',
|
23
25
|
};
|
24
26
|
const str_ = i18n.i18n.registerUIStrings('panels/application/InterestGroupStorageView.ts', UIStrings);
|
25
27
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
@@ -37,24 +39,33 @@ export class InterestGroupStorageView extends UI.SplitWidget.SplitWidget {
|
|
37
39
|
private readonly interestGroupGrid = new ApplicationComponents.InterestGroupAccessGrid.InterestGroupAccessGrid();
|
38
40
|
private events: Protocol.Storage.InterestGroupAccessedEvent[] = [];
|
39
41
|
private detailsGetter: InterestGroupDetailsGetter;
|
42
|
+
private noDataView: UI.Widget.VBox;
|
43
|
+
private noDisplayView: UI.Widget.VBox;
|
40
44
|
|
41
45
|
constructor(detailsGetter: InterestGroupDetailsGetter) {
|
42
46
|
super(/* isVertical */ false, /* secondIsSidebar: */ true);
|
43
47
|
this.detailsGetter = detailsGetter;
|
44
48
|
|
45
49
|
const topPanel = new UI.Widget.VBox();
|
46
|
-
|
50
|
+
this.noDisplayView = new UI.Widget.VBox();
|
51
|
+
this.noDataView = new UI.Widget.VBox();
|
52
|
+
|
47
53
|
topPanel.setMinimumSize(0, 80);
|
48
54
|
this.setMainWidget(topPanel);
|
49
|
-
|
50
|
-
this.setSidebarWidget(
|
55
|
+
this.noDisplayView.setMinimumSize(0, 40);
|
56
|
+
this.setSidebarWidget(this.noDisplayView);
|
57
|
+
this.noDataView.setMinimumSize(0, 40);
|
51
58
|
|
52
59
|
topPanel.contentElement.appendChild(this.interestGroupGrid);
|
53
60
|
this.interestGroupGrid.addEventListener('cellfocused', this.onFocus.bind(this));
|
54
61
|
|
55
|
-
|
56
|
-
const
|
57
|
-
|
62
|
+
this.noDisplayView.contentElement.classList.add('placeholder');
|
63
|
+
const noDisplayDiv = this.noDisplayView.contentElement.createChild('div');
|
64
|
+
noDisplayDiv.textContent = i18nString(UIStrings.clickToDisplayBody);
|
65
|
+
|
66
|
+
this.noDataView.contentElement.classList.add('placeholder');
|
67
|
+
const noDataDiv = this.noDataView.contentElement.createChild('div');
|
68
|
+
noDataDiv.textContent = i18nString(UIStrings.noDataAvailable);
|
58
69
|
}
|
59
70
|
|
60
71
|
wasShown(): void {
|
@@ -77,6 +88,7 @@ export class InterestGroupStorageView extends UI.SplitWidget.SplitWidget {
|
|
77
88
|
clearEvents(): void {
|
78
89
|
this.events = [];
|
79
90
|
this.interestGroupGrid.data = this.events;
|
91
|
+
this.setSidebarWidget(this.noDisplayView);
|
80
92
|
}
|
81
93
|
|
82
94
|
private async onFocus(event: Event): Promise<void> {
|
@@ -99,6 +111,8 @@ export class InterestGroupStorageView extends UI.SplitWidget.SplitWidget {
|
|
99
111
|
if (jsonView) {
|
100
112
|
this.setSidebarWidget(jsonView);
|
101
113
|
}
|
114
|
+
} else {
|
115
|
+
this.setSidebarWidget(this.noDataView);
|
102
116
|
}
|
103
117
|
}
|
104
118
|
|
@@ -32,6 +32,10 @@ const UIStrings = {
|
|
32
32
|
*@description Text in InterestGroupStorage Items View of the Application panel
|
33
33
|
*/
|
34
34
|
groupName: 'Name',
|
35
|
+
/**
|
36
|
+
*@description Text shown instead of a table when the table would be empty.
|
37
|
+
*/
|
38
|
+
noEvents: 'No interest group events recorded.',
|
35
39
|
};
|
36
40
|
const str_ = i18n.i18n.registerUIStrings('panels/application/components/InterestGroupAccessGrid.ts', UIStrings);
|
37
41
|
export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
@@ -62,13 +66,17 @@ export class InterestGroupAccessGrid extends HTMLElement {
|
|
62
66
|
{iconName: 'ic_info_black_18dp', color: 'var(--color-link)', width: '14px'} as
|
63
67
|
IconButton.Icon.IconWithName}>
|
64
68
|
</${IconButton.Icon.Icon.litTagName}>
|
65
|
-
${this.#
|
69
|
+
${this.#renderGridOrNoDataMessage()}
|
66
70
|
</div>
|
67
71
|
`, this.#shadow, {host: this});
|
68
72
|
// clang-format on
|
69
73
|
}
|
70
74
|
|
71
|
-
#
|
75
|
+
#renderGridOrNoDataMessage(): LitHtml.TemplateResult {
|
76
|
+
if (this.#datastores.length === 0) {
|
77
|
+
return LitHtml.html`<div class="no-events-message">${i18nString(UIStrings.noEvents)}</div>`;
|
78
|
+
}
|
79
|
+
|
72
80
|
const gridData: DataGrid.DataGridController.DataGridControllerData = {
|
73
81
|
columns: [
|
74
82
|
{
|
@@ -1470,10 +1470,8 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
1470
1470
|
continue;
|
1471
1471
|
}
|
1472
1472
|
const formattedLine = document.createElement('span');
|
1473
|
-
const
|
1474
|
-
|
1475
|
-
|
1476
|
-
formattedLine.appendChild(this.linkifyStringAsFragment(prefix));
|
1473
|
+
const suffix = `${link.suffix}${newline}`;
|
1474
|
+
formattedLine.appendChild(this.linkifyStringAsFragment(link.prefix));
|
1477
1475
|
const scriptLocationLink = this.linkifier.linkifyScriptLocation(
|
1478
1476
|
debuggerModel.target(), link.scriptId || null, link.url, link.lineNumber, {
|
1479
1477
|
columnNumber: link.columnNumber,
|
@@ -1492,7 +1490,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
1492
1490
|
continue;
|
1493
1491
|
}
|
1494
1492
|
|
1495
|
-
const prefixWithoutFunction = prefix.substring(0, prefix.lastIndexOf(' ', prefix.length - 3));
|
1493
|
+
const prefixWithoutFunction = link.prefix.substring(0, link.prefix.lastIndexOf(' ', link.prefix.length - 3));
|
1496
1494
|
|
1497
1495
|
// If we were able to parse the function name from the stack trace line, try to replace it with an expansion of
|
1498
1496
|
// any inline frames.
|
@@ -10,8 +10,10 @@ export interface ParsedErrorFrame {
|
|
10
10
|
line: string;
|
11
11
|
link?: {
|
12
12
|
url: string,
|
13
|
+
prefix: string,
|
14
|
+
suffix: string,
|
13
15
|
lineNumber?: number,
|
14
|
-
columnNumber?: number, enclosedInBraces: boolean,
|
16
|
+
columnNumber?: number, enclosedInBraces: boolean,
|
15
17
|
scriptId?: Protocol.Runtime.ScriptId,
|
16
18
|
};
|
17
19
|
}
|
@@ -88,9 +90,9 @@ export function parseSourcePositionsFromErrorStack(
|
|
88
90
|
line,
|
89
91
|
link: {
|
90
92
|
url,
|
93
|
+
prefix: line.substring(0, left),
|
94
|
+
suffix: line.substring(right),
|
91
95
|
enclosedInBraces: hasOpenBracket,
|
92
|
-
positionLeft: left,
|
93
|
-
positionRight: right,
|
94
96
|
lineNumber: splitResult.lineNumber,
|
95
97
|
columnNumber: splitResult.columnNumber,
|
96
98
|
},
|
@@ -1840,6 +1840,12 @@ export class StylePropertiesSection {
|
|
1840
1840
|
this.updateRuleOrigin();
|
1841
1841
|
}
|
1842
1842
|
|
1843
|
+
protected createAtRuleLists(rule: SDK.CSSRule.CSSStyleRule): void {
|
1844
|
+
this.createMediaList(rule.media);
|
1845
|
+
this.createContainerQueryList(rule.containerQueries);
|
1846
|
+
this.createSupportsList(rule.supports);
|
1847
|
+
}
|
1848
|
+
|
1843
1849
|
protected createMediaList(mediaRules: SDK.CSSMedia.CSSMedia[]): void {
|
1844
1850
|
for (let i = mediaRules.length - 1; i >= 0; --i) {
|
1845
1851
|
const media = mediaRules[i];
|
@@ -1907,6 +1913,28 @@ export class StylePropertiesSection {
|
|
1907
1913
|
}
|
1908
1914
|
}
|
1909
1915
|
|
1916
|
+
protected createSupportsList(supportsList: SDK.CSSSupports.CSSSupports[]): void {
|
1917
|
+
for (let i = supportsList.length - 1; i >= 0; --i) {
|
1918
|
+
const supports = supportsList[i];
|
1919
|
+
if (!supports.text) {
|
1920
|
+
continue;
|
1921
|
+
}
|
1922
|
+
|
1923
|
+
let onQueryTextClick;
|
1924
|
+
if (supports.styleSheetId) {
|
1925
|
+
onQueryTextClick = this.handleQueryRuleClick.bind(this, supports);
|
1926
|
+
}
|
1927
|
+
|
1928
|
+
const supportsElement = new ElementsComponents.CSSQuery.CSSQuery();
|
1929
|
+
supportsElement.data = {
|
1930
|
+
queryPrefix: '@supports',
|
1931
|
+
queryText: supports.text,
|
1932
|
+
onQueryTextClick,
|
1933
|
+
};
|
1934
|
+
this.queryListElement.append(supportsElement);
|
1935
|
+
}
|
1936
|
+
}
|
1937
|
+
|
1910
1938
|
private async addContainerForContainerQuery(containerQuery: SDK.CSSContainerQuery.CSSContainerQuery): Promise<void> {
|
1911
1939
|
const container = await containerQuery.getContainerForNode(this.matchedStyles.node().id);
|
1912
1940
|
if (!container) {
|
@@ -1937,8 +1965,7 @@ export class StylePropertiesSection {
|
|
1937
1965
|
private updateQueryList(): void {
|
1938
1966
|
this.queryListElement.removeChildren();
|
1939
1967
|
if (this.styleInternal.parentRule && this.styleInternal.parentRule instanceof SDK.CSSRule.CSSStyleRule) {
|
1940
|
-
this.
|
1941
|
-
this.createContainerQueryList(this.styleInternal.parentRule.containerQueries);
|
1968
|
+
this.createAtRuleLists(this.styleInternal.parentRule);
|
1942
1969
|
}
|
1943
1970
|
}
|
1944
1971
|
|
@@ -2210,8 +2237,7 @@ export class StylePropertiesSection {
|
|
2210
2237
|
event.consume(true);
|
2211
2238
|
}
|
2212
2239
|
|
2213
|
-
private handleQueryRuleClick(query: SDK.
|
2214
|
-
void {
|
2240
|
+
private handleQueryRuleClick(query: SDK.CSSQuery.CSSQuery, event: Event): void {
|
2215
2241
|
const element = event.currentTarget as Element;
|
2216
2242
|
if (UI.UIUtils.isBeingEdited(element)) {
|
2217
2243
|
return;
|
@@ -2273,8 +2299,8 @@ export class StylePropertiesSection {
|
|
2273
2299
|
}
|
2274
2300
|
|
2275
2301
|
private editingMediaCommitted(
|
2276
|
-
query: SDK.
|
2277
|
-
|
2302
|
+
query: SDK.CSSQuery.CSSQuery, element: Element, newContent: string, _oldContent: string,
|
2303
|
+
_context: Context|undefined, _moveDirection: string): void {
|
2278
2304
|
this.parentPane.setEditingStyle(false);
|
2279
2305
|
this.editingMediaFinished(element);
|
2280
2306
|
|
@@ -2560,8 +2586,7 @@ export class BlankStylePropertiesSection extends StylePropertiesSection {
|
|
2560
2586
|
cssModel, this.parentPane.linkifier, styleSheetId, this.actualRuleLocation()));
|
2561
2587
|
if (insertAfterStyle && insertAfterStyle.parentRule &&
|
2562
2588
|
insertAfterStyle.parentRule instanceof SDK.CSSRule.CSSStyleRule) {
|
2563
|
-
this.
|
2564
|
-
this.createContainerQueryList(insertAfterStyle.parentRule.containerQueries);
|
2589
|
+
this.createAtRuleLists(insertAfterStyle.parentRule);
|
2565
2590
|
}
|
2566
2591
|
this.element.classList.add('blank-section');
|
2567
2592
|
}
|
@@ -140,9 +140,12 @@ export class LighthouseReportRenderer extends LighthouseReport.ReportRenderer {
|
|
140
140
|
}
|
141
141
|
|
142
142
|
static handleDarkMode(el: Element): void {
|
143
|
-
|
144
|
-
el.classList.
|
145
|
-
}
|
143
|
+
const updateDarkModeIfNecessary = (): void => {
|
144
|
+
el.classList.toggle('lh-dark', ThemeSupport.ThemeSupport.instance().themeName() === 'dark');
|
145
|
+
};
|
146
|
+
ThemeSupport.ThemeSupport.instance().addEventListener(
|
147
|
+
ThemeSupport.ThemeChangeEvent.eventName, updateDarkModeIfNecessary);
|
148
|
+
updateDarkModeIfNecessary();
|
146
149
|
}
|
147
150
|
}
|
148
151
|
|
@@ -607,7 +607,7 @@ export class DebuggerPlugin extends Plugin {
|
|
607
607
|
return null;
|
608
608
|
}
|
609
609
|
while (
|
610
|
-
node && node.name !== 'VariableDefinition' && node.name !== 'VariableName' &&
|
610
|
+
node && node.name !== 'this' && node.name !== 'VariableDefinition' && node.name !== 'VariableName' &&
|
611
611
|
node.name !== 'MemberExpression' &&
|
612
612
|
!(node.name === 'PropertyName' && node.parent?.name === 'PatternProperty' &&
|
613
613
|
node.nextSibling?.name !== ':') &&
|
@@ -188,6 +188,7 @@ function detectLineSeparator(text: string): CM.Extension {
|
|
188
188
|
|
189
189
|
const baseKeymap = CM.keymap.of([
|
190
190
|
{key: 'Tab', run: CM.acceptCompletion},
|
191
|
+
{key: 'End', run: CM.acceptCompletion},
|
191
192
|
{key: 'Ctrl-m', run: CM.cursorMatchingBracket, shift: CM.selectMatchingBracket},
|
192
193
|
{key: 'Mod-/', run: CM.toggleComment},
|
193
194
|
{key: 'Mod-d', run: CM.selectNextOccurrence},
|
@@ -59,7 +59,7 @@ export class ObjectPopoverHelper {
|
|
59
59
|
Promise<ObjectPopoverHelper|null> {
|
60
60
|
const description = Platform.StringUtilities.trimEndWithMaxLength(result.description || '', MaxPopoverTextLength);
|
61
61
|
let popoverContentElement: HTMLSpanElement|HTMLDivElement|null = null;
|
62
|
-
if (result.type === 'object') {
|
62
|
+
if (result.type === 'function' || result.type === 'object') {
|
63
63
|
let linkifier: Components.Linkifier.Linkifier|null = null;
|
64
64
|
let resultHighlightedAsDOM = false;
|
65
65
|
if (result.subtype === 'node') {
|
@@ -74,9 +74,15 @@ export class ObjectPopoverHelper {
|
|
74
74
|
} else {
|
75
75
|
popoverContentElement = document.createElement('div');
|
76
76
|
popoverContentElement.classList.add('object-popover-content');
|
77
|
-
popover.registerCSSFiles([objectPopoverStyles]);
|
78
|
-
const titleElement = popoverContentElement.createChild('div', '
|
79
|
-
|
77
|
+
popover.registerCSSFiles([objectValueStyles, objectPopoverStyles]);
|
78
|
+
const titleElement = popoverContentElement.createChild('div', 'object-popover-title');
|
79
|
+
if (result.type === 'function') {
|
80
|
+
titleElement.classList.add('source-code');
|
81
|
+
titleElement.appendChild(ObjectPropertiesSection.valueElementForFunctionDescription(result.description));
|
82
|
+
} else {
|
83
|
+
titleElement.classList.add('monospace');
|
84
|
+
titleElement.createChild('span').textContent = description;
|
85
|
+
}
|
80
86
|
linkifier = new Components.Linkifier.Linkifier();
|
81
87
|
const section = new ObjectPropertiesSection(result, '', linkifier, true /* showOverflow */);
|
82
88
|
section.element.classList.add('object-popover-tree');
|
@@ -98,39 +104,12 @@ export class ObjectPopoverHelper {
|
|
98
104
|
|
99
105
|
if (result.type === 'string') {
|
100
106
|
UI.UIUtils.createTextChildren(valueElement, `"${description}"`);
|
101
|
-
} else
|
107
|
+
} else {
|
102
108
|
valueElement.textContent = description;
|
103
109
|
}
|
104
110
|
|
105
|
-
|
106
|
-
|
107
|
-
return new ObjectPopoverHelper(null, false);
|
108
|
-
}
|
109
|
-
|
110
|
-
void ObjectPropertiesSection.formatObjectAsFunction(result, valueElement, true);
|
111
|
-
const response = await result.debuggerModel().functionDetailsPromise(result);
|
112
|
-
if (!response) {
|
113
|
-
return null;
|
114
|
-
}
|
115
|
-
|
116
|
-
const container = document.createElement('div');
|
117
|
-
container.classList.add('object-popover-container');
|
118
|
-
const title = container.createChild('div', 'function-popover-title source-code');
|
119
|
-
const functionName = title.createChild('span', 'function-name');
|
120
|
-
functionName.textContent = UI.UIUtils.beautifyFunctionName(response.functionName);
|
121
|
-
|
122
|
-
const rawLocation = response.location;
|
123
|
-
const linkContainer = title.createChild('div', 'function-title-link-container');
|
124
|
-
const script = rawLocation && rawLocation.script();
|
125
|
-
const sourceURL = script && script.sourceURL;
|
126
|
-
let linkifier: Components.Linkifier.Linkifier|null = null;
|
127
|
-
if (sourceURL) {
|
128
|
-
linkifier = new Components.Linkifier.Linkifier(undefined, undefined, popover.positionContent.bind(popover));
|
129
|
-
linkContainer.appendChild(linkifier.linkifyRawLocation((rawLocation as SDK.DebuggerModel.Location), sourceURL));
|
130
|
-
}
|
131
|
-
container.appendChild(popoverContentElement);
|
132
|
-
popover.contentElement.appendChild(container);
|
133
|
-
return new ObjectPopoverHelper(linkifier, false);
|
111
|
+
popover.contentElement.appendChild(popoverContentElement);
|
112
|
+
return new ObjectPopoverHelper(null, false);
|
134
113
|
}
|
135
114
|
}
|
136
115
|
|
@@ -260,7 +260,7 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
|
260
260
|
return UI.Fragment.html`<span class="name">${name}</span>`;
|
261
261
|
}
|
262
262
|
|
263
|
-
static valueElementForFunctionDescription(description?: string
|
263
|
+
static valueElementForFunctionDescription(description?: string, includePreview?: boolean, defaultName?: string):
|
264
264
|
Element {
|
265
265
|
const valueElement = document.createElement('span');
|
266
266
|
valueElement.classList.add('object-value-function');
|
@@ -30,28 +30,3 @@
|
|
30
30
|
.object-popover-container {
|
31
31
|
display: inline-block;
|
32
32
|
}
|
33
|
-
|
34
|
-
.function-popover-title {
|
35
|
-
border-bottom: 1px solid var(--color-details-hairline);
|
36
|
-
margin-bottom: 3px;
|
37
|
-
padding-bottom: 2px;
|
38
|
-
display: flex;
|
39
|
-
justify-content: space-between;
|
40
|
-
align-items: center;
|
41
|
-
}
|
42
|
-
|
43
|
-
.function-popover-title .function-name {
|
44
|
-
font-weight: bold;
|
45
|
-
}
|
46
|
-
|
47
|
-
.function-title-link-container {
|
48
|
-
display: flex;
|
49
|
-
align-items: center;
|
50
|
-
position: relative;
|
51
|
-
margin-left: 10px;
|
52
|
-
}
|
53
|
-
|
54
|
-
.function-title-link-container .devtools-link {
|
55
|
-
white-space: nowrap;
|
56
|
-
overflow: hidden;
|
57
|
-
}
|
package/package.json
CHANGED
@@ -39,6 +39,7 @@
|
|
39
39
|
"debug-unittest": "DEBUG_TEST=1 npm run unittest",
|
40
40
|
"e2etest": "third_party/node/node.py --output scripts/test/run_test_suite.js --config=test/e2e/test-runner-config.json",
|
41
41
|
"eslint-test": "third_party/node/node.py --output node_modules/mocha/bin/mocha \"./scripts/eslint_rules/tests/*_test.js\"",
|
42
|
+
"build-test": "third_party/node/node.py --output node_modules/mocha/bin/mocha \"./scripts/build/tests/*_test.js\"",
|
42
43
|
"generate-dark-mode-styles": "third_party/node/node.py --output scripts/dark_mode/generate_dark_theme_sheet.js",
|
43
44
|
"generate-protocol-resources": "scripts/deps/generate_protocol_resources.py && git cl format --js",
|
44
45
|
"install-deps": "scripts/deps/manage_node_deps.py",
|
@@ -53,5 +54,5 @@
|
|
53
54
|
"unittest": "scripts/test/run_unittests.py --no-text-coverage",
|
54
55
|
"watch": "third_party/node/node.py --output scripts/watch_build.js"
|
55
56
|
},
|
56
|
-
"version": "1.0.
|
57
|
+
"version": "1.0.968254"
|
57
58
|
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
// Copyright 2022 The Chromium Authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
3
|
+
// found in the LICENSE file.
|
4
|
+
|
5
|
+
const {assert} = require('chai');
|
6
|
+
const path = require('path');
|
7
|
+
|
8
|
+
const {devtoolsPlugin} = require('../devtools_plugin.js');
|
9
|
+
|
10
|
+
describe('devtools_plugin can compute paths with', () => {
|
11
|
+
it('same directory import', () => {
|
12
|
+
assert.deepEqual(
|
13
|
+
devtoolsPlugin('./AnotherFile.js', 'front_end/core/sdk/FirstFile.js'),
|
14
|
+
{id: path.join('front_end', 'core', 'sdk', 'AnotherFile.js'), external: false});
|
15
|
+
});
|
16
|
+
|
17
|
+
it('different directory import', () => {
|
18
|
+
assert.deepEqual(
|
19
|
+
devtoolsPlugin('../common/common.js', 'front_end/core/sdk/FirstFile.js'),
|
20
|
+
{id: path.join('front_end', 'core', 'common', 'common.js'), external: true});
|
21
|
+
});
|
22
|
+
|
23
|
+
it('node built-in modules', () => {
|
24
|
+
assert.deepEqual(devtoolsPlugin('fs', 'scripts/some-script.js'), {id: 'fs', external: true});
|
25
|
+
});
|
26
|
+
|
27
|
+
it('importing generated files', () => {
|
28
|
+
assert.strictEqual(devtoolsPlugin('../../generated/Protocol.js', 'front_end/core/sdk/FirstFile.js'), null);
|
29
|
+
});
|
30
|
+
});
|
@@ -34,16 +34,6 @@ const os = require('os');
|
|
34
34
|
*/
|
35
35
|
const PATH_TO_EXECUTED_FILE = process.argv[1];
|
36
36
|
|
37
|
-
function pathIsMostTopLevelPath(filePath) {
|
38
|
-
/**
|
39
|
-
* On Linux/Mac, if we do path.dirname(X) as many times as possible, it will
|
40
|
-
* eventually equal `/`. On Windows, it will end up equalling C:\, and
|
41
|
-
* path.dirname('C:\') === 'C:\', so we use that to figure out if we've made
|
42
|
-
* it as far up the tree as we can.
|
43
|
-
*/
|
44
|
-
return filePath === path.sep || path.dirname(filePath) === filePath;
|
45
|
-
}
|
46
|
-
|
47
37
|
const _lookUpCaches = new Map(
|
48
38
|
[['chromium', null]],
|
49
39
|
);
|
@@ -73,25 +63,7 @@ function isInChromiumDirectory() {
|
|
73
63
|
* If it's standalone, it will be /path/to/devtools-frontend
|
74
64
|
*/
|
75
65
|
function devtoolsRootPath() {
|
76
|
-
|
77
|
-
let devtoolsRootFolder = nodeScriptFileThatIsBeingExecuted;
|
78
|
-
while (path.basename(devtoolsRootFolder) !== 'devtools-frontend') {
|
79
|
-
devtoolsRootFolder = path.dirname(devtoolsRootFolder);
|
80
|
-
// We reached the end and can't find devtools-frontend.
|
81
|
-
if (pathIsMostTopLevelPath(devtoolsRootFolder)) {
|
82
|
-
throw new Error(
|
83
|
-
'Could not find devtools-frontend in path. If you have cloned the repository to a different directory name, it will not work.');
|
84
|
-
}
|
85
|
-
}
|
86
|
-
// In Chromium the path to the source code for devtools-frontend is:
|
87
|
-
// third_party/devtools-frontend/src
|
88
|
-
const {isInChromium} = isInChromiumDirectory();
|
89
|
-
if (isInChromium) {
|
90
|
-
return path.join(devtoolsRootFolder, 'src');
|
91
|
-
}
|
92
|
-
|
93
|
-
// But if you're in a standalone repo it's just the devtools-frontend folder.
|
94
|
-
return devtoolsRootFolder;
|
66
|
+
return path.dirname(__dirname);
|
95
67
|
}
|
96
68
|
|
97
69
|
/**
|