chrome-devtools-frontend 1.0.976570 → 1.0.977952
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 +4 -1
- package/front_end/core/host/UserMetrics.ts +46 -24
- package/front_end/core/i18n/locales/af.json +5 -5
- package/front_end/core/i18n/locales/am.json +5 -5
- package/front_end/core/i18n/locales/ar.json +5 -5
- package/front_end/core/i18n/locales/as.json +5 -5
- package/front_end/core/i18n/locales/az.json +5 -5
- package/front_end/core/i18n/locales/be.json +5 -5
- package/front_end/core/i18n/locales/bg.json +5 -5
- package/front_end/core/i18n/locales/bn.json +5 -5
- package/front_end/core/i18n/locales/bs.json +5 -5
- package/front_end/core/i18n/locales/ca.json +5 -5
- package/front_end/core/i18n/locales/cs.json +5 -5
- package/front_end/core/i18n/locales/cy.json +5 -5
- package/front_end/core/i18n/locales/da.json +5 -5
- package/front_end/core/i18n/locales/de.json +5 -5
- package/front_end/core/i18n/locales/el.json +5 -5
- package/front_end/core/i18n/locales/en-GB.json +5 -5
- package/front_end/core/i18n/locales/en-US.json +24 -15
- package/front_end/core/i18n/locales/en-XL.json +24 -15
- package/front_end/core/i18n/locales/es-419.json +5 -5
- package/front_end/core/i18n/locales/es.json +5 -5
- package/front_end/core/i18n/locales/et.json +5 -5
- package/front_end/core/i18n/locales/eu.json +5 -5
- package/front_end/core/i18n/locales/fa.json +5 -5
- package/front_end/core/i18n/locales/fi.json +5 -5
- package/front_end/core/i18n/locales/fil.json +5 -5
- package/front_end/core/i18n/locales/fr-CA.json +5 -5
- package/front_end/core/i18n/locales/fr.json +5 -5
- package/front_end/core/i18n/locales/gl.json +5 -5
- package/front_end/core/i18n/locales/gu.json +5 -5
- package/front_end/core/i18n/locales/he.json +5 -5
- package/front_end/core/i18n/locales/hi.json +5 -5
- package/front_end/core/i18n/locales/hr.json +5 -5
- package/front_end/core/i18n/locales/hu.json +5 -5
- package/front_end/core/i18n/locales/hy.json +5 -5
- package/front_end/core/i18n/locales/id.json +5 -5
- package/front_end/core/i18n/locales/is.json +5 -5
- package/front_end/core/i18n/locales/it.json +5 -5
- package/front_end/core/i18n/locales/ja.json +5 -5
- package/front_end/core/i18n/locales/ka.json +5 -5
- package/front_end/core/i18n/locales/kk.json +5 -5
- package/front_end/core/i18n/locales/km.json +5 -5
- package/front_end/core/i18n/locales/kn.json +5 -5
- package/front_end/core/i18n/locales/ko.json +5 -5
- package/front_end/core/i18n/locales/ky.json +5 -5
- package/front_end/core/i18n/locales/lo.json +5 -5
- package/front_end/core/i18n/locales/lt.json +5 -5
- package/front_end/core/i18n/locales/lv.json +5 -5
- package/front_end/core/i18n/locales/mk.json +5 -5
- package/front_end/core/i18n/locales/ml.json +5 -5
- package/front_end/core/i18n/locales/mn.json +5 -5
- package/front_end/core/i18n/locales/mr.json +5 -5
- package/front_end/core/i18n/locales/ms.json +5 -5
- package/front_end/core/i18n/locales/my.json +5 -5
- package/front_end/core/i18n/locales/ne.json +5 -5
- package/front_end/core/i18n/locales/nl.json +5 -5
- package/front_end/core/i18n/locales/no.json +5 -5
- package/front_end/core/i18n/locales/or.json +5 -5
- package/front_end/core/i18n/locales/pa.json +5 -5
- package/front_end/core/i18n/locales/pl.json +5 -5
- package/front_end/core/i18n/locales/pt-PT.json +5 -5
- package/front_end/core/i18n/locales/pt.json +5 -5
- package/front_end/core/i18n/locales/ro.json +5 -5
- package/front_end/core/i18n/locales/ru.json +5 -5
- package/front_end/core/i18n/locales/si.json +5 -5
- package/front_end/core/i18n/locales/sk.json +5 -5
- package/front_end/core/i18n/locales/sl.json +5 -5
- package/front_end/core/i18n/locales/sq.json +5 -5
- package/front_end/core/i18n/locales/sr-Latn.json +5 -5
- package/front_end/core/i18n/locales/sr.json +5 -5
- package/front_end/core/i18n/locales/sv.json +5 -5
- package/front_end/core/i18n/locales/sw.json +5 -5
- package/front_end/core/i18n/locales/ta.json +5 -5
- package/front_end/core/i18n/locales/te.json +5 -5
- package/front_end/core/i18n/locales/th.json +5 -5
- package/front_end/core/i18n/locales/tr.json +5 -5
- package/front_end/core/i18n/locales/uk.json +5 -5
- package/front_end/core/i18n/locales/ur.json +5 -5
- package/front_end/core/i18n/locales/uz.json +5 -5
- package/front_end/core/i18n/locales/vi.json +5 -5
- package/front_end/core/i18n/locales/zh-HK.json +5 -5
- package/front_end/core/i18n/locales/zh-TW.json +5 -5
- package/front_end/core/i18n/locales/zh.json +5 -5
- package/front_end/core/i18n/locales/zu.json +5 -5
- package/front_end/core/sdk/CSSContainerQuery.ts +1 -1
- package/front_end/core/sdk/CSSModel.ts +9 -9
- package/front_end/generated/InspectorBackendCommands.js +6 -5
- package/front_end/generated/protocol.ts +10 -9
- package/front_end/models/issues_manager/{SameSiteCookieIssue.ts → CookieIssue.ts} +75 -79
- 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/NavigatorUserAgentIssue.ts +1 -1
- package/front_end/models/issues_manager/issues_manager.ts +2 -2
- package/front_end/models/persistence/NetworkPersistenceManager.ts +4 -4
- package/front_end/panels/application/ApplicationPanelCacheSection.ts +3 -0
- package/front_end/panels/application/ApplicationPanelSidebar.ts +15 -0
- package/front_end/panels/application/InterestGroupTreeElement.ts +2 -0
- package/front_end/panels/application/ReportingApiTreeElement.ts +2 -0
- package/front_end/panels/application/TrustTokensTreeElement.ts +2 -0
- package/front_end/panels/application/components/BackForwardCacheView.ts +23 -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 +1 -1
- 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 +2 -3
- 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/sources/CSSPlugin.ts +1 -1
- package/front_end/panels/sources/SourcesView.ts +23 -10
- package/front_end/panels/sources/components/HeadersView.css +84 -0
- package/front_end/panels/sources/components/HeadersView.ts +300 -0
- package/front_end/panels/sources/components/components.ts +9 -0
- package/front_end/panels/timeline/TimelineController.ts +17 -5
- package/front_end/ui/components/expandable_list/expandableList.css +10 -0
- package/front_end/ui/components/text_editor/javascript.ts +46 -1
- package/package.json +1 -1
@@ -831,6 +831,7 @@ export class BackgroundServiceTreeElement extends ApplicationPanelTreeElement {
|
|
831
831
|
}
|
832
832
|
this.showView(this.view);
|
833
833
|
UI.Context.Context.instance().setFlavor(BackgroundServiceView, this.view);
|
834
|
+
Host.userMetrics.panelShown('background_service_' + this.serviceName);
|
834
835
|
return false;
|
835
836
|
}
|
836
837
|
}
|
@@ -854,6 +855,7 @@ export class DatabaseTreeElement extends ApplicationPanelTreeElement {
|
|
854
855
|
onselect(selectedByUser?: boolean): boolean {
|
855
856
|
super.onselect(selectedByUser);
|
856
857
|
this.sidebar.showDatabase(this.database);
|
858
|
+
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.web_sql]);
|
857
859
|
return false;
|
858
860
|
}
|
859
861
|
|
@@ -891,6 +893,7 @@ export class DatabaseTableTreeElement extends ApplicationPanelTreeElement {
|
|
891
893
|
onselect(selectedByUser?: boolean): boolean {
|
892
894
|
super.onselect(selectedByUser);
|
893
895
|
this.sidebar.showDatabase(this.database, this.tableName);
|
896
|
+
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.web_sql]);
|
894
897
|
return false;
|
895
898
|
}
|
896
899
|
}
|
@@ -914,6 +917,7 @@ export class ServiceWorkersTreeElement extends ApplicationPanelTreeElement {
|
|
914
917
|
this.view = new ServiceWorkersView();
|
915
918
|
}
|
916
919
|
this.showView(this.view);
|
920
|
+
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.service_workers]);
|
917
921
|
return false;
|
918
922
|
}
|
919
923
|
}
|
@@ -936,6 +940,7 @@ export class AppManifestTreeElement extends ApplicationPanelTreeElement {
|
|
936
940
|
this.view = new AppManifestView();
|
937
941
|
}
|
938
942
|
this.showView(this.view);
|
943
|
+
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.app_manifest]);
|
939
944
|
return false;
|
940
945
|
}
|
941
946
|
}
|
@@ -958,6 +963,7 @@ export class ClearStorageTreeElement extends ApplicationPanelTreeElement {
|
|
958
963
|
this.view = new StorageView();
|
959
964
|
}
|
960
965
|
this.showView(this.view);
|
966
|
+
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.storage]);
|
961
967
|
return false;
|
962
968
|
}
|
963
969
|
}
|
@@ -1170,6 +1176,7 @@ export class IDBDatabaseTreeElement extends ApplicationPanelTreeElement {
|
|
1170
1176
|
}
|
1171
1177
|
|
1172
1178
|
this.showView(this.view);
|
1179
|
+
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.indexed_db]);
|
1173
1180
|
return false;
|
1174
1181
|
}
|
1175
1182
|
|
@@ -1302,6 +1309,7 @@ export class IDBObjectStoreTreeElement extends ApplicationPanelTreeElement {
|
|
1302
1309
|
}
|
1303
1310
|
|
1304
1311
|
this.showView(this.view);
|
1312
|
+
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.indexed_db]);
|
1305
1313
|
return false;
|
1306
1314
|
}
|
1307
1315
|
|
@@ -1391,6 +1399,7 @@ export class IDBIndexTreeElement extends ApplicationPanelTreeElement {
|
|
1391
1399
|
}
|
1392
1400
|
|
1393
1401
|
this.showView(this.view);
|
1402
|
+
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.indexed_db]);
|
1394
1403
|
return false;
|
1395
1404
|
}
|
1396
1405
|
|
@@ -1417,6 +1426,7 @@ export class DOMStorageTreeElement extends ApplicationPanelTreeElement {
|
|
1417
1426
|
|
1418
1427
|
onselect(selectedByUser?: boolean): boolean {
|
1419
1428
|
super.onselect(selectedByUser);
|
1429
|
+
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.dom_storage]);
|
1420
1430
|
this.resourcesPanel.showDOMStorage(this.domStorage);
|
1421
1431
|
return false;
|
1422
1432
|
}
|
@@ -1469,6 +1479,7 @@ export class CookieTreeElement extends ApplicationPanelTreeElement {
|
|
1469
1479
|
onselect(selectedByUser?: boolean): boolean {
|
1470
1480
|
super.onselect(selectedByUser);
|
1471
1481
|
this.resourcesPanel.showCookies(this.target, this.cookieDomainInternal);
|
1482
|
+
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.cookies]);
|
1472
1483
|
return false;
|
1473
1484
|
}
|
1474
1485
|
}
|
@@ -1810,6 +1821,7 @@ export class FrameTreeElement extends ApplicationPanelTreeElement {
|
|
1810
1821
|
} else {
|
1811
1822
|
this.view.update();
|
1812
1823
|
}
|
1824
|
+
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.frame_details]);
|
1813
1825
|
this.showView(this.view);
|
1814
1826
|
|
1815
1827
|
this.listItemElement.classList.remove('hovered');
|
@@ -1978,6 +1990,7 @@ export class FrameResourceTreeElement extends ApplicationPanelTreeElement {
|
|
1978
1990
|
} else {
|
1979
1991
|
void this.panel.scheduleShowView(this.preparePreview());
|
1980
1992
|
}
|
1993
|
+
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.frame_resource]);
|
1981
1994
|
return false;
|
1982
1995
|
}
|
1983
1996
|
|
@@ -2065,6 +2078,7 @@ class FrameWindowTreeElement extends ApplicationPanelTreeElement {
|
|
2065
2078
|
this.view.update();
|
2066
2079
|
}
|
2067
2080
|
this.showView(this.view);
|
2081
|
+
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.frame_window]);
|
2068
2082
|
return false;
|
2069
2083
|
}
|
2070
2084
|
|
@@ -2093,6 +2107,7 @@ class WorkerTreeElement extends ApplicationPanelTreeElement {
|
|
2093
2107
|
this.view.update();
|
2094
2108
|
}
|
2095
2109
|
this.showView(this.view);
|
2110
|
+
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.frame_worker]);
|
2096
2111
|
return false;
|
2097
2112
|
}
|
2098
2113
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
3
3
|
// found in the LICENSE file.
|
4
4
|
|
5
|
+
import * as Host from '../../core/host/host.js';
|
5
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
6
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
7
8
|
import * as UI from '../../ui/legacy/legacy.js';
|
@@ -51,6 +52,7 @@ export class InterestGroupTreeElement extends ApplicationPanelTreeElement {
|
|
51
52
|
onselect(selectedByUser?: boolean): boolean {
|
52
53
|
super.onselect(selectedByUser);
|
53
54
|
this.showView(this.view);
|
55
|
+
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.interest_groups]);
|
54
56
|
return false;
|
55
57
|
}
|
56
58
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
3
3
|
// found in the LICENSE file.
|
4
4
|
|
5
|
+
import * as Host from '../../core/host/host.js';
|
5
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
6
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
7
8
|
|
@@ -37,6 +38,7 @@ export class ReportingApiTreeElement extends ApplicationPanelTreeElement {
|
|
37
38
|
this.view = new ReportingApiView();
|
38
39
|
}
|
39
40
|
this.showView(this.view);
|
41
|
+
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.reporting_api]);
|
40
42
|
return false;
|
41
43
|
}
|
42
44
|
}
|
@@ -9,6 +9,7 @@ import * as UI from '../../ui/legacy/legacy.js';
|
|
9
9
|
import {ApplicationPanelTreeElement} from './ApplicationPanelTreeElement.js';
|
10
10
|
import * as ApplicationComponents from './components/components.js';
|
11
11
|
import type {ResourcesPanel} from './ResourcesPanel.js';
|
12
|
+
import * as Host from '../../core/host/host.js';
|
12
13
|
|
13
14
|
const UIStrings = {
|
14
15
|
/**
|
@@ -41,6 +42,7 @@ export class TrustTokensTreeElement extends ApplicationPanelTreeElement {
|
|
41
42
|
this.view = new TrustTokensViewWidgetWrapper();
|
42
43
|
}
|
43
44
|
this.showView(this.view);
|
45
|
+
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.trust_tokens]);
|
44
46
|
return false;
|
45
47
|
}
|
46
48
|
}
|
@@ -13,6 +13,7 @@ import * as Protocol from '../../../generated/protocol.js';
|
|
13
13
|
import * as IconButton from '../../../ui/components/icon_button/icon_button.js';
|
14
14
|
import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
|
15
15
|
import * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';
|
16
|
+
import * as ChromeLink from '../../../ui/components/chrome_link/chrome_link.js';
|
16
17
|
|
17
18
|
import {NotRestoredReasonDescription} from './BackForwardCacheStrings.js';
|
18
19
|
import backForwardCacheViewStyles from './backForwardCacheView.css.js';
|
@@ -97,6 +98,10 @@ const UIStrings = {
|
|
97
98
|
*/
|
98
99
|
supportPendingExplanation:
|
99
100
|
'Chrome support for these reasons is pending i.e. they will not prevent the page from being eligible for back/forward cache in a future version of Chrome.',
|
101
|
+
/**
|
102
|
+
* @description Text that precedes displaying a link to the extension which blocked the page from being eligible for back/forward cache.
|
103
|
+
*/
|
104
|
+
blockingExtensionId: 'Extension id: ',
|
100
105
|
};
|
101
106
|
const str_ = i18n.i18n.registerUIStrings('panels/application/components/BackForwardCacheView.ts', UIStrings);
|
102
107
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
@@ -370,6 +375,20 @@ export class BackForwardCacheView extends HTMLElement {
|
|
370
375
|
// clang-format on
|
371
376
|
}
|
372
377
|
|
378
|
+
#maybeRenderReasonContext(explanation: Protocol.Page.BackForwardCacheNotRestoredExplanation): LitHtml.TemplateResult|
|
379
|
+
{} {
|
380
|
+
if (explanation.reason ===
|
381
|
+
Protocol.Page.BackForwardCacheNotRestoredReason.EmbedderExtensionSentMessageToCachedFrame &&
|
382
|
+
explanation.context) {
|
383
|
+
const link = 'chrome://extensions/?id=' + explanation.context;
|
384
|
+
// clang-format off
|
385
|
+
return LitHtml.html`${i18nString(UIStrings.blockingExtensionId)}
|
386
|
+
<${ChromeLink.ChromeLink.ChromeLink.litTagName} .href=${link}>${explanation.context}</${ChromeLink.ChromeLink.ChromeLink.litTagName}>`;
|
387
|
+
// clang-format on
|
388
|
+
}
|
389
|
+
return LitHtml.nothing;
|
390
|
+
}
|
391
|
+
|
373
392
|
#renderReason(explanation: Protocol.Page.BackForwardCacheNotRestoredExplanation): LitHtml.TemplateResult {
|
374
393
|
// clang-format off
|
375
394
|
return LitHtml.html`
|
@@ -385,7 +404,10 @@ export class BackForwardCacheView extends HTMLElement {
|
|
385
404
|
} as IconButton.Icon.IconData}>
|
386
405
|
</${IconButton.Icon.Icon.litTagName}>
|
387
406
|
</div>
|
388
|
-
|
407
|
+
<div>
|
408
|
+
${NotRestoredReasonDescription[explanation.reason].name()}
|
409
|
+
${this.#maybeRenderReasonContext(explanation)}
|
410
|
+
</div>` :
|
389
411
|
LitHtml.nothing}
|
390
412
|
</${ReportView.ReportView.ReportSection.litTagName}>
|
391
413
|
<div class='gray-text'>
|
@@ -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
|
}
|
@@ -97,7 +97,7 @@ export class LayersWidget extends UI.Widget.Widget {
|
|
97
97
|
Promise.resolve(subLayers.sort((layer1, layer2) => layer1.order - layer2.order).map(makeTreeNode(id))),
|
98
98
|
};
|
99
99
|
};
|
100
|
-
const rootLayer = await this.cssModel.
|
100
|
+
const rootLayer = await this.cssModel.getRootLayer(node.id);
|
101
101
|
this.layerTreeComponent.data = {
|
102
102
|
defaultRenderer: TreeOutline.TreeOutline.defaultRenderer,
|
103
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
|
}
|
@@ -3195,13 +3195,12 @@ export class CSSPropertyPrompt extends UI.TextPrompt.TextPrompt {
|
|
3195
3195
|
if (!node || this.selectedNodeComputedStyles) {
|
3196
3196
|
return;
|
3197
3197
|
}
|
3198
|
-
this.selectedNodeComputedStyles = await node.domModel().cssModel().
|
3198
|
+
this.selectedNodeComputedStyles = await node.domModel().cssModel().getComputedStyle(node.id);
|
3199
3199
|
const parentNode = node.parentNode;
|
3200
3200
|
if (parentNode) {
|
3201
|
-
this.parentNodeComputedStyles = await parentNode.domModel().cssModel().
|
3201
|
+
this.parentNodeComputedStyles = await parentNode.domModel().cssModel().getComputedStyle(parentNode.id);
|
3202
3202
|
}
|
3203
3203
|
};
|
3204
|
-
|
3205
3204
|
for (const result of results) {
|
3206
3205
|
await ensureComputedStyles();
|
3207
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()) {
|
@@ -69,7 +69,7 @@ async function specificCssCompletion(
|
|
69
69
|
assertNotNullOrUndefined(cssModel);
|
70
70
|
|
71
71
|
const currentStyleSheet = getCurrentStyleSheet(uiSourceCode.url(), cssModel);
|
72
|
-
const existingClassNames = await cssModel.
|
72
|
+
const existingClassNames = await cssModel.getClassNames(currentStyleSheet);
|
73
73
|
|
74
74
|
return {
|
75
75
|
from: node.from,
|
@@ -12,6 +12,7 @@ import * as QuickOpen from '../../ui/legacy/components/quick_open/quick_open.js'
|
|
12
12
|
import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
13
13
|
import * as UI from '../../ui/legacy/legacy.js';
|
14
14
|
|
15
|
+
import * as Components from './components/components.js';
|
15
16
|
import {EditingLocationHistoryManager} from './EditingLocationHistoryManager.js';
|
16
17
|
import sourcesViewStyles from './sourcesView.css.js';
|
17
18
|
|
@@ -377,6 +378,10 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
377
378
|
sourceView = new SourceFrame.ImageView.ImageView(uiSourceCode.mimeType(), uiSourceCode);
|
378
379
|
} else if (contentType === Common.ResourceType.resourceTypes.Font) {
|
379
380
|
sourceView = new SourceFrame.FontView.FontView(uiSourceCode.mimeType(), uiSourceCode);
|
381
|
+
} else if (
|
382
|
+
uiSourceCode.name() === HEADER_OVERRIDES_FILENAME &&
|
383
|
+
Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.HEADER_OVERRIDES)) {
|
384
|
+
sourceView = new Components.HeadersView.HeadersView(uiSourceCode);
|
380
385
|
} else {
|
381
386
|
sourceFrame = new UISourceCodeFrame(uiSourceCode);
|
382
387
|
}
|
@@ -399,10 +404,18 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
399
404
|
if (widget instanceof SourceFrame.FontView.FontView) {
|
400
405
|
return SourceViewType.FontView;
|
401
406
|
}
|
407
|
+
if (widget instanceof Components.HeadersView.HeadersView) {
|
408
|
+
return SourceViewType.HeadersView;
|
409
|
+
}
|
402
410
|
return SourceViewType.SourceView;
|
403
411
|
}
|
404
412
|
|
405
|
-
#
|
413
|
+
#sourceViewTypeForUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode): SourceViewType {
|
414
|
+
if (uiSourceCode.name() === HEADER_OVERRIDES_FILENAME &&
|
415
|
+
Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.HEADER_OVERRIDES)) {
|
416
|
+
return SourceViewType.HeadersView;
|
417
|
+
}
|
418
|
+
const contentType = uiSourceCode.contentType();
|
406
419
|
switch (contentType) {
|
407
420
|
case Common.ResourceType.resourceTypes.Image:
|
408
421
|
return SourceViewType.ImageView;
|
@@ -417,8 +430,7 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
417
430
|
const uiSourceCode = event.data;
|
418
431
|
const widget = this.sourceViewByUISourceCode.get(uiSourceCode);
|
419
432
|
if (widget) {
|
420
|
-
|
421
|
-
if (this.#sourceViewTypeForWidget(widget) !== this.#sourceViewTypeForContentType(contentType)) {
|
433
|
+
if (this.#sourceViewTypeForWidget(widget) !== this.#sourceViewTypeForUISourceCode(uiSourceCode)) {
|
422
434
|
// Remove the exisiting editor tab and create a new one of the correct type.
|
423
435
|
this.removeUISourceCodes([uiSourceCode]);
|
424
436
|
this.showSourceLocation(uiSourceCode);
|
@@ -602,20 +614,18 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
602
614
|
}
|
603
615
|
|
604
616
|
save(): void {
|
605
|
-
this.
|
617
|
+
this.saveSourceView(this.visibleView());
|
606
618
|
}
|
607
619
|
|
608
620
|
saveAll(): void {
|
609
621
|
const sourceFrames = this.editorContainer.fileViews();
|
610
|
-
sourceFrames.forEach(this.
|
622
|
+
sourceFrames.forEach(this.saveSourceView.bind(this));
|
611
623
|
}
|
612
624
|
|
613
|
-
private
|
614
|
-
if (
|
615
|
-
|
625
|
+
private saveSourceView(sourceView: UI.Widget.Widget|null): void {
|
626
|
+
if (sourceView instanceof UISourceCodeFrame || sourceView instanceof Components.HeadersView.HeadersView) {
|
627
|
+
sourceView.commitEditing();
|
616
628
|
}
|
617
|
-
const uiSourceCodeFrame = (sourceFrame as UISourceCodeFrame);
|
618
|
-
uiSourceCodeFrame.commitEditing();
|
619
629
|
}
|
620
630
|
|
621
631
|
toggleBreakpointsActiveState(active: boolean): void {
|
@@ -764,9 +774,12 @@ export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
|
|
764
774
|
}
|
765
775
|
}
|
766
776
|
|
777
|
+
const HEADER_OVERRIDES_FILENAME = '.headers';
|
778
|
+
|
767
779
|
// eslint-disable-next-line rulesdir/const_enum
|
768
780
|
enum SourceViewType {
|
769
781
|
ImageView = 'ImageView',
|
770
782
|
FontView = 'FontView',
|
783
|
+
HeadersView = 'HeadersView',
|
771
784
|
SourceView = 'SourceView',
|
772
785
|
}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2022 The Chromium Authors. All rights reserved.
|
3
|
+
* Use of this source code is governed by a BSD-style license that can be
|
4
|
+
* found in the LICENSE file.
|
5
|
+
*/
|
6
|
+
|
7
|
+
:host {
|
8
|
+
flex-grow: 1;
|
9
|
+
}
|
10
|
+
|
11
|
+
.row {
|
12
|
+
display: flex;
|
13
|
+
flex-direction: row;
|
14
|
+
color: var(--color-syntax-1);
|
15
|
+
font-family: var(--monospace-font-family);
|
16
|
+
font-size: var(--monospace-font-size);
|
17
|
+
align-items: center;
|
18
|
+
line-height: 18px;
|
19
|
+
margin: 2em 0 0 0.5em;
|
20
|
+
}
|
21
|
+
|
22
|
+
.row:first-child {
|
23
|
+
margin-top: 0.5em;
|
24
|
+
}
|
25
|
+
|
26
|
+
.row devtools-button {
|
27
|
+
line-height: 1;
|
28
|
+
margin-left: 0.5em;
|
29
|
+
}
|
30
|
+
|
31
|
+
.padded {
|
32
|
+
margin: 0.25em 0 0 2em;
|
33
|
+
}
|
34
|
+
|
35
|
+
.separator {
|
36
|
+
margin-right: 0.5em;
|
37
|
+
color: var(--color-text-primary);
|
38
|
+
}
|
39
|
+
|
40
|
+
.editable {
|
41
|
+
cursor: text;
|
42
|
+
color: var(--color-text-primary);
|
43
|
+
overflow-wrap: anywhere;
|
44
|
+
min-height: 18px;
|
45
|
+
line-height: 18px;
|
46
|
+
min-width: 0.5em;
|
47
|
+
background: transparent;
|
48
|
+
border: none;
|
49
|
+
outline: none;
|
50
|
+
display: inline-block;
|
51
|
+
}
|
52
|
+
|
53
|
+
.editable.red {
|
54
|
+
color: var(--color-syntax-1);
|
55
|
+
}
|
56
|
+
|
57
|
+
.editable:hover,
|
58
|
+
.editable:focus {
|
59
|
+
box-shadow: 0 0 0 1px var(--color-details-hairline);
|
60
|
+
border-radius: 2px;
|
61
|
+
}
|
62
|
+
|
63
|
+
.center-wrapper {
|
64
|
+
height: 100%;
|
65
|
+
display: flex;
|
66
|
+
justify-content: center;
|
67
|
+
align-items: center;
|
68
|
+
}
|
69
|
+
|
70
|
+
.centered {
|
71
|
+
margin: 1em;
|
72
|
+
max-width: 300px;
|
73
|
+
text-align: center;
|
74
|
+
}
|
75
|
+
|
76
|
+
.error-header {
|
77
|
+
font-weight: bold;
|
78
|
+
margin-bottom: 1em;
|
79
|
+
}
|
80
|
+
|
81
|
+
.error-body {
|
82
|
+
line-height: 1.5em;
|
83
|
+
color: var(--color-text-secondary);
|
84
|
+
}
|