chrome-devtools-mcp-for-extension 0.19.2 → 0.20.0
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/build/node_modules/chrome-devtools-frontend/front_end/core/common/Color.js +13 -9
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/ColorConverter.js +9 -7
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/Console.js +1 -8
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/Debouncer.js +2 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/Gzip.js +9 -7
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/MapWithDefault.js +5 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/ParsedURL.js +10 -20
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/ResourceType.js +0 -11
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/ReturnToPanel.js +6 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/Revealer.js +5 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/SegmentedRange.js +1 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/Settings.js +110 -99
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/StringOutputStream.js +1 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/Throttler.js +2 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/common.js +1 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/AidaClient.js +21 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/DispatchHttpRequestClient.js +66 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/GdpClient.js +102 -86
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/InspectorFrontendHost.js +32 -450
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/InspectorFrontendHostAPI.js +32 -29
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/InspectorFrontendHostStub.js +430 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/Platform.js +5 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/ResourceLoader.js +10 -22
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/UserMetrics.js +26 -15
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/host.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/ArrayUtilities.js +2 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/HostRuntime.js +19 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/StringUtilities.js +34 -32
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/api/HostRuntime.js +4 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/api/api.js +5 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/browser/HostRuntime.js +63 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/browser/browser.js +5 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/node/HostRuntime.js +72 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/node/node.js +5 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/platform.js +2 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/protocol_client/CDPConnection.js +17 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/protocol_client/ConnectionTransport.js +12 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/protocol_client/DevToolsCDPConnection.js +138 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/protocol_client/InspectorBackend.js +49 -312
- package/build/node_modules/chrome-devtools-frontend/front_end/core/protocol_client/protocol_client.js +4 -9
- package/build/node_modules/chrome-devtools-frontend/front_end/core/root/DevToolsContext.js +54 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/root/root.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/AnimationModel.js +2 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CPUThrottlingManager.js +0 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSMatchedStyles.js +51 -17
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSMetadata.js +21 -7
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSModel.js +11 -5
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSProperty.js +4 -7
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSPropertyParser.js +11 -9
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSPropertyParserMatchers.js +34 -24
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSRule.js +52 -10
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSStartingStyle.js +21 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSStyleDeclaration.js +4 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/ChildTargetManager.js +39 -35
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/Connections.js +10 -47
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/ConsoleModel.js +1 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/Cookie.js +1 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/DOMModel.js +29 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/DebuggerModel.js +5 -20
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/EnhancedTracesParser.js +17 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/EventBreakpointsModel.js +4 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/HttpReasonPhraseStrings.js +4 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/IOModel.js +1 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/NetworkManager.js +428 -121
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/NetworkRequest.js +8 -22
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/PageResourceLoader.js +44 -34
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/PreloadingModel.js +64 -19
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/RehydratingConnection.js +139 -12
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/RemoteObject.js +5 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/ResourceTreeModel.js +3 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/ScopeTreeCache.js +36 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/ScreenCaptureModel.js +20 -18
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/Script.js +26 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/ServerSentEventsProtocol.js +3 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/SourceMap.js +54 -14
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/SourceMapCache.js +16 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/SourceMapManager.js +19 -7
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/SourceMapScopesInfo.js +240 -8
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/Target.js +12 -17
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/TargetManager.js +38 -29
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/TraceObject.js +11 -8
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/sdk-meta.js +80 -31
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/sdk.js +4 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/generated/ARIAProperties.js +1301 -174
- package/build/node_modules/chrome-devtools-frontend/front_end/generated/Deprecation.js +67 -22
- package/build/node_modules/chrome-devtools-frontend/front_end/generated/InspectorBackendCommands.js +62 -91
- package/build/node_modules/chrome-devtools-frontend/front_end/generated/SupportedCSSProperties.js +188 -100
- package/build/node_modules/chrome-devtools-frontend/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.js +30 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.js +50 -34
- package/build/node_modules/chrome-devtools-frontend/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.js +152 -101
- package/build/node_modules/chrome-devtools-frontend/front_end/models/ai_assistance/performance/AICallTree.js +11 -6
- package/build/node_modules/chrome-devtools-frontend/front_end/models/ai_assistance/performance/AIContext.js +25 -26
- package/build/node_modules/chrome-devtools-frontend/front_end/models/ai_assistance/performance/AIQueries.js +46 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/bindings/CSSWorkspaceBinding.js +10 -8
- package/build/node_modules/chrome-devtools-frontend/front_end/models/bindings/CompilerScriptMapping.js +82 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/models/bindings/DebuggerWorkspaceBinding.js +33 -15
- package/build/node_modules/chrome-devtools-frontend/front_end/models/bindings/ResourceMapping.js +105 -14
- package/build/node_modules/chrome-devtools-frontend/front_end/models/bindings/ResourceScriptMapping.js +38 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/models/bindings/SASSSourceMapping.js +5 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/models/cpu_profile/CPUProfileDataModel.js +9 -7
- package/build/node_modules/chrome-devtools-frontend/front_end/models/cpu_profile/ProfileTreeModel.js +6 -7
- package/build/node_modules/chrome-devtools-frontend/front_end/models/crux-manager/CrUXManager.js +6 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/models/formatter/FormatterWorkerPool.js +16 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/network_time_calculator/RequestTimeRanges.js +6 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/models/source_map_scopes/FunctionCodeResolver.js +192 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/models/source_map_scopes/NamesResolver.js +12 -16
- package/build/node_modules/chrome-devtools-frontend/front_end/models/source_map_scopes/source_map_scopes.js +2 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/stack_trace/StackTraceModel.js +1 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/stack_trace/Trie.js +8 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/LanternComputationData.js +1 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/ModelImpl.js +6 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/Processor.js +4 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/Styles.js +1 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/extras/TraceTree.js +11 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/handlers/FramesHandler.js +7 -5
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/handlers/LayoutShiftsHandler.js +8 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/handlers/MetaHandler.js +4 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/handlers/NetworkRequestsHandler.js +29 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/handlers/SamplesHandler.js +59 -6
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/handlers/ScriptsHandler.js +26 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/handlers/UserTimingsHandler.js +1 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/handlers/helpers.js +1 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/helpers/Timing.js +4 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/helpers/Trace.js +18 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/CLSCulprits.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/Cache.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/DOMSize.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/DocumentLatency.js +12 -11
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/DuplicatedJavaScript.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/FontDisplay.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/ForcedReflow.js +3 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/INPBreakdown.js +14 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/ImageDelivery.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/LCPBreakdown.js +13 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/LCPDiscovery.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/LegacyJavaScript.js +4 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/ModernHTTP.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/NetworkDependencyTree.js +4 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/RenderBlocking.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/SlowCSSSelector.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/ThirdParties.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/Viewport.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/types/TraceEvents.js +9 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace_source_maps_resolver/SourceMapsResolver.js +25 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/workspace/IgnoreListManager.js +41 -48
- package/build/node_modules/chrome-devtools-frontend/front_end/models/workspace/UISourceCode.js +38 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/models/workspace/WorkspaceImpl.js +5 -8
- package/build/node_modules/chrome-devtools-frontend/front_end/models/workspace/workspace-meta.js +34 -0
- package/build/src/McpContext.js +8 -1
- package/build/src/tools/bookmarks.js +0 -1
- package/build/src/tools/gemini-web.js +17 -25
- package/build/src/tools/snapshot.js +9 -2
- package/package.json +3 -3
|
@@ -5,12 +5,13 @@ import * as Platform from '../platform/platform.js';
|
|
|
5
5
|
import * as Root from '../root/root.js';
|
|
6
6
|
import { Console } from './Console.js';
|
|
7
7
|
import { ObjectWrapper } from './Object.js';
|
|
8
|
-
import { getLocalizedSettingsCategory,
|
|
8
|
+
import { getLocalizedSettingsCategory, maybeRemoveSettingExtension, registerSettingExtension, registerSettingsForTest, resetSettings, } from './SettingRegistration.js';
|
|
9
9
|
let settingsInstance;
|
|
10
10
|
export class Settings {
|
|
11
11
|
syncedStorage;
|
|
12
12
|
globalStorage;
|
|
13
13
|
localStorage;
|
|
14
|
+
#settingRegistrations;
|
|
14
15
|
#sessionStorage = new SettingsStorage({});
|
|
15
16
|
settingNameSet = new Set();
|
|
16
17
|
orderValuesBySettingCategory = new Map();
|
|
@@ -18,12 +19,13 @@ export class Settings {
|
|
|
18
19
|
#registry = new Map();
|
|
19
20
|
moduleSettings = new Map();
|
|
20
21
|
#logSettingAccess;
|
|
21
|
-
constructor(syncedStorage, globalStorage, localStorage, logSettingAccess) {
|
|
22
|
+
constructor({ syncedStorage, globalStorage, localStorage, settingRegistrations, logSettingAccess, runSettingsMigration }) {
|
|
22
23
|
this.syncedStorage = syncedStorage;
|
|
23
24
|
this.globalStorage = globalStorage;
|
|
24
25
|
this.localStorage = localStorage;
|
|
26
|
+
this.#settingRegistrations = settingRegistrations;
|
|
25
27
|
this.#logSettingAccess = logSettingAccess;
|
|
26
|
-
for (const registration of this
|
|
28
|
+
for (const registration of this.#settingRegistrations) {
|
|
27
29
|
const { settingName, defaultValue, storageType } = registration;
|
|
28
30
|
const isRegex = registration.settingType === "regex" /* SettingType.REGEX */;
|
|
29
31
|
const evaluatedDefaultValue = typeof defaultValue === 'function' ? defaultValue(Root.Runtime.hostConfig) : defaultValue;
|
|
@@ -37,20 +39,23 @@ export class Settings {
|
|
|
37
39
|
setting.setRegistration(registration);
|
|
38
40
|
this.registerModuleSetting(setting);
|
|
39
41
|
}
|
|
42
|
+
if (runSettingsMigration) {
|
|
43
|
+
new VersionController(this).updateVersion();
|
|
44
|
+
}
|
|
40
45
|
}
|
|
41
46
|
getRegisteredSettings() {
|
|
42
|
-
return
|
|
47
|
+
return this.#settingRegistrations;
|
|
43
48
|
}
|
|
44
49
|
static hasInstance() {
|
|
45
50
|
return typeof settingsInstance !== 'undefined';
|
|
46
51
|
}
|
|
47
|
-
static instance(opts = { forceNew: null, syncedStorage: null, globalStorage: null, localStorage: null }) {
|
|
48
|
-
const { forceNew, syncedStorage, globalStorage, localStorage, logSettingAccess } = opts;
|
|
52
|
+
static instance(opts = { forceNew: null, syncedStorage: null, globalStorage: null, localStorage: null, settingRegistrations: null }) {
|
|
53
|
+
const { forceNew, syncedStorage, globalStorage, localStorage, settingRegistrations, logSettingAccess, runSettingsMigration } = opts;
|
|
49
54
|
if (!settingsInstance || forceNew) {
|
|
50
|
-
if (!syncedStorage || !globalStorage || !localStorage) {
|
|
55
|
+
if (!syncedStorage || !globalStorage || !localStorage || !settingRegistrations) {
|
|
51
56
|
throw new Error(`Unable to create settings: global and local storage must be provided: ${new Error().stack}`);
|
|
52
57
|
}
|
|
53
|
-
settingsInstance = new Settings(syncedStorage, globalStorage, localStorage, logSettingAccess);
|
|
58
|
+
settingsInstance = new Settings({ syncedStorage, globalStorage, localStorage, settingRegistrations, logSettingAccess, runSettingsMigration });
|
|
54
59
|
}
|
|
55
60
|
return settingsInstance;
|
|
56
61
|
}
|
|
@@ -93,7 +98,7 @@ export class Settings {
|
|
|
93
98
|
* to store UI state such as how a user choses to position a split widget or
|
|
94
99
|
* which panel they last opened.
|
|
95
100
|
* If you are creating a setting that you expect the user to control, and
|
|
96
|
-
* sync, prefer {@
|
|
101
|
+
* sync, prefer {@link Settings.createSetting}
|
|
97
102
|
*/
|
|
98
103
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
99
104
|
moduleSetting(settingName) {
|
|
@@ -138,7 +143,7 @@ export class Settings {
|
|
|
138
143
|
this.globalStorage.removeAll();
|
|
139
144
|
this.syncedStorage.removeAll();
|
|
140
145
|
this.localStorage.removeAll();
|
|
141
|
-
new VersionController().resetToCurrent();
|
|
146
|
+
new VersionController(this).resetToCurrent();
|
|
142
147
|
}
|
|
143
148
|
storageFromType(storageType) {
|
|
144
149
|
switch (storageType) {
|
|
@@ -230,13 +235,6 @@ export class SettingsStorage {
|
|
|
230
235
|
}
|
|
231
236
|
}
|
|
232
237
|
}
|
|
233
|
-
function removeSetting(setting) {
|
|
234
|
-
const name = setting.name;
|
|
235
|
-
const settings = Settings.instance();
|
|
236
|
-
settings.getRegistry().delete(name);
|
|
237
|
-
settings.moduleSettings.delete(name);
|
|
238
|
-
setting.storage.remove(name);
|
|
239
|
-
}
|
|
240
238
|
export class Deprecation {
|
|
241
239
|
disabled;
|
|
242
240
|
warning;
|
|
@@ -473,6 +471,9 @@ export class Setting {
|
|
|
473
471
|
}
|
|
474
472
|
return null;
|
|
475
473
|
}
|
|
474
|
+
/**
|
|
475
|
+
* See {@link LearnMore} for more info
|
|
476
|
+
*/
|
|
476
477
|
learnMore() {
|
|
477
478
|
return this.#registration?.learnMore ?? null;
|
|
478
479
|
}
|
|
@@ -545,14 +546,16 @@ export class VersionController {
|
|
|
545
546
|
static SYNCED_VERSION_SETTING_NAME = 'syncedInspectorVersion';
|
|
546
547
|
static LOCAL_VERSION_SETTING_NAME = 'localInspectorVersion';
|
|
547
548
|
static CURRENT_VERSION = 40;
|
|
549
|
+
#settings;
|
|
548
550
|
#globalVersionSetting;
|
|
549
551
|
#syncedVersionSetting;
|
|
550
552
|
#localVersionSetting;
|
|
551
|
-
constructor() {
|
|
553
|
+
constructor(settings) {
|
|
554
|
+
this.#settings = settings;
|
|
552
555
|
// If no version setting is found, we initialize with the current version and don't do anything.
|
|
553
|
-
this.#globalVersionSetting =
|
|
554
|
-
this.#syncedVersionSetting =
|
|
555
|
-
this.#localVersionSetting =
|
|
556
|
+
this.#globalVersionSetting = this.#settings.createSetting(VersionController.GLOBAL_VERSION_SETTING_NAME, VersionController.CURRENT_VERSION, "Global" /* SettingStorageType.GLOBAL */);
|
|
557
|
+
this.#syncedVersionSetting = this.#settings.createSetting(VersionController.SYNCED_VERSION_SETTING_NAME, VersionController.CURRENT_VERSION, "Synced" /* SettingStorageType.SYNCED */);
|
|
558
|
+
this.#localVersionSetting = this.#settings.createSetting(VersionController.LOCAL_VERSION_SETTING_NAME, VersionController.CURRENT_VERSION, "Local" /* SettingStorageType.LOCAL */);
|
|
556
559
|
}
|
|
557
560
|
/**
|
|
558
561
|
* Force re-sets all version number settings to the current version without
|
|
@@ -563,6 +566,12 @@ export class VersionController {
|
|
|
563
566
|
this.#syncedVersionSetting.set(VersionController.CURRENT_VERSION);
|
|
564
567
|
this.#localVersionSetting.set(VersionController.CURRENT_VERSION);
|
|
565
568
|
}
|
|
569
|
+
#removeSetting(setting) {
|
|
570
|
+
const name = setting.name;
|
|
571
|
+
this.#settings.getRegistry().delete(name);
|
|
572
|
+
this.#settings.moduleSettings.delete(name);
|
|
573
|
+
setting.storage.remove(name);
|
|
574
|
+
}
|
|
566
575
|
/**
|
|
567
576
|
* Runs the appropriate migrations and updates the version settings accordingly.
|
|
568
577
|
*
|
|
@@ -591,19 +600,19 @@ export class VersionController {
|
|
|
591
600
|
return result;
|
|
592
601
|
}
|
|
593
602
|
updateVersionFrom0To1() {
|
|
594
|
-
this.clearBreakpointsWhenTooMany(
|
|
603
|
+
this.clearBreakpointsWhenTooMany(this.#settings.createLocalSetting('breakpoints', []), 500000);
|
|
595
604
|
}
|
|
596
605
|
updateVersionFrom1To2() {
|
|
597
|
-
|
|
606
|
+
this.#settings.createSetting('previouslyViewedFiles', []).set([]);
|
|
598
607
|
}
|
|
599
608
|
updateVersionFrom2To3() {
|
|
600
|
-
|
|
601
|
-
removeSetting(
|
|
609
|
+
this.#settings.createSetting('fileSystemMapping', {}).set({});
|
|
610
|
+
this.#removeSetting(this.#settings.createSetting('fileMappingEntries', []));
|
|
602
611
|
}
|
|
603
612
|
updateVersionFrom3To4() {
|
|
604
|
-
const advancedMode =
|
|
605
|
-
moduleSetting('showAdvancedHeapSnapshotProperties').set(advancedMode.get());
|
|
606
|
-
removeSetting(advancedMode);
|
|
613
|
+
const advancedMode = this.#settings.createSetting('showHeaSnapshotObjectsHiddenProperties', false);
|
|
614
|
+
this.#settings.moduleSetting('showAdvancedHeapSnapshotProperties').set(advancedMode.get());
|
|
615
|
+
this.#removeSetting(advancedMode);
|
|
607
616
|
}
|
|
608
617
|
updateVersionFrom4To5() {
|
|
609
618
|
const settingNames = {
|
|
@@ -632,26 +641,26 @@ export class VersionController {
|
|
|
632
641
|
const newName = settingNames[oldName];
|
|
633
642
|
const oldNameH = oldName + 'H';
|
|
634
643
|
let newValue = null;
|
|
635
|
-
const oldSetting =
|
|
644
|
+
const oldSetting = this.#settings.createSetting(oldName, empty);
|
|
636
645
|
if (oldSetting.get() !== empty) {
|
|
637
646
|
newValue = newValue || {};
|
|
638
647
|
// @ts-expect-error
|
|
639
648
|
newValue.vertical = {};
|
|
640
649
|
// @ts-expect-error
|
|
641
650
|
newValue.vertical.size = oldSetting.get();
|
|
642
|
-
removeSetting(oldSetting);
|
|
651
|
+
this.#removeSetting(oldSetting);
|
|
643
652
|
}
|
|
644
|
-
const oldSettingH =
|
|
653
|
+
const oldSettingH = this.#settings.createSetting(oldNameH, empty);
|
|
645
654
|
if (oldSettingH.get() !== empty) {
|
|
646
655
|
newValue = newValue || {};
|
|
647
656
|
// @ts-expect-error
|
|
648
657
|
newValue.horizontal = {};
|
|
649
658
|
// @ts-expect-error
|
|
650
659
|
newValue.horizontal.size = oldSettingH.get();
|
|
651
|
-
removeSetting(oldSettingH);
|
|
660
|
+
this.#removeSetting(oldSettingH);
|
|
652
661
|
}
|
|
653
662
|
if (newValue) {
|
|
654
|
-
|
|
663
|
+
this.#settings.createSetting(newName, {}).set(newValue);
|
|
655
664
|
}
|
|
656
665
|
}
|
|
657
666
|
}
|
|
@@ -662,17 +671,17 @@ export class VersionController {
|
|
|
662
671
|
'WebInspector.Drawer.showOnLoad': 'Inspector.drawerSplitViewState',
|
|
663
672
|
};
|
|
664
673
|
for (const oldName in settingNames) {
|
|
665
|
-
const oldSetting =
|
|
674
|
+
const oldSetting = this.#settings.createSetting(oldName, null);
|
|
666
675
|
if (oldSetting.get() === null) {
|
|
667
|
-
removeSetting(oldSetting);
|
|
676
|
+
this.#removeSetting(oldSetting);
|
|
668
677
|
continue;
|
|
669
678
|
}
|
|
670
679
|
const newName = settingNames[oldName];
|
|
671
680
|
const invert = oldName === 'WebInspector.Drawer.showOnLoad';
|
|
672
681
|
const hidden = oldSetting.get() !== invert;
|
|
673
|
-
removeSetting(oldSetting);
|
|
682
|
+
this.#removeSetting(oldSetting);
|
|
674
683
|
const showMode = hidden ? 'OnlyMain' : 'Both';
|
|
675
|
-
const newSetting =
|
|
684
|
+
const newSetting = this.#settings.createSetting(newName, {});
|
|
676
685
|
const newValue = newSetting.get() || {};
|
|
677
686
|
// @ts-expect-error
|
|
678
687
|
newValue.vertical = newValue.vertical || {};
|
|
@@ -694,7 +703,7 @@ export class VersionController {
|
|
|
694
703
|
};
|
|
695
704
|
const empty = {};
|
|
696
705
|
for (const name in settingNames) {
|
|
697
|
-
const setting =
|
|
706
|
+
const setting = this.#settings.createSetting(name, empty);
|
|
698
707
|
const value = setting.get();
|
|
699
708
|
if (value === empty) {
|
|
700
709
|
continue;
|
|
@@ -714,7 +723,7 @@ export class VersionController {
|
|
|
714
723
|
updateVersionFrom8To9() {
|
|
715
724
|
const settingNames = ['skipStackFramesPattern', 'workspaceFolderExcludePattern'];
|
|
716
725
|
for (let i = 0; i < settingNames.length; ++i) {
|
|
717
|
-
const setting =
|
|
726
|
+
const setting = this.#settings.createSetting(settingNames[i], '');
|
|
718
727
|
let value = setting.get();
|
|
719
728
|
if (!value) {
|
|
720
729
|
return;
|
|
@@ -744,7 +753,7 @@ export class VersionController {
|
|
|
744
753
|
updateVersionFrom10To11() {
|
|
745
754
|
const oldSettingName = 'customDevicePresets';
|
|
746
755
|
const newSettingName = 'customEmulatedDeviceList';
|
|
747
|
-
const oldSetting =
|
|
756
|
+
const oldSetting = this.#settings.createSetting(oldSettingName, undefined);
|
|
748
757
|
const list = oldSetting.get();
|
|
749
758
|
if (!Array.isArray(list)) {
|
|
750
759
|
return;
|
|
@@ -773,23 +782,23 @@ export class VersionController {
|
|
|
773
782
|
newList.push(device);
|
|
774
783
|
}
|
|
775
784
|
if (newList.length) {
|
|
776
|
-
|
|
785
|
+
this.#settings.createSetting(newSettingName, []).set(newList);
|
|
777
786
|
}
|
|
778
|
-
removeSetting(oldSetting);
|
|
787
|
+
this.#removeSetting(oldSetting);
|
|
779
788
|
}
|
|
780
789
|
updateVersionFrom11To12() {
|
|
781
790
|
this.migrateSettingsFromLocalStorage();
|
|
782
791
|
}
|
|
783
792
|
updateVersionFrom12To13() {
|
|
784
793
|
this.migrateSettingsFromLocalStorage();
|
|
785
|
-
removeSetting(
|
|
794
|
+
this.#removeSetting(this.#settings.createSetting('timelineOverviewMode', ''));
|
|
786
795
|
}
|
|
787
796
|
updateVersionFrom13To14() {
|
|
788
797
|
const defaultValue = { throughput: -1, latency: 0 };
|
|
789
|
-
|
|
798
|
+
this.#settings.createSetting('networkConditions', defaultValue).set(defaultValue);
|
|
790
799
|
}
|
|
791
800
|
updateVersionFrom14To15() {
|
|
792
|
-
const setting =
|
|
801
|
+
const setting = this.#settings.createLocalSetting('workspaceExcludedFolders', {});
|
|
793
802
|
const oldValue = setting.get();
|
|
794
803
|
const newValue = {};
|
|
795
804
|
for (const fileSystemPath in oldValue) {
|
|
@@ -801,7 +810,7 @@ export class VersionController {
|
|
|
801
810
|
setting.set(newValue);
|
|
802
811
|
}
|
|
803
812
|
updateVersionFrom15To16() {
|
|
804
|
-
const setting =
|
|
813
|
+
const setting = this.#settings.createSetting('InspectorView.panelOrder', {});
|
|
805
814
|
const tabOrders = setting.get();
|
|
806
815
|
for (const key of Object.keys(tabOrders)) {
|
|
807
816
|
tabOrders[key] = (tabOrders[key] + 1) * 10;
|
|
@@ -809,7 +818,7 @@ export class VersionController {
|
|
|
809
818
|
setting.set(tabOrders);
|
|
810
819
|
}
|
|
811
820
|
updateVersionFrom16To17() {
|
|
812
|
-
const setting =
|
|
821
|
+
const setting = this.#settings.createSetting('networkConditionsCustomProfiles', []);
|
|
813
822
|
const oldValue = setting.get();
|
|
814
823
|
const newValue = [];
|
|
815
824
|
if (Array.isArray(oldValue)) {
|
|
@@ -826,7 +835,7 @@ export class VersionController {
|
|
|
826
835
|
setting.set(newValue);
|
|
827
836
|
}
|
|
828
837
|
updateVersionFrom17To18() {
|
|
829
|
-
const setting =
|
|
838
|
+
const setting = this.#settings.createLocalSetting('workspaceExcludedFolders', {});
|
|
830
839
|
const oldValue = setting.get();
|
|
831
840
|
const newValue = {};
|
|
832
841
|
for (const oldKey in oldValue) {
|
|
@@ -845,7 +854,7 @@ export class VersionController {
|
|
|
845
854
|
}
|
|
846
855
|
updateVersionFrom18To19() {
|
|
847
856
|
const defaultColumns = { status: true, type: true, initiator: true, size: true, time: true };
|
|
848
|
-
const visibleColumnSettings =
|
|
857
|
+
const visibleColumnSettings = this.#settings.createSetting('networkLogColumnsVisibility', defaultColumns);
|
|
849
858
|
const visibleColumns = visibleColumnSettings.get();
|
|
850
859
|
visibleColumns.name = true;
|
|
851
860
|
visibleColumns.timeline = true;
|
|
@@ -856,25 +865,25 @@ export class VersionController {
|
|
|
856
865
|
}
|
|
857
866
|
configs[columnId.toLowerCase()] = { visible: visibleColumns[columnId] };
|
|
858
867
|
}
|
|
859
|
-
const newSetting =
|
|
868
|
+
const newSetting = this.#settings.createSetting('networkLogColumns', {});
|
|
860
869
|
newSetting.set(configs);
|
|
861
|
-
removeSetting(visibleColumnSettings);
|
|
870
|
+
this.#removeSetting(visibleColumnSettings);
|
|
862
871
|
}
|
|
863
872
|
updateVersionFrom19To20() {
|
|
864
|
-
const oldSetting =
|
|
865
|
-
const newSetting =
|
|
873
|
+
const oldSetting = this.#settings.createSetting('InspectorView.panelOrder', {});
|
|
874
|
+
const newSetting = this.#settings.createSetting('panel-tabOrder', {});
|
|
866
875
|
newSetting.set(oldSetting.get());
|
|
867
|
-
removeSetting(oldSetting);
|
|
876
|
+
this.#removeSetting(oldSetting);
|
|
868
877
|
}
|
|
869
878
|
updateVersionFrom20To21() {
|
|
870
|
-
const networkColumns =
|
|
879
|
+
const networkColumns = this.#settings.createSetting('networkLogColumns', {});
|
|
871
880
|
const columns = networkColumns.get();
|
|
872
881
|
delete columns['timeline'];
|
|
873
882
|
delete columns['waterfall'];
|
|
874
883
|
networkColumns.set(columns);
|
|
875
884
|
}
|
|
876
885
|
updateVersionFrom21To22() {
|
|
877
|
-
const breakpointsSetting =
|
|
886
|
+
const breakpointsSetting = this.#settings.createLocalSetting('breakpoints', []);
|
|
878
887
|
const breakpoints = breakpointsSetting.get();
|
|
879
888
|
for (const breakpoint of breakpoints) {
|
|
880
889
|
breakpoint['url'] = breakpoint['sourceFileId'];
|
|
@@ -886,32 +895,33 @@ export class VersionController {
|
|
|
886
895
|
// This update is no-op.
|
|
887
896
|
}
|
|
888
897
|
updateVersionFrom23To24() {
|
|
889
|
-
const oldSetting =
|
|
890
|
-
const newSetting =
|
|
898
|
+
const oldSetting = this.#settings.createSetting('searchInContentScripts', false);
|
|
899
|
+
const newSetting = this.#settings.createSetting('searchInAnonymousAndContentScripts', false);
|
|
891
900
|
newSetting.set(oldSetting.get());
|
|
892
|
-
removeSetting(oldSetting);
|
|
901
|
+
this.#removeSetting(oldSetting);
|
|
893
902
|
}
|
|
894
903
|
updateVersionFrom24To25() {
|
|
895
904
|
const defaultColumns = { status: true, type: true, initiator: true, size: true, time: true };
|
|
896
|
-
const networkLogColumnsSetting =
|
|
905
|
+
const networkLogColumnsSetting = this.#settings.createSetting('networkLogColumns', defaultColumns);
|
|
897
906
|
const columns = networkLogColumnsSetting.get();
|
|
898
907
|
delete columns.product;
|
|
899
908
|
networkLogColumnsSetting.set(columns);
|
|
900
909
|
}
|
|
901
910
|
updateVersionFrom25To26() {
|
|
902
|
-
const oldSetting =
|
|
911
|
+
const oldSetting = this.#settings.createSetting('messageURLFilters', {});
|
|
903
912
|
const urls = Object.keys(oldSetting.get());
|
|
904
913
|
const textFilter = urls.map(url => `-url:${url}`).join(' ');
|
|
905
914
|
if (textFilter) {
|
|
906
|
-
const textFilterSetting =
|
|
915
|
+
const textFilterSetting = this.#settings.createSetting('console.textFilter', '');
|
|
907
916
|
const suffix = textFilterSetting.get() ? ` ${textFilterSetting.get()}` : '';
|
|
908
917
|
textFilterSetting.set(`${textFilter}${suffix}`);
|
|
909
918
|
}
|
|
910
|
-
removeSetting(oldSetting);
|
|
919
|
+
this.#removeSetting(oldSetting);
|
|
911
920
|
}
|
|
912
921
|
updateVersionFrom26To27() {
|
|
922
|
+
const settings = this.#settings;
|
|
913
923
|
function renameKeyInObjectSetting(settingName, from, to) {
|
|
914
|
-
const setting =
|
|
924
|
+
const setting = settings.createSetting(settingName, {});
|
|
915
925
|
const value = setting.get();
|
|
916
926
|
if (from in value) {
|
|
917
927
|
value[to] = value[from];
|
|
@@ -920,7 +930,7 @@ export class VersionController {
|
|
|
920
930
|
}
|
|
921
931
|
}
|
|
922
932
|
function renameInStringSetting(settingName, from, to) {
|
|
923
|
-
const setting =
|
|
933
|
+
const setting = settings.createSetting(settingName, '');
|
|
924
934
|
const value = setting.get();
|
|
925
935
|
if (value === from) {
|
|
926
936
|
setting.set(to);
|
|
@@ -931,14 +941,15 @@ export class VersionController {
|
|
|
931
941
|
renameInStringSetting('panel-selectedTab', 'audits2', 'audits');
|
|
932
942
|
}
|
|
933
943
|
updateVersionFrom27To28() {
|
|
934
|
-
const setting =
|
|
944
|
+
const setting = this.#settings.createSetting('uiTheme', 'systemPreferred');
|
|
935
945
|
if (setting.get() === 'default') {
|
|
936
946
|
setting.set('systemPreferred');
|
|
937
947
|
}
|
|
938
948
|
}
|
|
939
949
|
updateVersionFrom28To29() {
|
|
950
|
+
const settings = this.#settings;
|
|
940
951
|
function renameKeyInObjectSetting(settingName, from, to) {
|
|
941
|
-
const setting =
|
|
952
|
+
const setting = settings.createSetting(settingName, {});
|
|
942
953
|
const value = setting.get();
|
|
943
954
|
if (from in value) {
|
|
944
955
|
value[to] = value[from];
|
|
@@ -947,7 +958,7 @@ export class VersionController {
|
|
|
947
958
|
}
|
|
948
959
|
}
|
|
949
960
|
function renameInStringSetting(settingName, from, to) {
|
|
950
|
-
const setting =
|
|
961
|
+
const setting = settings.createSetting(settingName, '');
|
|
951
962
|
const value = setting.get();
|
|
952
963
|
if (value === from) {
|
|
953
964
|
setting.set(to);
|
|
@@ -959,31 +970,31 @@ export class VersionController {
|
|
|
959
970
|
}
|
|
960
971
|
updateVersionFrom29To30() {
|
|
961
972
|
// Create new location agnostic setting
|
|
962
|
-
const closeableTabSetting =
|
|
973
|
+
const closeableTabSetting = this.#settings.createSetting('closeableTabs', {});
|
|
963
974
|
// Read current settings
|
|
964
|
-
const panelCloseableTabSetting =
|
|
965
|
-
const drawerCloseableTabSetting =
|
|
975
|
+
const panelCloseableTabSetting = this.#settings.createSetting('panel-closeableTabs', {});
|
|
976
|
+
const drawerCloseableTabSetting = this.#settings.createSetting('drawer-view-closeableTabs', {});
|
|
966
977
|
const openTabsInPanel = panelCloseableTabSetting.get();
|
|
967
978
|
const openTabsInDrawer = panelCloseableTabSetting.get();
|
|
968
979
|
// Set #value of new setting
|
|
969
980
|
const newValue = Object.assign(openTabsInDrawer, openTabsInPanel);
|
|
970
981
|
closeableTabSetting.set(newValue);
|
|
971
982
|
// Remove old settings
|
|
972
|
-
removeSetting(panelCloseableTabSetting);
|
|
973
|
-
removeSetting(drawerCloseableTabSetting);
|
|
983
|
+
this.#removeSetting(panelCloseableTabSetting);
|
|
984
|
+
this.#removeSetting(drawerCloseableTabSetting);
|
|
974
985
|
}
|
|
975
986
|
updateVersionFrom30To31() {
|
|
976
987
|
// Remove recorder_recordings setting that was used for storing recordings
|
|
977
988
|
// by an old recorder experiment.
|
|
978
|
-
const recordingsSetting =
|
|
979
|
-
removeSetting(recordingsSetting);
|
|
989
|
+
const recordingsSetting = this.#settings.createSetting('recorder_recordings', []);
|
|
990
|
+
this.#removeSetting(recordingsSetting);
|
|
980
991
|
}
|
|
981
992
|
updateVersionFrom31To32() {
|
|
982
993
|
// Introduce the new 'resourceTypeName' property on stored breakpoints. Prior to
|
|
983
994
|
// this change we synchronized the breakpoint only by URL, but since we don't
|
|
984
995
|
// know on which resource type the given breakpoint was set, we just assume
|
|
985
996
|
// 'script' here to keep things simple.
|
|
986
|
-
const breakpointsSetting =
|
|
997
|
+
const breakpointsSetting = this.#settings.createLocalSetting('breakpoints', []);
|
|
987
998
|
const breakpoints = breakpointsSetting.get();
|
|
988
999
|
for (const breakpoint of breakpoints) {
|
|
989
1000
|
breakpoint['resourceTypeName'] = 'script';
|
|
@@ -991,7 +1002,7 @@ export class VersionController {
|
|
|
991
1002
|
breakpointsSetting.set(breakpoints);
|
|
992
1003
|
}
|
|
993
1004
|
updateVersionFrom32To33() {
|
|
994
|
-
const previouslyViewedFilesSetting =
|
|
1005
|
+
const previouslyViewedFilesSetting = this.#settings.createLocalSetting('previouslyViewedFiles', []);
|
|
995
1006
|
let previouslyViewedFiles = previouslyViewedFilesSetting.get();
|
|
996
1007
|
// Discard old 'previouslyViewedFiles' items that don't have a 'url' property.
|
|
997
1008
|
previouslyViewedFiles = previouslyViewedFiles.filter((previouslyViewedFile) => 'url' in previouslyViewedFile);
|
|
@@ -1015,7 +1026,7 @@ export class VersionController {
|
|
|
1015
1026
|
// the future.
|
|
1016
1027
|
const logpointPrefix = '/** DEVTOOLS_LOGPOINT */ console.log(';
|
|
1017
1028
|
const logpointSuffix = ')';
|
|
1018
|
-
const breakpointsSetting =
|
|
1029
|
+
const breakpointsSetting = this.#settings.createLocalSetting('breakpoints', []);
|
|
1019
1030
|
const breakpoints = breakpointsSetting.get();
|
|
1020
1031
|
for (const breakpoint of breakpoints) {
|
|
1021
1032
|
const isLogpoint = breakpoint.condition.startsWith(logpointPrefix) && breakpoint.condition.endsWith(logpointSuffix);
|
|
@@ -1031,7 +1042,7 @@ export class VersionController {
|
|
|
1031
1042
|
// the future.
|
|
1032
1043
|
const logpointPrefix = '/** DEVTOOLS_LOGPOINT */ console.log(';
|
|
1033
1044
|
const logpointSuffix = ')';
|
|
1034
|
-
const breakpointsSetting =
|
|
1045
|
+
const breakpointsSetting = this.#settings.createLocalSetting('breakpoints', []);
|
|
1035
1046
|
const breakpoints = breakpointsSetting.get();
|
|
1036
1047
|
for (const breakpoint of breakpoints) {
|
|
1037
1048
|
const { condition, isLogpoint } = breakpoint;
|
|
@@ -1043,7 +1054,7 @@ export class VersionController {
|
|
|
1043
1054
|
}
|
|
1044
1055
|
updateVersionFrom35To36() {
|
|
1045
1056
|
// We have changed the default from 'false' to 'true' and this updates the existing setting just for once.
|
|
1046
|
-
|
|
1057
|
+
this.#settings.createSetting('showThirdPartyIssues', true).set(true);
|
|
1047
1058
|
}
|
|
1048
1059
|
updateVersionFrom36To37() {
|
|
1049
1060
|
const updateStorage = (storage) => {
|
|
@@ -1051,22 +1062,22 @@ export class VersionController {
|
|
|
1051
1062
|
const normalizedKey = Settings.normalizeSettingName(key);
|
|
1052
1063
|
if (normalizedKey !== key) {
|
|
1053
1064
|
const value = storage.get(key);
|
|
1054
|
-
removeSetting({ name: key, storage });
|
|
1065
|
+
this.#removeSetting({ name: key, storage });
|
|
1055
1066
|
storage.set(normalizedKey, value);
|
|
1056
1067
|
}
|
|
1057
1068
|
}
|
|
1058
1069
|
};
|
|
1059
|
-
updateStorage(
|
|
1060
|
-
updateStorage(
|
|
1061
|
-
updateStorage(
|
|
1062
|
-
for (const key of
|
|
1070
|
+
updateStorage(this.#settings.globalStorage);
|
|
1071
|
+
updateStorage(this.#settings.syncedStorage);
|
|
1072
|
+
updateStorage(this.#settings.localStorage);
|
|
1073
|
+
for (const key of this.#settings.globalStorage.keys()) {
|
|
1063
1074
|
if ((key.startsWith('data-grid-') && key.endsWith('-column-weights')) || key.endsWith('-tab-order') ||
|
|
1064
1075
|
key === 'views-location-override' || key === 'closeable-tabs') {
|
|
1065
|
-
const setting =
|
|
1076
|
+
const setting = this.#settings.createSetting(key, {});
|
|
1066
1077
|
setting.set(Platform.StringUtilities.toKebabCaseKeys(setting.get()));
|
|
1067
1078
|
}
|
|
1068
1079
|
if (key.endsWith('-selected-tab')) {
|
|
1069
|
-
const setting =
|
|
1080
|
+
const setting = this.#settings.createSetting(key, '');
|
|
1070
1081
|
setting.set(Platform.StringUtilities.toKebabCase(setting.get()));
|
|
1071
1082
|
}
|
|
1072
1083
|
}
|
|
@@ -1074,14 +1085,14 @@ export class VersionController {
|
|
|
1074
1085
|
updateVersionFrom37To38() {
|
|
1075
1086
|
const getConsoleInsightsEnabledSetting = () => {
|
|
1076
1087
|
try {
|
|
1077
|
-
return moduleSetting('console-insights-enabled');
|
|
1088
|
+
return this.#settings.moduleSetting('console-insights-enabled');
|
|
1078
1089
|
}
|
|
1079
1090
|
catch {
|
|
1080
1091
|
return;
|
|
1081
1092
|
}
|
|
1082
1093
|
};
|
|
1083
1094
|
const consoleInsightsEnabled = getConsoleInsightsEnabledSetting();
|
|
1084
|
-
const onboardingFinished =
|
|
1095
|
+
const onboardingFinished = this.#settings.createLocalSetting('console-insights-onboarding-finished', false);
|
|
1085
1096
|
if (consoleInsightsEnabled && consoleInsightsEnabled.get() === true && onboardingFinished.get() === false) {
|
|
1086
1097
|
consoleInsightsEnabled.set(false);
|
|
1087
1098
|
}
|
|
@@ -1096,7 +1107,7 @@ export class VersionController {
|
|
|
1096
1107
|
// Note: we load the raw value via the globalStorage here because
|
|
1097
1108
|
// `createSetting` creates if it is not present, and we do not want that;
|
|
1098
1109
|
// we only want to update existing, old values.
|
|
1099
|
-
const setting =
|
|
1110
|
+
const setting = this.#settings.globalStorage.get(PREFERRED_NETWORK_COND);
|
|
1100
1111
|
if (!setting) {
|
|
1101
1112
|
return;
|
|
1102
1113
|
}
|
|
@@ -1105,17 +1116,17 @@ export class VersionController {
|
|
|
1105
1116
|
if (networkSetting.title === 'Slow 3G') {
|
|
1106
1117
|
networkSetting.title = '3G';
|
|
1107
1118
|
networkSetting.i18nTitleKey = '3G';
|
|
1108
|
-
|
|
1119
|
+
this.#settings.globalStorage.set(PREFERRED_NETWORK_COND, JSON.stringify(networkSetting));
|
|
1109
1120
|
}
|
|
1110
1121
|
else if (networkSetting.title === 'Fast 3G') {
|
|
1111
1122
|
networkSetting.title = 'Slow 4G';
|
|
1112
1123
|
networkSetting.i18nTitleKey = 'Slow 4G';
|
|
1113
|
-
|
|
1124
|
+
this.#settings.globalStorage.set(PREFERRED_NETWORK_COND, JSON.stringify(networkSetting));
|
|
1114
1125
|
}
|
|
1115
1126
|
}
|
|
1116
1127
|
catch {
|
|
1117
1128
|
// If parsing the setting threw, it's in some invalid state, so remove it.
|
|
1118
|
-
|
|
1129
|
+
this.#settings.globalStorage.remove(PREFERRED_NETWORK_COND);
|
|
1119
1130
|
}
|
|
1120
1131
|
}
|
|
1121
1132
|
/**
|
|
@@ -1130,7 +1141,7 @@ export class VersionController {
|
|
|
1130
1141
|
const hasCustomNetworkConditionsSetting = () => {
|
|
1131
1142
|
try {
|
|
1132
1143
|
// this will error if it does not exist
|
|
1133
|
-
moduleSetting('custom-network-conditions');
|
|
1144
|
+
this.#settings.moduleSetting('custom-network-conditions');
|
|
1134
1145
|
return true;
|
|
1135
1146
|
}
|
|
1136
1147
|
catch {
|
|
@@ -1147,7 +1158,7 @@ export class VersionController {
|
|
|
1147
1158
|
* objects, and we need to set the right key on each one. The actual keys &
|
|
1148
1159
|
* values in the object are not important.
|
|
1149
1160
|
*/
|
|
1150
|
-
const conditionsSetting = moduleSetting('custom-network-conditions');
|
|
1161
|
+
const conditionsSetting = this.#settings.moduleSetting('custom-network-conditions');
|
|
1151
1162
|
const customConditions = conditionsSetting.get();
|
|
1152
1163
|
if (customConditions?.length > 0) {
|
|
1153
1164
|
customConditions.forEach((condition, i) => {
|
|
@@ -1171,7 +1182,7 @@ export class VersionController {
|
|
|
1171
1182
|
// is more likely to change. This migration step tries to update the
|
|
1172
1183
|
// setting for users, or removes it if we fail, so they start fresh next
|
|
1173
1184
|
// time they load DevTools.
|
|
1174
|
-
const setting =
|
|
1185
|
+
const setting = this.#settings.globalStorage.get(PREFERRED_NETWORK_COND_SETTING);
|
|
1175
1186
|
if (!setting) {
|
|
1176
1187
|
return;
|
|
1177
1188
|
}
|
|
@@ -1191,13 +1202,13 @@ export class VersionController {
|
|
|
1191
1202
|
const key = UI_STRING_TO_NEW_KEY[networkSetting.i18nTitleKey];
|
|
1192
1203
|
// The second argument is the default value, so it's important that we
|
|
1193
1204
|
// set this to the default, and then update it to the new key.
|
|
1194
|
-
const newSetting =
|
|
1205
|
+
const newSetting = this.#settings.createSetting('active-network-condition-key', 'NO_THROTTLING');
|
|
1195
1206
|
newSetting.set(key);
|
|
1196
1207
|
}
|
|
1197
1208
|
}
|
|
1198
1209
|
finally {
|
|
1199
1210
|
// This setting is now not used, so we can remove it.
|
|
1200
|
-
|
|
1211
|
+
this.#settings.globalStorage.remove(PREFERRED_NETWORK_COND_SETTING);
|
|
1201
1212
|
}
|
|
1202
1213
|
}
|
|
1203
1214
|
/*
|
|
@@ -1232,7 +1243,7 @@ export class VersionController {
|
|
|
1232
1243
|
}
|
|
1233
1244
|
const value = window.localStorage[key];
|
|
1234
1245
|
window.localStorage.removeItem(key);
|
|
1235
|
-
|
|
1246
|
+
this.#settings.globalStorage.set(key, value);
|
|
1236
1247
|
}
|
|
1237
1248
|
}
|
|
1238
1249
|
clearBreakpointsWhenTooMany(breakpointsSetting, maxBreakpointsCount) {
|
|
@@ -63,9 +63,9 @@ export class Throttler {
|
|
|
63
63
|
}
|
|
64
64
|
clearTimeout(this.#processTimeout);
|
|
65
65
|
const timeout = this.#asSoonAsPossible ? 0 : this.#timeout;
|
|
66
|
-
this.#processTimeout =
|
|
66
|
+
this.#processTimeout = setTimeout(this.#onTimeout.bind(this), timeout);
|
|
67
67
|
}
|
|
68
68
|
#getTime() {
|
|
69
|
-
return
|
|
69
|
+
return performance.now();
|
|
70
70
|
}
|
|
71
71
|
}
|