chrome-devtools-frontend 1.0.1539972 → 1.0.1541552
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/eslint.config.mjs +167 -151
- package/front_end/Tests.js +5 -1
- package/front_end/core/common/Revealer.ts +5 -0
- package/front_end/core/common/Settings.ts +106 -95
- package/front_end/core/host/InspectorFrontendHost.ts +10 -10
- package/front_end/core/sdk/NetworkManager.ts +16 -11
- package/front_end/core/sdk/sdk-meta.ts +0 -35
- package/front_end/entrypoints/main/MainImpl.ts +15 -7
- package/front_end/entrypoints/shell/shell.ts +1 -0
- package/front_end/entrypoints/trace_app/trace_app.ts +1 -0
- package/front_end/foundation/README.md +10 -0
- package/front_end/foundation/Universe.ts +29 -0
- package/front_end/foundation/foundation.ts +7 -0
- package/front_end/generated/InspectorBackendCommands.ts +6 -3
- package/front_end/generated/SupportedCSSProperties.js +13 -0
- package/front_end/generated/protocol.ts +58 -2
- package/front_end/models/ai_assistance/BuiltInAi.ts +2 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +44 -34
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +121 -56
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +104 -62
- package/front_end/models/ai_assistance/performance/AIQueries.ts +56 -2
- package/front_end/{panels/issues → models/issues_manager}/IssueAggregator.ts +83 -65
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/trace/Processor.ts +5 -4
- package/front_end/models/trace/insights/types.ts +1 -1
- package/front_end/models/trace/types/TraceEvents.ts +1 -1
- package/front_end/models/workspace/IgnoreListManager.ts +41 -47
- package/front_end/models/workspace/workspace-meta.ts +40 -0
- package/front_end/panels/ai_assistance/components/MarkdownRendererWithCodeBlock.ts +1 -1
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +1 -1
- package/front_end/panels/animation/AnimationTimeline.ts +4 -4
- package/front_end/panels/animation/AnimationUI.ts +28 -34
- package/front_end/panels/elements/ElementsTreeElement.ts +37 -9
- package/front_end/panels/elements/LayoutPane.ts +2 -2
- package/front_end/panels/elements/components/AdornerManager.ts +9 -9
- package/front_end/panels/elements/layoutPane.css +5 -9
- package/front_end/panels/event_listeners/EventListenersView.ts +1 -1
- package/front_end/panels/explain/components/ConsoleInsight.ts +498 -449
- package/front_end/panels/issues/AffectedResourcesView.ts +3 -4
- package/front_end/panels/issues/CorsIssueDetailsView.ts +1 -2
- package/front_end/panels/issues/IssueView.ts +1 -1
- package/front_end/panels/issues/IssuesPane.ts +12 -15
- package/front_end/panels/issues/issues.ts +0 -2
- package/front_end/panels/network/NetworkDataGridNode.ts +2 -1
- package/front_end/panels/network/RequestConditionsDrawer.ts +149 -46
- package/front_end/panels/network/RequestTimingView.ts +13 -8
- package/front_end/panels/network/network-meta.ts +11 -0
- package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +1 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +1 -1
- package/front_end/panels/sources/breakpointsView.css +1 -1
- package/front_end/panels/sources/sourcesPanel.css +2 -2
- package/front_end/panels/timeline/TimelineFlameChartView.ts +3 -3
- package/front_end/panels/timeline/TimelinePanel.ts +3 -3
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +16 -10
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +2 -0
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +4 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +4 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/package.json +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +3 -1
- package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownView.ts +6 -6
- package/front_end/ui/components/snackbars/Snackbars.docs.ts +46 -0
- package/front_end/ui/{components/docs/context_menu/basic.ts → legacy/ContextMenu.docs.ts} +58 -25
- package/front_end/ui/legacy/UIUtils.ts +2 -1
- package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +148 -125
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +3 -3
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +1 -1
- package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +3 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/mcp/mcp.ts +16 -0
- package/package.json +2 -1
- package/front_end/ui/components/docs/context_menu/basic.html +0 -45
- package/front_end/ui/components/docs/linkifier/simple-url.html +0 -25
- package/front_end/ui/components/docs/linkifier/simple-url.ts +0 -25
- package/front_end/ui/components/docs/panel_feedback/basic.html +0 -25
- package/front_end/ui/components/docs/panel_feedback/basic.ts +0 -21
- package/front_end/ui/components/docs/panel_feedback/button.html +0 -25
- package/front_end/ui/components/docs/panel_feedback/button.ts +0 -19
- package/front_end/ui/components/docs/panel_introduction_steps/basic.html +0 -25
- package/front_end/ui/components/docs/panel_introduction_steps/basic.ts +0 -28
- package/front_end/ui/components/docs/perf_piechart/basic-with-legend.html +0 -20
- package/front_end/ui/components/docs/perf_piechart/basic-with-legend.ts +0 -20
- package/front_end/ui/components/docs/perf_piechart/basic-without-legend.html +0 -20
- package/front_end/ui/components/docs/perf_piechart/basic-without-legend.ts +0 -18
- package/front_end/ui/components/docs/snackbars/basic.html +0 -17
- package/front_end/ui/components/docs/snackbars/basic.ts +0 -50
package/front_end/Tests.js
CHANGED
|
@@ -952,7 +952,11 @@
|
|
|
952
952
|
}
|
|
953
953
|
|
|
954
954
|
function gotPreferences(prefs) {
|
|
955
|
-
|
|
955
|
+
Common.Settings.Settings.instance({
|
|
956
|
+
forceNew: true,
|
|
957
|
+
...Main.Main.instanceForTest.createSettingsStorage(prefs),
|
|
958
|
+
runSettingsMigration: false,
|
|
959
|
+
});
|
|
956
960
|
|
|
957
961
|
const localSetting = Common.Settings.Settings.instance().createLocalSetting('local', undefined);
|
|
958
962
|
test.assertEquals('object', typeof localSetting.get());
|
|
@@ -26,6 +26,10 @@ const UIStrings = {
|
|
|
26
26
|
* @description The UI destination when right clicking an item that can be revealed
|
|
27
27
|
*/
|
|
28
28
|
networkPanel: 'Network panel',
|
|
29
|
+
/**
|
|
30
|
+
* @description The UI destination when right clicking an item that can be revealed
|
|
31
|
+
*/
|
|
32
|
+
requestConditionsDrawer: 'Request conditions drawer',
|
|
29
33
|
/**
|
|
30
34
|
* @description The UI destination when right clicking an item that can be revealed
|
|
31
35
|
*/
|
|
@@ -181,6 +185,7 @@ export const RevealerDestination = {
|
|
|
181
185
|
CHANGES_DRAWER: i18nLazyString(UIStrings.changesDrawer),
|
|
182
186
|
ISSUES_VIEW: i18nLazyString(UIStrings.issuesView),
|
|
183
187
|
NETWORK_PANEL: i18nLazyString(UIStrings.networkPanel),
|
|
188
|
+
REQUEST_CONDITIONS_DRAWER: i18nLazyString(UIStrings.requestConditionsDrawer),
|
|
184
189
|
TIMELINE_PANEL: i18nLazyString(UIStrings.timelinePanel),
|
|
185
190
|
APPLICATION_PANEL: i18nLazyString(UIStrings.applicationPanel),
|
|
186
191
|
SOURCES_PANEL: i18nLazyString(UIStrings.sourcesPanel),
|
|
@@ -39,6 +39,7 @@ export class Settings {
|
|
|
39
39
|
readonly globalStorage: SettingsStorage,
|
|
40
40
|
readonly localStorage: SettingsStorage,
|
|
41
41
|
logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>,
|
|
42
|
+
runSettingsMigration?: boolean,
|
|
42
43
|
) {
|
|
43
44
|
this.#logSettingAccess = logSettingAccess;
|
|
44
45
|
|
|
@@ -60,6 +61,10 @@ export class Settings {
|
|
|
60
61
|
|
|
61
62
|
this.registerModuleSetting(setting);
|
|
62
63
|
}
|
|
64
|
+
|
|
65
|
+
if (runSettingsMigration) {
|
|
66
|
+
new VersionController(this).updateVersion();
|
|
67
|
+
}
|
|
63
68
|
}
|
|
64
69
|
|
|
65
70
|
getRegisteredSettings(): SettingRegistration[] {
|
|
@@ -76,14 +81,16 @@ export class Settings {
|
|
|
76
81
|
globalStorage: SettingsStorage|null,
|
|
77
82
|
localStorage: SettingsStorage|null,
|
|
78
83
|
logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>,
|
|
84
|
+
runSettingsMigration?: boolean,
|
|
79
85
|
} = {forceNew: null, syncedStorage: null, globalStorage: null, localStorage: null}): Settings {
|
|
80
|
-
const {forceNew, syncedStorage, globalStorage, localStorage, logSettingAccess} = opts;
|
|
86
|
+
const {forceNew, syncedStorage, globalStorage, localStorage, logSettingAccess, runSettingsMigration} = opts;
|
|
81
87
|
if (!settingsInstance || forceNew) {
|
|
82
88
|
if (!syncedStorage || !globalStorage || !localStorage) {
|
|
83
89
|
throw new Error(`Unable to create settings: global and local storage must be provided: ${new Error().stack}`);
|
|
84
90
|
}
|
|
85
91
|
|
|
86
|
-
settingsInstance =
|
|
92
|
+
settingsInstance =
|
|
93
|
+
new Settings(syncedStorage, globalStorage, localStorage, logSettingAccess, runSettingsMigration);
|
|
87
94
|
}
|
|
88
95
|
|
|
89
96
|
return settingsInstance;
|
|
@@ -186,7 +193,7 @@ export class Settings {
|
|
|
186
193
|
this.globalStorage.removeAll();
|
|
187
194
|
this.syncedStorage.removeAll();
|
|
188
195
|
this.localStorage.removeAll();
|
|
189
|
-
new VersionController().resetToCurrent();
|
|
196
|
+
new VersionController(this).resetToCurrent();
|
|
190
197
|
}
|
|
191
198
|
|
|
192
199
|
private storageFromType(storageType?: SettingStorageType): SettingsStorage {
|
|
@@ -298,16 +305,6 @@ export class SettingsStorage {
|
|
|
298
305
|
}
|
|
299
306
|
}
|
|
300
307
|
|
|
301
|
-
function removeSetting(setting: {name: string, storage: SettingsStorage}): void {
|
|
302
|
-
const name = setting.name;
|
|
303
|
-
const settings = Settings.instance();
|
|
304
|
-
|
|
305
|
-
settings.getRegistry().delete(name);
|
|
306
|
-
settings.moduleSettings.delete(name);
|
|
307
|
-
|
|
308
|
-
setting.storage.remove(name);
|
|
309
|
-
}
|
|
310
|
-
|
|
311
308
|
export class Deprecation {
|
|
312
309
|
readonly disabled: boolean;
|
|
313
310
|
readonly warning: Platform.UIString.LocalizedString;
|
|
@@ -654,17 +651,19 @@ export class VersionController {
|
|
|
654
651
|
|
|
655
652
|
static readonly CURRENT_VERSION = 40;
|
|
656
653
|
|
|
654
|
+
readonly #settings: Settings;
|
|
657
655
|
readonly #globalVersionSetting: Setting<number>;
|
|
658
656
|
readonly #syncedVersionSetting: Setting<number>;
|
|
659
657
|
readonly #localVersionSetting: Setting<number>;
|
|
660
658
|
|
|
661
|
-
constructor() {
|
|
659
|
+
constructor(settings: Settings) {
|
|
660
|
+
this.#settings = settings;
|
|
662
661
|
// If no version setting is found, we initialize with the current version and don't do anything.
|
|
663
|
-
this.#globalVersionSetting =
|
|
662
|
+
this.#globalVersionSetting = this.#settings.createSetting(
|
|
664
663
|
VersionController.GLOBAL_VERSION_SETTING_NAME, VersionController.CURRENT_VERSION, SettingStorageType.GLOBAL);
|
|
665
|
-
this.#syncedVersionSetting =
|
|
664
|
+
this.#syncedVersionSetting = this.#settings.createSetting(
|
|
666
665
|
VersionController.SYNCED_VERSION_SETTING_NAME, VersionController.CURRENT_VERSION, SettingStorageType.SYNCED);
|
|
667
|
-
this.#localVersionSetting =
|
|
666
|
+
this.#localVersionSetting = this.#settings.createSetting(
|
|
668
667
|
VersionController.LOCAL_VERSION_SETTING_NAME, VersionController.CURRENT_VERSION, SettingStorageType.LOCAL);
|
|
669
668
|
}
|
|
670
669
|
|
|
@@ -678,6 +677,15 @@ export class VersionController {
|
|
|
678
677
|
this.#localVersionSetting.set(VersionController.CURRENT_VERSION);
|
|
679
678
|
}
|
|
680
679
|
|
|
680
|
+
#removeSetting(setting: {name: string, storage: SettingsStorage}): void {
|
|
681
|
+
const name = setting.name;
|
|
682
|
+
|
|
683
|
+
this.#settings.getRegistry().delete(name);
|
|
684
|
+
this.#settings.moduleSettings.delete(name);
|
|
685
|
+
|
|
686
|
+
setting.storage.remove(name);
|
|
687
|
+
}
|
|
688
|
+
|
|
681
689
|
/**
|
|
682
690
|
* Runs the appropriate migrations and updates the version settings accordingly.
|
|
683
691
|
*
|
|
@@ -710,22 +718,22 @@ export class VersionController {
|
|
|
710
718
|
}
|
|
711
719
|
|
|
712
720
|
updateVersionFrom0To1(): void {
|
|
713
|
-
this.clearBreakpointsWhenTooMany(
|
|
721
|
+
this.clearBreakpointsWhenTooMany(this.#settings.createLocalSetting('breakpoints', []), 500000);
|
|
714
722
|
}
|
|
715
723
|
|
|
716
724
|
updateVersionFrom1To2(): void {
|
|
717
|
-
|
|
725
|
+
this.#settings.createSetting('previouslyViewedFiles', []).set([]);
|
|
718
726
|
}
|
|
719
727
|
|
|
720
728
|
updateVersionFrom2To3(): void {
|
|
721
|
-
|
|
722
|
-
removeSetting(
|
|
729
|
+
this.#settings.createSetting('fileSystemMapping', {}).set({});
|
|
730
|
+
this.#removeSetting(this.#settings.createSetting('fileMappingEntries', []));
|
|
723
731
|
}
|
|
724
732
|
|
|
725
733
|
updateVersionFrom3To4(): void {
|
|
726
|
-
const advancedMode =
|
|
727
|
-
moduleSetting('showAdvancedHeapSnapshotProperties').set(advancedMode.get());
|
|
728
|
-
removeSetting(advancedMode);
|
|
734
|
+
const advancedMode = this.#settings.createSetting('showHeaSnapshotObjectsHiddenProperties', false);
|
|
735
|
+
this.#settings.moduleSetting('showAdvancedHeapSnapshotProperties').set(advancedMode.get());
|
|
736
|
+
this.#removeSetting(advancedMode);
|
|
729
737
|
}
|
|
730
738
|
|
|
731
739
|
updateVersionFrom4To5(): void {
|
|
@@ -756,26 +764,26 @@ export class VersionController {
|
|
|
756
764
|
const oldNameH = oldName + 'H';
|
|
757
765
|
|
|
758
766
|
let newValue: object|null = null;
|
|
759
|
-
const oldSetting =
|
|
767
|
+
const oldSetting = this.#settings.createSetting(oldName, empty);
|
|
760
768
|
if (oldSetting.get() !== empty) {
|
|
761
769
|
newValue = newValue || {};
|
|
762
770
|
// @ts-expect-error
|
|
763
771
|
newValue.vertical = {};
|
|
764
772
|
// @ts-expect-error
|
|
765
773
|
newValue.vertical.size = oldSetting.get();
|
|
766
|
-
removeSetting(oldSetting);
|
|
774
|
+
this.#removeSetting(oldSetting);
|
|
767
775
|
}
|
|
768
|
-
const oldSettingH =
|
|
776
|
+
const oldSettingH = this.#settings.createSetting(oldNameH, empty);
|
|
769
777
|
if (oldSettingH.get() !== empty) {
|
|
770
778
|
newValue = newValue || {};
|
|
771
779
|
// @ts-expect-error
|
|
772
780
|
newValue.horizontal = {};
|
|
773
781
|
// @ts-expect-error
|
|
774
782
|
newValue.horizontal.size = oldSettingH.get();
|
|
775
|
-
removeSetting(oldSettingH);
|
|
783
|
+
this.#removeSetting(oldSettingH);
|
|
776
784
|
}
|
|
777
785
|
if (newValue) {
|
|
778
|
-
|
|
786
|
+
this.#settings.createSetting(newName, {}).set(newValue);
|
|
779
787
|
}
|
|
780
788
|
}
|
|
781
789
|
}
|
|
@@ -788,19 +796,19 @@ export class VersionController {
|
|
|
788
796
|
};
|
|
789
797
|
|
|
790
798
|
for (const oldName in settingNames) {
|
|
791
|
-
const oldSetting =
|
|
799
|
+
const oldSetting = this.#settings.createSetting(oldName, null);
|
|
792
800
|
if (oldSetting.get() === null) {
|
|
793
|
-
removeSetting(oldSetting);
|
|
801
|
+
this.#removeSetting(oldSetting);
|
|
794
802
|
continue;
|
|
795
803
|
}
|
|
796
804
|
|
|
797
805
|
const newName = settingNames[oldName];
|
|
798
806
|
const invert = oldName === 'WebInspector.Drawer.showOnLoad';
|
|
799
807
|
const hidden = oldSetting.get() !== invert;
|
|
800
|
-
removeSetting(oldSetting);
|
|
808
|
+
this.#removeSetting(oldSetting);
|
|
801
809
|
const showMode = hidden ? 'OnlyMain' : 'Both';
|
|
802
810
|
|
|
803
|
-
const newSetting =
|
|
811
|
+
const newSetting = this.#settings.createSetting(newName, {});
|
|
804
812
|
const newValue = newSetting.get() || {};
|
|
805
813
|
|
|
806
814
|
// @ts-expect-error
|
|
@@ -829,7 +837,7 @@ export class VersionController {
|
|
|
829
837
|
const empty = {};
|
|
830
838
|
for (const name in settingNames) {
|
|
831
839
|
const setting =
|
|
832
|
-
|
|
840
|
+
this.#settings.createSetting<{vertical?: {size?: number}, horizontal?: {size?: number}}>(name, empty);
|
|
833
841
|
const value = setting.get();
|
|
834
842
|
if (value === empty) {
|
|
835
843
|
continue;
|
|
@@ -852,7 +860,7 @@ export class VersionController {
|
|
|
852
860
|
const settingNames = ['skipStackFramesPattern', 'workspaceFolderExcludePattern'];
|
|
853
861
|
|
|
854
862
|
for (let i = 0; i < settingNames.length; ++i) {
|
|
855
|
-
const setting =
|
|
863
|
+
const setting = this.#settings.createSetting<string|unknown[]>(settingNames[i], '');
|
|
856
864
|
let value = setting.get();
|
|
857
865
|
if (!value) {
|
|
858
866
|
return;
|
|
@@ -884,7 +892,7 @@ export class VersionController {
|
|
|
884
892
|
updateVersionFrom10To11(): void {
|
|
885
893
|
const oldSettingName = 'customDevicePresets';
|
|
886
894
|
const newSettingName = 'customEmulatedDeviceList';
|
|
887
|
-
const oldSetting =
|
|
895
|
+
const oldSetting = this.#settings.createSetting<unknown>(oldSettingName, undefined);
|
|
888
896
|
const list = oldSetting.get();
|
|
889
897
|
if (!Array.isArray(list)) {
|
|
890
898
|
return;
|
|
@@ -914,9 +922,9 @@ export class VersionController {
|
|
|
914
922
|
newList.push(device);
|
|
915
923
|
}
|
|
916
924
|
if (newList.length) {
|
|
917
|
-
|
|
925
|
+
this.#settings.createSetting<unknown[]>(newSettingName, []).set(newList);
|
|
918
926
|
}
|
|
919
|
-
removeSetting(oldSetting);
|
|
927
|
+
this.#removeSetting(oldSetting);
|
|
920
928
|
}
|
|
921
929
|
|
|
922
930
|
updateVersionFrom11To12(): void {
|
|
@@ -925,16 +933,16 @@ export class VersionController {
|
|
|
925
933
|
|
|
926
934
|
updateVersionFrom12To13(): void {
|
|
927
935
|
this.migrateSettingsFromLocalStorage();
|
|
928
|
-
removeSetting(
|
|
936
|
+
this.#removeSetting(this.#settings.createSetting('timelineOverviewMode', ''));
|
|
929
937
|
}
|
|
930
938
|
|
|
931
939
|
updateVersionFrom13To14(): void {
|
|
932
940
|
const defaultValue = {throughput: -1, latency: 0};
|
|
933
|
-
|
|
941
|
+
this.#settings.createSetting('networkConditions', defaultValue).set(defaultValue);
|
|
934
942
|
}
|
|
935
943
|
|
|
936
944
|
updateVersionFrom14To15(): void {
|
|
937
|
-
const setting =
|
|
945
|
+
const setting = this.#settings.createLocalSetting<any>('workspaceExcludedFolders', {});
|
|
938
946
|
const oldValue = setting.get();
|
|
939
947
|
const newValue: Record<string, string[]> = {};
|
|
940
948
|
for (const fileSystemPath in oldValue) {
|
|
@@ -947,7 +955,7 @@ export class VersionController {
|
|
|
947
955
|
}
|
|
948
956
|
|
|
949
957
|
updateVersionFrom15To16(): void {
|
|
950
|
-
const setting =
|
|
958
|
+
const setting = this.#settings.createSetting<any>('InspectorView.panelOrder', {});
|
|
951
959
|
const tabOrders = setting.get();
|
|
952
960
|
for (const key of Object.keys(tabOrders)) {
|
|
953
961
|
tabOrders[key] = (tabOrders[key] + 1) * 10;
|
|
@@ -956,7 +964,7 @@ export class VersionController {
|
|
|
956
964
|
}
|
|
957
965
|
|
|
958
966
|
updateVersionFrom16To17(): void {
|
|
959
|
-
const setting =
|
|
967
|
+
const setting = this.#settings.createSetting<any>('networkConditionsCustomProfiles', []);
|
|
960
968
|
const oldValue = setting.get();
|
|
961
969
|
const newValue = [];
|
|
962
970
|
if (Array.isArray(oldValue)) {
|
|
@@ -974,7 +982,7 @@ export class VersionController {
|
|
|
974
982
|
}
|
|
975
983
|
|
|
976
984
|
updateVersionFrom17To18(): void {
|
|
977
|
-
const setting =
|
|
985
|
+
const setting = this.#settings.createLocalSetting<any>('workspaceExcludedFolders', {});
|
|
978
986
|
const oldValue = setting.get();
|
|
979
987
|
const newValue: Record<string, string> = {};
|
|
980
988
|
for (const oldKey in oldValue) {
|
|
@@ -993,7 +1001,7 @@ export class VersionController {
|
|
|
993
1001
|
|
|
994
1002
|
updateVersionFrom18To19(): void {
|
|
995
1003
|
const defaultColumns = {status: true, type: true, initiator: true, size: true, time: true};
|
|
996
|
-
const visibleColumnSettings =
|
|
1004
|
+
const visibleColumnSettings = this.#settings.createSetting<any>('networkLogColumnsVisibility', defaultColumns);
|
|
997
1005
|
const visibleColumns = visibleColumnSettings.get();
|
|
998
1006
|
visibleColumns.name = true;
|
|
999
1007
|
visibleColumns.timeline = true;
|
|
@@ -1007,20 +1015,20 @@ export class VersionController {
|
|
|
1007
1015
|
}
|
|
1008
1016
|
configs[columnId.toLowerCase()] = {visible: visibleColumns[columnId]};
|
|
1009
1017
|
}
|
|
1010
|
-
const newSetting =
|
|
1018
|
+
const newSetting = this.#settings.createSetting('networkLogColumns', {});
|
|
1011
1019
|
newSetting.set(configs);
|
|
1012
|
-
removeSetting(visibleColumnSettings);
|
|
1020
|
+
this.#removeSetting(visibleColumnSettings);
|
|
1013
1021
|
}
|
|
1014
1022
|
|
|
1015
1023
|
updateVersionFrom19To20(): void {
|
|
1016
|
-
const oldSetting =
|
|
1017
|
-
const newSetting =
|
|
1024
|
+
const oldSetting = this.#settings.createSetting('InspectorView.panelOrder', {});
|
|
1025
|
+
const newSetting = this.#settings.createSetting('panel-tabOrder', {});
|
|
1018
1026
|
newSetting.set(oldSetting.get());
|
|
1019
|
-
removeSetting(oldSetting);
|
|
1027
|
+
this.#removeSetting(oldSetting);
|
|
1020
1028
|
}
|
|
1021
1029
|
|
|
1022
1030
|
updateVersionFrom20To21(): void {
|
|
1023
|
-
const networkColumns =
|
|
1031
|
+
const networkColumns = this.#settings.createSetting('networkLogColumns', {});
|
|
1024
1032
|
const columns = (networkColumns.get() as Record<string, string>);
|
|
1025
1033
|
delete columns['timeline'];
|
|
1026
1034
|
delete columns['waterfall'];
|
|
@@ -1028,7 +1036,7 @@ export class VersionController {
|
|
|
1028
1036
|
}
|
|
1029
1037
|
|
|
1030
1038
|
updateVersionFrom21To22(): void {
|
|
1031
|
-
const breakpointsSetting =
|
|
1039
|
+
const breakpointsSetting = this.#settings.createLocalSetting<any>('breakpoints', []);
|
|
1032
1040
|
const breakpoints = breakpointsSetting.get();
|
|
1033
1041
|
for (const breakpoint of breakpoints) {
|
|
1034
1042
|
breakpoint['url'] = breakpoint['sourceFileId'];
|
|
@@ -1042,36 +1050,37 @@ export class VersionController {
|
|
|
1042
1050
|
}
|
|
1043
1051
|
|
|
1044
1052
|
updateVersionFrom23To24(): void {
|
|
1045
|
-
const oldSetting =
|
|
1046
|
-
const newSetting =
|
|
1053
|
+
const oldSetting = this.#settings.createSetting('searchInContentScripts', false);
|
|
1054
|
+
const newSetting = this.#settings.createSetting('searchInAnonymousAndContentScripts', false);
|
|
1047
1055
|
newSetting.set(oldSetting.get());
|
|
1048
|
-
removeSetting(oldSetting);
|
|
1056
|
+
this.#removeSetting(oldSetting);
|
|
1049
1057
|
}
|
|
1050
1058
|
|
|
1051
1059
|
updateVersionFrom24To25(): void {
|
|
1052
1060
|
const defaultColumns = {status: true, type: true, initiator: true, size: true, time: true};
|
|
1053
1061
|
|
|
1054
|
-
const networkLogColumnsSetting =
|
|
1062
|
+
const networkLogColumnsSetting = this.#settings.createSetting<any>('networkLogColumns', defaultColumns);
|
|
1055
1063
|
const columns = networkLogColumnsSetting.get();
|
|
1056
1064
|
delete columns.product;
|
|
1057
1065
|
networkLogColumnsSetting.set(columns);
|
|
1058
1066
|
}
|
|
1059
1067
|
|
|
1060
1068
|
updateVersionFrom25To26(): void {
|
|
1061
|
-
const oldSetting =
|
|
1069
|
+
const oldSetting = this.#settings.createSetting('messageURLFilters', {});
|
|
1062
1070
|
const urls = Object.keys(oldSetting.get());
|
|
1063
1071
|
const textFilter = urls.map(url => `-url:${url}`).join(' ');
|
|
1064
1072
|
if (textFilter) {
|
|
1065
|
-
const textFilterSetting =
|
|
1073
|
+
const textFilterSetting = this.#settings.createSetting<any>('console.textFilter', '');
|
|
1066
1074
|
const suffix = textFilterSetting.get() ? ` ${textFilterSetting.get()}` : '';
|
|
1067
1075
|
textFilterSetting.set(`${textFilter}${suffix}`);
|
|
1068
1076
|
}
|
|
1069
|
-
removeSetting(oldSetting);
|
|
1077
|
+
this.#removeSetting(oldSetting);
|
|
1070
1078
|
}
|
|
1071
1079
|
|
|
1072
1080
|
updateVersionFrom26To27(): void {
|
|
1081
|
+
const settings = this.#settings;
|
|
1073
1082
|
function renameKeyInObjectSetting(settingName: string, from: string, to: string): void {
|
|
1074
|
-
const setting =
|
|
1083
|
+
const setting = settings.createSetting<any>(settingName, {});
|
|
1075
1084
|
const value = setting.get();
|
|
1076
1085
|
if (from in value) {
|
|
1077
1086
|
value[to] = value[from];
|
|
@@ -1081,7 +1090,7 @@ export class VersionController {
|
|
|
1081
1090
|
}
|
|
1082
1091
|
|
|
1083
1092
|
function renameInStringSetting(settingName: string, from: string, to: string): void {
|
|
1084
|
-
const setting =
|
|
1093
|
+
const setting = settings.createSetting(settingName, '');
|
|
1085
1094
|
const value = setting.get();
|
|
1086
1095
|
if (value === from) {
|
|
1087
1096
|
setting.set(to);
|
|
@@ -1094,15 +1103,16 @@ export class VersionController {
|
|
|
1094
1103
|
}
|
|
1095
1104
|
|
|
1096
1105
|
updateVersionFrom27To28(): void {
|
|
1097
|
-
const setting =
|
|
1106
|
+
const setting = this.#settings.createSetting('uiTheme', 'systemPreferred');
|
|
1098
1107
|
if (setting.get() === 'default') {
|
|
1099
1108
|
setting.set('systemPreferred');
|
|
1100
1109
|
}
|
|
1101
1110
|
}
|
|
1102
1111
|
|
|
1103
1112
|
updateVersionFrom28To29(): void {
|
|
1113
|
+
const settings = this.#settings;
|
|
1104
1114
|
function renameKeyInObjectSetting(settingName: string, from: string, to: string): void {
|
|
1105
|
-
const setting =
|
|
1115
|
+
const setting = settings.createSetting<any>(settingName, {});
|
|
1106
1116
|
const value = setting.get();
|
|
1107
1117
|
if (from in value) {
|
|
1108
1118
|
value[to] = value[from];
|
|
@@ -1112,7 +1122,7 @@ export class VersionController {
|
|
|
1112
1122
|
}
|
|
1113
1123
|
|
|
1114
1124
|
function renameInStringSetting(settingName: string, from: string, to: string): void {
|
|
1115
|
-
const setting =
|
|
1125
|
+
const setting = settings.createSetting(settingName, '');
|
|
1116
1126
|
const value = setting.get();
|
|
1117
1127
|
if (value === from) {
|
|
1118
1128
|
setting.set(to);
|
|
@@ -1126,11 +1136,11 @@ export class VersionController {
|
|
|
1126
1136
|
|
|
1127
1137
|
updateVersionFrom29To30(): void {
|
|
1128
1138
|
// Create new location agnostic setting
|
|
1129
|
-
const closeableTabSetting =
|
|
1139
|
+
const closeableTabSetting = this.#settings.createSetting('closeableTabs', {});
|
|
1130
1140
|
|
|
1131
1141
|
// Read current settings
|
|
1132
|
-
const panelCloseableTabSetting =
|
|
1133
|
-
const drawerCloseableTabSetting =
|
|
1142
|
+
const panelCloseableTabSetting = this.#settings.createSetting('panel-closeableTabs', {});
|
|
1143
|
+
const drawerCloseableTabSetting = this.#settings.createSetting('drawer-view-closeableTabs', {});
|
|
1134
1144
|
const openTabsInPanel = panelCloseableTabSetting.get();
|
|
1135
1145
|
const openTabsInDrawer = panelCloseableTabSetting.get();
|
|
1136
1146
|
|
|
@@ -1139,15 +1149,15 @@ export class VersionController {
|
|
|
1139
1149
|
closeableTabSetting.set(newValue);
|
|
1140
1150
|
|
|
1141
1151
|
// Remove old settings
|
|
1142
|
-
removeSetting(panelCloseableTabSetting);
|
|
1143
|
-
removeSetting(drawerCloseableTabSetting);
|
|
1152
|
+
this.#removeSetting(panelCloseableTabSetting);
|
|
1153
|
+
this.#removeSetting(drawerCloseableTabSetting);
|
|
1144
1154
|
}
|
|
1145
1155
|
|
|
1146
1156
|
updateVersionFrom30To31(): void {
|
|
1147
1157
|
// Remove recorder_recordings setting that was used for storing recordings
|
|
1148
1158
|
// by an old recorder experiment.
|
|
1149
|
-
const recordingsSetting =
|
|
1150
|
-
removeSetting(recordingsSetting);
|
|
1159
|
+
const recordingsSetting = this.#settings.createSetting('recorder_recordings', []);
|
|
1160
|
+
this.#removeSetting(recordingsSetting);
|
|
1151
1161
|
}
|
|
1152
1162
|
|
|
1153
1163
|
updateVersionFrom31To32(): void {
|
|
@@ -1156,7 +1166,7 @@ export class VersionController {
|
|
|
1156
1166
|
// know on which resource type the given breakpoint was set, we just assume
|
|
1157
1167
|
// 'script' here to keep things simple.
|
|
1158
1168
|
|
|
1159
|
-
const breakpointsSetting =
|
|
1169
|
+
const breakpointsSetting = this.#settings.createLocalSetting<any>('breakpoints', []);
|
|
1160
1170
|
const breakpoints = breakpointsSetting.get();
|
|
1161
1171
|
for (const breakpoint of breakpoints) {
|
|
1162
1172
|
breakpoint['resourceTypeName'] = 'script';
|
|
@@ -1165,7 +1175,7 @@ export class VersionController {
|
|
|
1165
1175
|
}
|
|
1166
1176
|
|
|
1167
1177
|
updateVersionFrom32To33(): void {
|
|
1168
|
-
const previouslyViewedFilesSetting =
|
|
1178
|
+
const previouslyViewedFilesSetting = this.#settings.createLocalSetting<any>('previouslyViewedFiles', []);
|
|
1169
1179
|
let previouslyViewedFiles = previouslyViewedFilesSetting.get();
|
|
1170
1180
|
|
|
1171
1181
|
// Discard old 'previouslyViewedFiles' items that don't have a 'url' property.
|
|
@@ -1196,7 +1206,7 @@ export class VersionController {
|
|
|
1196
1206
|
const logpointPrefix = '/** DEVTOOLS_LOGPOINT */ console.log(';
|
|
1197
1207
|
const logpointSuffix = ')';
|
|
1198
1208
|
|
|
1199
|
-
const breakpointsSetting =
|
|
1209
|
+
const breakpointsSetting = this.#settings.createLocalSetting<any>('breakpoints', []);
|
|
1200
1210
|
const breakpoints = breakpointsSetting.get();
|
|
1201
1211
|
for (const breakpoint of breakpoints) {
|
|
1202
1212
|
const isLogpoint =
|
|
@@ -1216,7 +1226,7 @@ export class VersionController {
|
|
|
1216
1226
|
const logpointPrefix = '/** DEVTOOLS_LOGPOINT */ console.log(';
|
|
1217
1227
|
const logpointSuffix = ')';
|
|
1218
1228
|
|
|
1219
|
-
const breakpointsSetting =
|
|
1229
|
+
const breakpointsSetting = this.#settings.createLocalSetting<any>('breakpoints', []);
|
|
1220
1230
|
const breakpoints = breakpointsSetting.get();
|
|
1221
1231
|
for (const breakpoint of breakpoints) {
|
|
1222
1232
|
const {condition, isLogpoint} = breakpoint;
|
|
@@ -1229,7 +1239,7 @@ export class VersionController {
|
|
|
1229
1239
|
|
|
1230
1240
|
updateVersionFrom35To36(): void {
|
|
1231
1241
|
// We have changed the default from 'false' to 'true' and this updates the existing setting just for once.
|
|
1232
|
-
|
|
1242
|
+
this.#settings.createSetting('showThirdPartyIssues', true).set(true);
|
|
1233
1243
|
}
|
|
1234
1244
|
|
|
1235
1245
|
updateVersionFrom36To37(): void {
|
|
@@ -1238,23 +1248,23 @@ export class VersionController {
|
|
|
1238
1248
|
const normalizedKey = Settings.normalizeSettingName(key);
|
|
1239
1249
|
if (normalizedKey !== key) {
|
|
1240
1250
|
const value = storage.get(key);
|
|
1241
|
-
removeSetting({name: key, storage});
|
|
1251
|
+
this.#removeSetting({name: key, storage});
|
|
1242
1252
|
storage.set(normalizedKey, value);
|
|
1243
1253
|
}
|
|
1244
1254
|
}
|
|
1245
1255
|
};
|
|
1246
|
-
updateStorage(
|
|
1247
|
-
updateStorage(
|
|
1248
|
-
updateStorage(
|
|
1256
|
+
updateStorage(this.#settings.globalStorage);
|
|
1257
|
+
updateStorage(this.#settings.syncedStorage);
|
|
1258
|
+
updateStorage(this.#settings.localStorage);
|
|
1249
1259
|
|
|
1250
|
-
for (const key of
|
|
1260
|
+
for (const key of this.#settings.globalStorage.keys()) {
|
|
1251
1261
|
if ((key.startsWith('data-grid-') && key.endsWith('-column-weights')) || key.endsWith('-tab-order') ||
|
|
1252
1262
|
key === 'views-location-override' || key === 'closeable-tabs') {
|
|
1253
|
-
const setting =
|
|
1263
|
+
const setting = this.#settings.createSetting(key, {});
|
|
1254
1264
|
setting.set(Platform.StringUtilities.toKebabCaseKeys(setting.get()));
|
|
1255
1265
|
}
|
|
1256
1266
|
if (key.endsWith('-selected-tab')) {
|
|
1257
|
-
const setting =
|
|
1267
|
+
const setting = this.#settings.createSetting(key, '');
|
|
1258
1268
|
setting.set(Platform.StringUtilities.toKebabCase(setting.get()));
|
|
1259
1269
|
}
|
|
1260
1270
|
}
|
|
@@ -1263,14 +1273,14 @@ export class VersionController {
|
|
|
1263
1273
|
updateVersionFrom37To38(): void {
|
|
1264
1274
|
const getConsoleInsightsEnabledSetting = (): Setting<boolean>|undefined => {
|
|
1265
1275
|
try {
|
|
1266
|
-
return moduleSetting('console-insights-enabled') as Setting<boolean>;
|
|
1276
|
+
return this.#settings.moduleSetting('console-insights-enabled') as Setting<boolean>;
|
|
1267
1277
|
} catch {
|
|
1268
1278
|
return;
|
|
1269
1279
|
}
|
|
1270
1280
|
};
|
|
1271
1281
|
|
|
1272
1282
|
const consoleInsightsEnabled = getConsoleInsightsEnabledSetting();
|
|
1273
|
-
const onboardingFinished =
|
|
1283
|
+
const onboardingFinished = this.#settings.createLocalSetting('console-insights-onboarding-finished', false);
|
|
1274
1284
|
|
|
1275
1285
|
if (consoleInsightsEnabled && consoleInsightsEnabled.get() === true && onboardingFinished.get() === false) {
|
|
1276
1286
|
consoleInsightsEnabled.set(false);
|
|
@@ -1287,7 +1297,7 @@ export class VersionController {
|
|
|
1287
1297
|
// Note: we load the raw value via the globalStorage here because
|
|
1288
1298
|
// `createSetting` creates if it is not present, and we do not want that;
|
|
1289
1299
|
// we only want to update existing, old values.
|
|
1290
|
-
const setting =
|
|
1300
|
+
const setting = this.#settings.globalStorage.get(PREFERRED_NETWORK_COND);
|
|
1291
1301
|
if (!setting) {
|
|
1292
1302
|
return;
|
|
1293
1303
|
}
|
|
@@ -1302,15 +1312,15 @@ export class VersionController {
|
|
|
1302
1312
|
if (networkSetting.title === 'Slow 3G') {
|
|
1303
1313
|
networkSetting.title = '3G';
|
|
1304
1314
|
networkSetting.i18nTitleKey = '3G';
|
|
1305
|
-
|
|
1315
|
+
this.#settings.globalStorage.set(PREFERRED_NETWORK_COND, JSON.stringify(networkSetting));
|
|
1306
1316
|
} else if (networkSetting.title === 'Fast 3G') {
|
|
1307
1317
|
networkSetting.title = 'Slow 4G';
|
|
1308
1318
|
networkSetting.i18nTitleKey = 'Slow 4G';
|
|
1309
|
-
|
|
1319
|
+
this.#settings.globalStorage.set(PREFERRED_NETWORK_COND, JSON.stringify(networkSetting));
|
|
1310
1320
|
}
|
|
1311
1321
|
} catch {
|
|
1312
1322
|
// If parsing the setting threw, it's in some invalid state, so remove it.
|
|
1313
|
-
|
|
1323
|
+
this.#settings.globalStorage.remove(PREFERRED_NETWORK_COND);
|
|
1314
1324
|
}
|
|
1315
1325
|
}
|
|
1316
1326
|
|
|
@@ -1326,7 +1336,7 @@ export class VersionController {
|
|
|
1326
1336
|
const hasCustomNetworkConditionsSetting = (): boolean => {
|
|
1327
1337
|
try {
|
|
1328
1338
|
// this will error if it does not exist
|
|
1329
|
-
moduleSetting('custom-network-conditions');
|
|
1339
|
+
this.#settings.moduleSetting('custom-network-conditions');
|
|
1330
1340
|
return true;
|
|
1331
1341
|
} catch {
|
|
1332
1342
|
return false;
|
|
@@ -1342,7 +1352,8 @@ export class VersionController {
|
|
|
1342
1352
|
* objects, and we need to set the right key on each one. The actual keys &
|
|
1343
1353
|
* values in the object are not important.
|
|
1344
1354
|
*/
|
|
1345
|
-
const conditionsSetting =
|
|
1355
|
+
const conditionsSetting =
|
|
1356
|
+
this.#settings.moduleSetting('custom-network-conditions') as Setting<Array<{key?: string}>>;
|
|
1346
1357
|
const customConditions = conditionsSetting.get();
|
|
1347
1358
|
if (customConditions?.length > 0) {
|
|
1348
1359
|
customConditions.forEach((condition, i) => {
|
|
@@ -1367,7 +1378,7 @@ export class VersionController {
|
|
|
1367
1378
|
// is more likely to change. This migration step tries to update the
|
|
1368
1379
|
// setting for users, or removes it if we fail, so they start fresh next
|
|
1369
1380
|
// time they load DevTools.
|
|
1370
|
-
const setting =
|
|
1381
|
+
const setting = this.#settings.globalStorage.get(PREFERRED_NETWORK_COND_SETTING);
|
|
1371
1382
|
if (!setting) {
|
|
1372
1383
|
return;
|
|
1373
1384
|
}
|
|
@@ -1392,12 +1403,12 @@ export class VersionController {
|
|
|
1392
1403
|
|
|
1393
1404
|
// The second argument is the default value, so it's important that we
|
|
1394
1405
|
// set this to the default, and then update it to the new key.
|
|
1395
|
-
const newSetting =
|
|
1406
|
+
const newSetting = this.#settings.createSetting('active-network-condition-key', 'NO_THROTTLING');
|
|
1396
1407
|
newSetting.set(key);
|
|
1397
1408
|
}
|
|
1398
1409
|
} finally {
|
|
1399
1410
|
// This setting is now not used, so we can remove it.
|
|
1400
|
-
|
|
1411
|
+
this.#settings.globalStorage.remove(PREFERRED_NETWORK_COND_SETTING);
|
|
1401
1412
|
}
|
|
1402
1413
|
}
|
|
1403
1414
|
|
|
@@ -1435,7 +1446,7 @@ export class VersionController {
|
|
|
1435
1446
|
}
|
|
1436
1447
|
const value = window.localStorage[key];
|
|
1437
1448
|
window.localStorage.removeItem(key);
|
|
1438
|
-
|
|
1449
|
+
this.#settings.globalStorage.set(key, value);
|
|
1439
1450
|
}
|
|
1440
1451
|
}
|
|
1441
1452
|
|