chrome-devtools-frontend 1.0.1654411 → 1.0.1656897
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/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +116 -0
- package/.agents/skills/ui-eng-vision-logic-consolidator/SKILL.md +82 -0
- package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +123 -0
- package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +125 -0
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +75 -0
- package/AUTHORS +1 -0
- package/config/owner/COMMON_OWNERS +0 -4
- package/docs/playbook.md +1 -1
- package/front_end/Tests.js +1 -0
- package/front_end/core/common/Settings.ts +47 -30
- package/front_end/core/sdk/CPUThrottlingManager.ts +10 -159
- package/front_end/core/sdk/ConsoleModel.ts +13 -11
- package/front_end/core/sdk/DOMDebuggerModel.ts +11 -5
- package/front_end/core/sdk/DOMModel.ts +7 -5
- package/front_end/core/sdk/EventBreakpointsModel.ts +9 -5
- package/front_end/core/sdk/IsolateManager.ts +6 -6
- package/front_end/core/sdk/ResourceTreeModel.ts +5 -3
- package/front_end/core/sdk/SourceMapCache.ts +2 -4
- package/front_end/core/sdk/SourceMapManager.ts +8 -7
- package/front_end/core/sdk/TargetManager.ts +17 -0
- package/front_end/entrypoints/devtools_app/devtools_app.ts +0 -1
- package/front_end/entrypoints/main/MainImpl.ts +12 -36
- package/front_end/entrypoints/main/SimpleApp.ts +0 -13
- package/front_end/entrypoints/main/main-meta.ts +1 -1
- package/front_end/foundation/Universe.ts +110 -3
- package/front_end/generated/InspectorBackendCommands.ts +5 -1
- package/front_end/generated/SupportedCSSProperties.js +2 -6
- package/front_end/generated/protocol-mapping.d.ts +8 -0
- package/front_end/generated/protocol-proxy-api.d.ts +15 -0
- package/front_end/generated/protocol.ts +36 -1
- package/front_end/models/ai_assistance/AiConversation.ts +0 -6
- package/front_end/models/ai_assistance/agents/NetworkAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +2 -156
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -24
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -358
- package/front_end/models/ai_assistance/ai_assistance.ts +0 -6
- package/front_end/models/ai_assistance/contexts/RequestContext.snapshot.txt +0 -1
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +0 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -14
- package/front_end/models/autofill_manager/AutofillManager.ts +1 -2
- package/front_end/models/crux-manager/CrUXManager.ts +16 -11
- package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
- package/front_end/models/persistence/AutomaticFileSystemManager.ts +14 -13
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +12 -9
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +18 -9
- package/front_end/models/project_settings/ProjectSettingsModel.ts +12 -11
- package/front_end/models/trace/handlers/ScreenshotsHandler.ts +14 -59
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +3 -29
- package/front_end/panels/application/DeviceBoundSessionsView.ts +15 -3
- package/front_end/panels/application/FrameDetailsView.ts +2 -1
- package/front_end/panels/application/ServiceWorkersView.ts +193 -161
- package/front_end/panels/application/serviceWorkersView.css +8 -0
- package/front_end/panels/common/CPUThrottlingOption.ts +142 -0
- package/front_end/panels/common/ThrottlingUtils.ts +9 -4
- package/front_end/panels/common/common.ts +1 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +45 -0
- package/front_end/panels/elements/ElementsPanel.ts +35 -102
- package/front_end/panels/elements/ElementsTreeOutline.ts +0 -4
- package/front_end/panels/elements/elements-meta.ts +3 -2
- package/front_end/panels/emulation/DeviceModeToolbar.ts +46 -45
- package/front_end/panels/mobile_throttling/CalibrationController.ts +6 -5
- package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +40 -13
- package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +13 -17
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +15 -13
- package/front_end/panels/network/NetworkLogView.ts +0 -9
- package/front_end/panels/network/NetworkPanel.ts +1 -63
- package/front_end/panels/network/RequestInitiatorView.ts +29 -4
- package/front_end/panels/network/components/HeaderSectionRow.css +9 -7
- package/front_end/panels/network/components/HeaderSectionRow.ts +20 -1
- package/front_end/panels/network/components/RequestHeaderSection.css +5 -3
- package/front_end/panels/network/components/RequestHeaderSection.ts +1 -2
- package/front_end/panels/network/components/RequestHeadersView.css +1 -1
- package/front_end/panels/security/SecurityPanel.ts +36 -23
- package/front_end/panels/settings/SettingsScreen.ts +18 -103
- package/front_end/panels/settings/settings-meta.ts +0 -24
- package/front_end/panels/timeline/TimelineController.ts +3 -2
- package/front_end/panels/timeline/TimelinePanel.ts +20 -3
- package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +15 -14
- package/front_end/panels/timeline/timelineFlamechartPopover.css +2 -0
- package/front_end/panels/utils/utils.ts +25 -24
- 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/es5-iife/puppeteer-core-browser.d.ts +34 -55
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +96 -83
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +10 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js +23 -13
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js +4 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Input.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts +3 -41
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js +5 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +34 -55
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +13 -1
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +2 -3
- package/front_end/third_party/puppeteer/package/src/api/CDPSession.ts +3 -1
- package/front_end/third_party/puppeteer/package/src/api/HTTPResponse.ts +3 -2
- package/front_end/third_party/puppeteer/package/src/api/Realm.ts +1 -2
- package/front_end/third_party/puppeteer/package/src/api/Target.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +1 -2
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +3 -1
- package/front_end/third_party/puppeteer/package/src/bidi/core/Realm.ts +1 -3
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +13 -3
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +24 -13
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPResponse.ts +4 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Input.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/LifecycleWatcher.ts +1 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +2 -4
- package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +7 -76
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +1 -4
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +4 -1
- package/front_end/third_party/puppeteer/package/src/node/LaunchOptions.ts +5 -0
- package/front_end/third_party/puppeteer/package/src/revisions.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/util/httpUtils.ts +5 -5
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -1
- package/front_end/ui/components/dialogs/Dialog.ts +3 -0
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +0 -7
- package/front_end/ui/helpers/OpenInNewTab.ts +15 -7
- package/front_end/ui/legacy/TabbedPane.ts +1 -108
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +9 -0
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +172 -123
- package/front_end/ui/legacy/components/data_grid/DataGridExporter.ts +89 -0
- package/front_end/ui/legacy/components/data_grid/dataGrid.css +10 -0
- package/front_end/ui/legacy/components/data_grid/data_grid.ts +3 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +89 -40
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
- package/package.json +1 -1
- package/front_end/Images/navigationControls.png +0 -0
- package/front_end/Images/navigationControls_2x.png +0 -0
- package/front_end/Images/popoverArrows.png +0 -0
- package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +0 -746
- package/front_end/entrypoints/greendev_floaty/floaty.css +0 -301
- package/front_end/entrypoints/greendev_floaty/floaty.html +0 -38
- package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +0 -415
- package/front_end/models/ai_assistance/agents/GreenDevAgent.ts +0 -834
- package/front_end/models/ai_assistance/agents/GreenDevAgentAntigravityCliSocketClient.ts +0 -53
- package/front_end/models/ai_assistance/agents/GreenDevAgentGeminiCliSocketClient.ts +0 -117
- package/front_end/models/annotations/AnnotationRepository.ts +0 -238
- package/front_end/models/annotations/AnnotationType.ts +0 -10
- package/front_end/models/annotations/README.md +0 -7
- package/front_end/models/annotations/annotations.ts +0 -6
- package/front_end/models/greendev/Prototypes.ts +0 -68
- package/front_end/models/greendev/README.md +0 -5
- package/front_end/models/greendev/greendev.ts +0 -5
- package/front_end/panels/common/Annotation.ts +0 -184
- package/front_end/panels/common/AnnotationManager.ts +0 -208
- package/front_end/panels/common/annotation.css +0 -40
- package/front_end/panels/greendev/GreenDevPanel.css +0 -282
- package/front_end/panels/greendev/GreenDevPanel.ts +0 -364
- package/front_end/panels/greendev/GreenDevShared.ts +0 -13
- package/front_end/panels/greendev/greendev-meta.ts +0 -52
- package/front_end/panels/greendev/greendev.ts +0 -9
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Platform from '../platform/platform.js';
|
|
6
6
|
import * as Root from '../root/root.js';
|
|
7
7
|
|
|
8
|
-
import {Console} from './Console.js';
|
|
8
|
+
import type {Console} from './Console.js';
|
|
9
9
|
import type {EventDescriptor, EventTargetEvent, GenericEvents} from './EventTarget.js';
|
|
10
10
|
import {ObjectWrapper} from './Object.js';
|
|
11
11
|
import {
|
|
@@ -30,6 +30,7 @@ export interface SettingsCreationOptions {
|
|
|
30
30
|
settingRegistrations: SettingRegistration[];
|
|
31
31
|
logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>;
|
|
32
32
|
runSettingsMigration?: boolean;
|
|
33
|
+
console: Console;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
export class Settings {
|
|
@@ -45,10 +46,18 @@ export class Settings {
|
|
|
45
46
|
#registry = new Map<string, Setting<unknown>>();
|
|
46
47
|
readonly moduleSettings = new Map<string, Setting<unknown>>();
|
|
47
48
|
#logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
readonly #console: Console;
|
|
50
|
+
|
|
51
|
+
constructor({
|
|
52
|
+
syncedStorage,
|
|
53
|
+
globalStorage,
|
|
54
|
+
localStorage,
|
|
55
|
+
settingRegistrations,
|
|
56
|
+
logSettingAccess,
|
|
57
|
+
runSettingsMigration,
|
|
58
|
+
console
|
|
59
|
+
}: SettingsCreationOptions) {
|
|
60
|
+
this.#console = console;
|
|
52
61
|
this.syncedStorage = syncedStorage;
|
|
53
62
|
this.globalStorage = globalStorage;
|
|
54
63
|
this.localStorage = localStorage;
|
|
@@ -93,10 +102,17 @@ export class Settings {
|
|
|
93
102
|
globalStorage: SettingsStorage|null,
|
|
94
103
|
localStorage: SettingsStorage|null,
|
|
95
104
|
settingRegistrations: SettingRegistration[]|null,
|
|
105
|
+
console: Console|null,
|
|
96
106
|
logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>,
|
|
97
107
|
runSettingsMigration?: boolean,
|
|
98
|
-
} = {
|
|
99
|
-
|
|
108
|
+
} = {
|
|
109
|
+
forceNew: null,
|
|
110
|
+
syncedStorage: null,
|
|
111
|
+
globalStorage: null,
|
|
112
|
+
localStorage: null,
|
|
113
|
+
settingRegistrations: null,
|
|
114
|
+
console: null
|
|
115
|
+
}): Settings {
|
|
100
116
|
const {
|
|
101
117
|
forceNew,
|
|
102
118
|
syncedStorage,
|
|
@@ -104,10 +120,11 @@ export class Settings {
|
|
|
104
120
|
localStorage,
|
|
105
121
|
settingRegistrations,
|
|
106
122
|
logSettingAccess,
|
|
107
|
-
runSettingsMigration
|
|
123
|
+
runSettingsMigration,
|
|
124
|
+
console,
|
|
108
125
|
} = opts;
|
|
109
126
|
if (!Root.DevToolsContext.globalInstance().has(Settings) || forceNew) {
|
|
110
|
-
if (!syncedStorage || !globalStorage || !localStorage || !settingRegistrations) {
|
|
127
|
+
if (!syncedStorage || !globalStorage || !localStorage || !settingRegistrations || !console) {
|
|
111
128
|
throw new Error(`Unable to create settings: global and local storage must be provided: ${new Error().stack}`);
|
|
112
129
|
}
|
|
113
130
|
|
|
@@ -117,7 +134,8 @@ export class Settings {
|
|
|
117
134
|
localStorage,
|
|
118
135
|
settingRegistrations,
|
|
119
136
|
logSettingAccess,
|
|
120
|
-
runSettingsMigration
|
|
137
|
+
runSettingsMigration,
|
|
138
|
+
console,
|
|
121
139
|
}));
|
|
122
140
|
}
|
|
123
141
|
|
|
@@ -195,7 +213,7 @@ export class Settings {
|
|
|
195
213
|
const storage = this.storageFromType(storageType);
|
|
196
214
|
let setting = this.#registry.get(key) as Setting<T>;
|
|
197
215
|
if (!setting) {
|
|
198
|
-
setting = new Setting(key, defaultValue, this.#eventSupport, storage, this.#logSettingAccess);
|
|
216
|
+
setting = new Setting(key, defaultValue, this.#eventSupport, storage, this.#console, this.#logSettingAccess);
|
|
199
217
|
this.#registry.set(key, setting);
|
|
200
218
|
}
|
|
201
219
|
return setting;
|
|
@@ -208,11 +226,9 @@ export class Settings {
|
|
|
208
226
|
createRegExpSetting(key: string, defaultValue: string, regexFlags?: string, storageType?: SettingStorageType):
|
|
209
227
|
RegExpSetting {
|
|
210
228
|
if (!this.#registry.get(key)) {
|
|
211
|
-
this.#registry.set(
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
key, defaultValue, this.#eventSupport, this.storageFromType(storageType), regexFlags,
|
|
215
|
-
this.#logSettingAccess));
|
|
229
|
+
this.#registry.set(key,
|
|
230
|
+
new RegExpSetting(key, defaultValue, this.#eventSupport, this.storageFromType(storageType),
|
|
231
|
+
this.#console, regexFlags, this.#logSettingAccess));
|
|
216
232
|
}
|
|
217
233
|
return this.#registry.get(key) as RegExpSetting;
|
|
218
234
|
}
|
|
@@ -324,8 +340,8 @@ export class SettingsStorage {
|
|
|
324
340
|
return Object.keys(this.object);
|
|
325
341
|
}
|
|
326
342
|
|
|
327
|
-
dumpSizes(): void {
|
|
328
|
-
|
|
343
|
+
dumpSizes(commonConsole: Console): void {
|
|
344
|
+
commonConsole.log('Ten largest settings: ');
|
|
329
345
|
// @ts-expect-error __proto__ optimization
|
|
330
346
|
const sizes: Record<string, number> = {__proto__: null};
|
|
331
347
|
for (const key in this.object) {
|
|
@@ -340,7 +356,7 @@ export class SettingsStorage {
|
|
|
340
356
|
keys.sort(comparator);
|
|
341
357
|
|
|
342
358
|
for (let i = 0; i < 10 && i < keys.length; ++i) {
|
|
343
|
-
|
|
359
|
+
commonConsole.log('Setting: \'' + keys[i] + '\', size: ' + sizes[keys[i]]);
|
|
344
360
|
}
|
|
345
361
|
}
|
|
346
362
|
}
|
|
@@ -375,12 +391,13 @@ export class Setting<V> {
|
|
|
375
391
|
#deprecation: Deprecation|null = null;
|
|
376
392
|
#loggedInitialAccess = false;
|
|
377
393
|
#logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>;
|
|
394
|
+
readonly #console: Console;
|
|
378
395
|
|
|
379
|
-
constructor(
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>) {
|
|
396
|
+
constructor(readonly name: string, readonly defaultValue: V,
|
|
397
|
+
private readonly eventSupport: ObjectWrapper<GenericEvents>, readonly storage: SettingsStorage,
|
|
398
|
+
console: Console, logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>) {
|
|
383
399
|
storage.register(this.name);
|
|
400
|
+
this.#console = console;
|
|
384
401
|
this.#logSettingAccess = logSettingAccess;
|
|
385
402
|
}
|
|
386
403
|
|
|
@@ -532,7 +549,7 @@ export class Setting<V> {
|
|
|
532
549
|
this.printSettingsSavingError(e.message, settingString);
|
|
533
550
|
}
|
|
534
551
|
} catch (e) {
|
|
535
|
-
|
|
552
|
+
this.#console.error('Cannot stringify setting with name: ' + this.name + ', error: ' + e.message);
|
|
536
553
|
}
|
|
537
554
|
this.eventSupport.dispatchEventToListeners(this.name, value);
|
|
538
555
|
}
|
|
@@ -623,8 +640,8 @@ export class Setting<V> {
|
|
|
623
640
|
const errorMessage =
|
|
624
641
|
'Error saving setting with name: ' + this.name + ', value length: ' + value.length + '. Error: ' + message;
|
|
625
642
|
console.error(errorMessage);
|
|
626
|
-
|
|
627
|
-
this.storage.dumpSizes();
|
|
643
|
+
this.#console.error(errorMessage);
|
|
644
|
+
this.storage.dumpSizes(this.#console);
|
|
628
645
|
}
|
|
629
646
|
}
|
|
630
647
|
|
|
@@ -633,10 +650,10 @@ export class RegExpSetting extends Setting<any> {
|
|
|
633
650
|
#regexFlags?: string;
|
|
634
651
|
#regex?: RegExp|null;
|
|
635
652
|
|
|
636
|
-
constructor(
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
super(name, defaultValue ? [{pattern: defaultValue}] : [], eventSupport, storage, logSettingAccess);
|
|
653
|
+
constructor(name: string, defaultValue: string, eventSupport: ObjectWrapper<GenericEvents>, storage: SettingsStorage,
|
|
654
|
+
console: Console, regexFlags?: string,
|
|
655
|
+
logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>) {
|
|
656
|
+
super(name, defaultValue ? [{pattern: defaultValue}] : [], eventSupport, storage, console, logSettingAccess);
|
|
640
657
|
this.#regexFlags = regexFlags;
|
|
641
658
|
}
|
|
642
659
|
|
|
@@ -3,54 +3,22 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
|
-
import * as i18n from '../i18n/i18n.js';
|
|
7
6
|
import * as Root from '../root/root.js';
|
|
8
7
|
|
|
9
8
|
import {EmulationModel} from './EmulationModel.js';
|
|
10
9
|
import {type SDKModelObserver, TargetManager} from './TargetManager.js';
|
|
11
10
|
|
|
12
|
-
const UIStrings = {
|
|
13
|
-
/**
|
|
14
|
-
* @description Text label for a menu item indicating that no throttling is applied.
|
|
15
|
-
*/
|
|
16
|
-
noThrottling: 'No throttling',
|
|
17
|
-
/**
|
|
18
|
-
* @description Text label for a menu item indicating that a specific slowdown multiplier is applied.
|
|
19
|
-
* @example {2} PH1
|
|
20
|
-
*/
|
|
21
|
-
dSlowdown: '{PH1}× slowdown',
|
|
22
|
-
/**
|
|
23
|
-
* @description Text label for a menu item indicating an average mobile device.
|
|
24
|
-
*/
|
|
25
|
-
calibratedMidTierMobile: 'Mid-tier mobile',
|
|
26
|
-
/**
|
|
27
|
-
* @description Text label for a menu item indicating a below-average mobile device.
|
|
28
|
-
*/
|
|
29
|
-
calibratedLowTierMobile: 'Low-tier mobile',
|
|
30
|
-
/**
|
|
31
|
-
* @description Text label indicating why an option is not available, because the user's device is not fast enough to emulate a device.
|
|
32
|
-
*/
|
|
33
|
-
calibrationErrorDeviceTooWeak: 'Device is not powerful enough',
|
|
34
|
-
} as const;
|
|
35
|
-
const str_ = i18n.i18n.registerUIStrings('core/sdk/CPUThrottlingManager.ts', UIStrings);
|
|
36
|
-
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
37
|
-
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
38
|
-
|
|
39
11
|
export class CPUThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes> implements
|
|
40
12
|
SDKModelObserver<EmulationModel> {
|
|
41
13
|
readonly #targetManager: TargetManager;
|
|
42
|
-
#
|
|
43
|
-
#calibratedThrottlingSetting: Common.Settings.Setting<CalibratedCPUThrottling>;
|
|
14
|
+
#cpuThrottlingRate: number;
|
|
44
15
|
#hardwareConcurrency?: number;
|
|
45
16
|
#pendingMainTargetPromise?: (r: number) => void;
|
|
46
17
|
|
|
47
18
|
constructor(settings: Common.Settings.Settings, targetManager: TargetManager) {
|
|
48
19
|
super();
|
|
49
20
|
this.#targetManager = targetManager;
|
|
50
|
-
this.#
|
|
51
|
-
this.#calibratedThrottlingSetting = settings.createSetting<CalibratedCPUThrottling>(
|
|
52
|
-
'calibrated-cpu-throttling', {}, Common.Settings.SettingStorageType.GLOBAL);
|
|
53
|
-
this.#calibratedThrottlingSetting.addChangeListener(this.#onCalibratedSettingChanged, this);
|
|
21
|
+
this.#cpuThrottlingRate = 1; // No throttling
|
|
54
22
|
targetManager.observeModels(EmulationModel, this);
|
|
55
23
|
}
|
|
56
24
|
|
|
@@ -75,43 +43,19 @@ export class CPUThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<Eve
|
|
|
75
43
|
}
|
|
76
44
|
|
|
77
45
|
cpuThrottlingRate(): number {
|
|
78
|
-
return this.#
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
cpuThrottlingOption(): CPUThrottlingOption {
|
|
82
|
-
return this.#cpuThrottlingOption;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
#onCalibratedSettingChanged(): void {
|
|
86
|
-
// If a calibrated option is selected, need to propagate new rate.
|
|
87
|
-
const currentOption = this.#cpuThrottlingOption;
|
|
88
|
-
if (!currentOption.calibratedDeviceType) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const rate = this.#cpuThrottlingOption.rate();
|
|
93
|
-
if (rate === 0) {
|
|
94
|
-
// This calibrated option is no longer valid.
|
|
95
|
-
this.setCPUThrottlingOption(NoThrottlingOption);
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
for (const emulationModel of this.#targetManager.models(EmulationModel)) {
|
|
100
|
-
void emulationModel.setCPUThrottlingRate(rate);
|
|
101
|
-
}
|
|
102
|
-
this.dispatchEventToListeners(Events.RATE_CHANGED, rate);
|
|
46
|
+
return this.#cpuThrottlingRate;
|
|
103
47
|
}
|
|
104
48
|
|
|
105
|
-
|
|
106
|
-
if (
|
|
49
|
+
setCPUThrottlingRate(rate: number): void {
|
|
50
|
+
if (rate === this.#cpuThrottlingRate) {
|
|
107
51
|
return;
|
|
108
52
|
}
|
|
109
53
|
|
|
110
|
-
this.#
|
|
54
|
+
this.#cpuThrottlingRate = rate;
|
|
111
55
|
for (const emulationModel of this.#targetManager.models(EmulationModel)) {
|
|
112
|
-
void emulationModel.setCPUThrottlingRate(this.#
|
|
56
|
+
void emulationModel.setCPUThrottlingRate(this.#cpuThrottlingRate);
|
|
113
57
|
}
|
|
114
|
-
this.dispatchEventToListeners(Events.RATE_CHANGED, this.#
|
|
58
|
+
this.dispatchEventToListeners(Events.RATE_CHANGED, this.#cpuThrottlingRate);
|
|
115
59
|
}
|
|
116
60
|
|
|
117
61
|
setHardwareConcurrency(concurrency: number): void {
|
|
@@ -166,8 +110,8 @@ export class CPUThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<Eve
|
|
|
166
110
|
}
|
|
167
111
|
|
|
168
112
|
modelAdded(emulationModel: EmulationModel): void {
|
|
169
|
-
if (this.#
|
|
170
|
-
void emulationModel.setCPUThrottlingRate(this.#
|
|
113
|
+
if (this.#cpuThrottlingRate !== 1) {
|
|
114
|
+
void emulationModel.setCPUThrottlingRate(this.#cpuThrottlingRate);
|
|
171
115
|
}
|
|
172
116
|
if (this.#hardwareConcurrency !== undefined) {
|
|
173
117
|
void emulationModel.setHardwareConcurrency(this.#hardwareConcurrency);
|
|
@@ -195,96 +139,3 @@ export interface EventTypes {
|
|
|
195
139
|
[Events.RATE_CHANGED]: number;
|
|
196
140
|
[Events.HARDWARE_CONCURRENCY_CHANGED]: number;
|
|
197
141
|
}
|
|
198
|
-
|
|
199
|
-
export enum CPUThrottlingRates {
|
|
200
|
-
NO_THROTTLING = 1,
|
|
201
|
-
MID_TIER_MOBILE = 4,
|
|
202
|
-
LOW_TIER_MOBILE = 6,
|
|
203
|
-
EXTRA_SLOW = 20,
|
|
204
|
-
|
|
205
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Used by web_tests.
|
|
206
|
-
MidTierMobile = MID_TIER_MOBILE,
|
|
207
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Used by web_tests.
|
|
208
|
-
LowEndMobile = LOW_TIER_MOBILE,
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export type CalibratedDeviceType = 'low-tier-mobile'|'mid-tier-mobile';
|
|
212
|
-
|
|
213
|
-
export interface CPUThrottlingOption {
|
|
214
|
-
title: () => string;
|
|
215
|
-
rate: () => number;
|
|
216
|
-
calibratedDeviceType?: CalibratedDeviceType;
|
|
217
|
-
jslogContext: string;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
function makeFixedPresetThrottlingOption(rate: CPUThrottlingRates): CPUThrottlingOption {
|
|
221
|
-
return {
|
|
222
|
-
title: rate === 1 ? i18nLazyString(UIStrings.noThrottling) : i18nLazyString(UIStrings.dSlowdown, {PH1: rate}),
|
|
223
|
-
rate: () => rate,
|
|
224
|
-
jslogContext: rate === 1 ? 'cpu-no-throttling' : `cpu-throttled-${rate}`,
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
export const NoThrottlingOption = makeFixedPresetThrottlingOption(CPUThrottlingRates.NO_THROTTLING);
|
|
229
|
-
export const MidTierThrottlingOption = makeFixedPresetThrottlingOption(CPUThrottlingRates.MID_TIER_MOBILE);
|
|
230
|
-
export const LowTierThrottlingOption = makeFixedPresetThrottlingOption(CPUThrottlingRates.LOW_TIER_MOBILE);
|
|
231
|
-
export const ExtraSlowThrottlingOption = makeFixedPresetThrottlingOption(CPUThrottlingRates.EXTRA_SLOW);
|
|
232
|
-
|
|
233
|
-
function makeCalibratedThrottlingOption(calibratedDeviceType: CalibratedDeviceType): CPUThrottlingOption {
|
|
234
|
-
const getSettingValue = (): number|CalibrationError|null => {
|
|
235
|
-
const setting = Common.Settings.Settings.instance().createSetting<CalibratedCPUThrottling>(
|
|
236
|
-
'calibrated-cpu-throttling', {}, Common.Settings.SettingStorageType.GLOBAL);
|
|
237
|
-
const value = setting.get();
|
|
238
|
-
if (calibratedDeviceType === 'low-tier-mobile') {
|
|
239
|
-
return value.low ?? null;
|
|
240
|
-
}
|
|
241
|
-
if (calibratedDeviceType === 'mid-tier-mobile') {
|
|
242
|
-
return value.mid ?? null;
|
|
243
|
-
}
|
|
244
|
-
return null;
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
return {
|
|
248
|
-
title(): string {
|
|
249
|
-
const typeString = calibratedDeviceType === 'low-tier-mobile' ? i18nString(UIStrings.calibratedLowTierMobile) :
|
|
250
|
-
i18nString(UIStrings.calibratedMidTierMobile);
|
|
251
|
-
|
|
252
|
-
const value = getSettingValue();
|
|
253
|
-
if (typeof value === 'number') {
|
|
254
|
-
return `${typeString} – ${value.toFixed(1)}×`;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
return typeString;
|
|
258
|
-
},
|
|
259
|
-
rate(): number {
|
|
260
|
-
const value = getSettingValue();
|
|
261
|
-
if (typeof value === 'number') {
|
|
262
|
-
return value;
|
|
263
|
-
}
|
|
264
|
-
return 0;
|
|
265
|
-
},
|
|
266
|
-
calibratedDeviceType,
|
|
267
|
-
jslogContext: `cpu-throttled-calibrated-${calibratedDeviceType}`,
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
export const CalibratedLowTierMobileThrottlingOption = makeCalibratedThrottlingOption('low-tier-mobile');
|
|
272
|
-
export const CalibratedMidTierMobileThrottlingOption = makeCalibratedThrottlingOption('mid-tier-mobile');
|
|
273
|
-
|
|
274
|
-
export interface CalibratedCPUThrottling {
|
|
275
|
-
/** Either the CPU multiplier, or an error code for why it could not be determined. */
|
|
276
|
-
low?: number|CalibrationError;
|
|
277
|
-
mid?: number|CalibrationError;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
export enum CalibrationError {
|
|
281
|
-
DEVICE_TOO_WEAK = 'DEVICE_TOO_WEAK',
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
export function calibrationErrorToString(error: CalibrationError): string {
|
|
285
|
-
if (error === CalibrationError.DEVICE_TOO_WEAK) {
|
|
286
|
-
return i18nString(UIStrings.calibrationErrorDeviceTooWeak);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
return error;
|
|
290
|
-
}
|
|
@@ -71,6 +71,7 @@ const str_ = i18n.i18n.registerUIStrings('core/sdk/ConsoleModel.ts', UIStrings);
|
|
|
71
71
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
72
72
|
|
|
73
73
|
export class ConsoleModel extends SDKModel<EventTypes> {
|
|
74
|
+
readonly #console: Common.Console.Console;
|
|
74
75
|
#messages: ConsoleMessage[] = [];
|
|
75
76
|
readonly #messagesByTimestamp = new Platform.MapUtilities.Multimap<number, ConsoleMessage>();
|
|
76
77
|
readonly #messageByExceptionId = new Map<RuntimeModel, Map<number, ConsoleMessage>>();
|
|
@@ -82,6 +83,7 @@ export class ConsoleModel extends SDKModel<EventTypes> {
|
|
|
82
83
|
|
|
83
84
|
constructor(target: Target) {
|
|
84
85
|
super(target);
|
|
86
|
+
this.#console = target.targetManager().getConsole();
|
|
85
87
|
|
|
86
88
|
const resourceTreeModel = target.model(ResourceTreeModel);
|
|
87
89
|
if (!resourceTreeModel || resourceTreeModel.cachedResourcesLoaded()) {
|
|
@@ -159,7 +161,7 @@ export class ConsoleModel extends SDKModel<EventTypes> {
|
|
|
159
161
|
if ('error' in result) {
|
|
160
162
|
return;
|
|
161
163
|
}
|
|
162
|
-
await
|
|
164
|
+
await this.#console.showPromise();
|
|
163
165
|
this.dispatchEventToListeners(
|
|
164
166
|
Events.CommandEvaluated,
|
|
165
167
|
{result: result.object, commandMessage: originatingMessage, exceptionDetails: result.exceptionDetails});
|
|
@@ -297,9 +299,9 @@ export class ConsoleModel extends SDKModel<EventTypes> {
|
|
|
297
299
|
if (settings.moduleSetting('preserve-console-log').get()) {
|
|
298
300
|
const {frame} = event.data;
|
|
299
301
|
if (frame.backForwardCacheDetails.restoredFromCache) {
|
|
300
|
-
|
|
302
|
+
this.#console.log(i18nString(UIStrings.bfcacheNavigation, {PH1: frame.url}));
|
|
301
303
|
} else {
|
|
302
|
-
|
|
304
|
+
this.#console.log(i18nString(UIStrings.navigatedToS, {PH1: frame.url}));
|
|
303
305
|
}
|
|
304
306
|
}
|
|
305
307
|
}
|
|
@@ -418,6 +420,14 @@ export class ConsoleModel extends SDKModel<EventTypes> {
|
|
|
418
420
|
|
|
419
421
|
async saveToTempVariable(currentExecutionContext: ExecutionContext|null, remoteObject: RemoteObject|null):
|
|
420
422
|
Promise<void> {
|
|
423
|
+
const failedToSave = (result: RemoteObject|null): void => {
|
|
424
|
+
let message = i18nString(UIStrings.failedToSaveToTempVariable);
|
|
425
|
+
if (result) {
|
|
426
|
+
message = (message + ' ' + result.description as Common.UIString.LocalizedString);
|
|
427
|
+
}
|
|
428
|
+
this.#console.error(message);
|
|
429
|
+
};
|
|
430
|
+
|
|
421
431
|
if (!remoteObject || !currentExecutionContext) {
|
|
422
432
|
failedToSave(null);
|
|
423
433
|
return;
|
|
@@ -456,14 +466,6 @@ export class ConsoleModel extends SDKModel<EventTypes> {
|
|
|
456
466
|
this[name] = value;
|
|
457
467
|
return name;
|
|
458
468
|
}
|
|
459
|
-
|
|
460
|
-
function failedToSave(result: RemoteObject|null): void {
|
|
461
|
-
let message = i18nString(UIStrings.failedToSaveToTempVariable);
|
|
462
|
-
if (result) {
|
|
463
|
-
message = (message + ' ' + result.description as Common.UIString.LocalizedString);
|
|
464
|
-
}
|
|
465
|
-
Common.Console.Console.instance().error(message);
|
|
466
|
-
}
|
|
467
469
|
}
|
|
468
470
|
}
|
|
469
471
|
|
|
@@ -6,6 +6,7 @@ import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
|
|
|
6
6
|
import * as Protocol from '../../generated/protocol.js';
|
|
7
7
|
import type * as Common from '../common/common.js';
|
|
8
8
|
import * as Platform from '../platform/platform.js';
|
|
9
|
+
import * as Root from '../root/root.js';
|
|
9
10
|
|
|
10
11
|
import {CategorizedBreakpoint, Category} from './CategorizedBreakpoint.js';
|
|
11
12
|
import type {EventListenerPausedDetailsAuxData, Location} from './DebuggerModel.js';
|
|
@@ -528,8 +529,6 @@ export class DOMEventListenerBreakpoint extends CategorizedBreakpoint {
|
|
|
528
529
|
static readonly listener = 'listener:';
|
|
529
530
|
}
|
|
530
531
|
|
|
531
|
-
let domDebuggerManagerInstance: DOMDebuggerManager;
|
|
532
|
-
|
|
533
532
|
export class DOMDebuggerManager implements SDKModelObserver<DOMDebuggerModel> {
|
|
534
533
|
readonly #xhrBreakpointsSetting: Common.Settings.Setting<Array<{url: string, enabled: boolean}>>;
|
|
535
534
|
readonly #xhrBreakpoints = new Map<string, boolean>();
|
|
@@ -671,11 +670,18 @@ export class DOMDebuggerManager implements SDKModelObserver<DOMDebuggerModel> {
|
|
|
671
670
|
targetManager?: TargetManager,
|
|
672
671
|
} = {forceNew: null}): DOMDebuggerManager {
|
|
673
672
|
const {forceNew, targetManager} = opts;
|
|
674
|
-
if (!
|
|
675
|
-
|
|
673
|
+
if (!Root.DevToolsContext.globalInstance().has(DOMDebuggerManager) || forceNew) {
|
|
674
|
+
Root.DevToolsContext.globalInstance().set(
|
|
675
|
+
DOMDebuggerManager,
|
|
676
|
+
new DOMDebuggerManager(targetManager ?? TargetManager.instance()),
|
|
677
|
+
);
|
|
676
678
|
}
|
|
677
679
|
|
|
678
|
-
return
|
|
680
|
+
return Root.DevToolsContext.globalInstance().get(DOMDebuggerManager);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
static removeInstance(): void {
|
|
684
|
+
Root.DevToolsContext.globalInstance().delete(DOMDebuggerManager);
|
|
679
685
|
}
|
|
680
686
|
|
|
681
687
|
cspViolationBreakpoints(): CSPViolationBreakpoint[] {
|
|
@@ -40,14 +40,14 @@ import * as Common from '../common/common.js';
|
|
|
40
40
|
import * as Platform from '../platform/platform.js';
|
|
41
41
|
|
|
42
42
|
import {CSSModel} from './CSSModel.js';
|
|
43
|
-
import {FrameManager} from './FrameManager.js';
|
|
43
|
+
import type {FrameManager} from './FrameManager.js';
|
|
44
44
|
import {OverlayModel} from './OverlayModel.js';
|
|
45
45
|
import {RemoteObject} from './RemoteObject.js';
|
|
46
46
|
import {Events as ResourceTreeModelEvents, type ResourceTreeFrame, ResourceTreeModel} from './ResourceTreeModel.js';
|
|
47
47
|
import {RuntimeModel} from './RuntimeModel.js';
|
|
48
48
|
import {SDKModel} from './SDKModel.js';
|
|
49
49
|
import {Capability, type Target} from './Target.js';
|
|
50
|
-
import {TargetManager} from './TargetManager.js';
|
|
50
|
+
import type {TargetManager} from './TargetManager.js';
|
|
51
51
|
|
|
52
52
|
/** Keep this list in sync with https://w3c.github.io/aria/#state_prop_def **/
|
|
53
53
|
export const ARIA_ATTRIBUTES = new Set<string>([
|
|
@@ -129,6 +129,7 @@ export interface DOMNodeEventTypes {
|
|
|
129
129
|
|
|
130
130
|
export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventTypes> {
|
|
131
131
|
#domModel: DOMModel;
|
|
132
|
+
readonly #frameManager: FrameManager;
|
|
132
133
|
#agent: ProtocolProxyApi.DOMApi;
|
|
133
134
|
ownerDocument!: DOMDocument|null;
|
|
134
135
|
#isInShadowTree!: boolean;
|
|
@@ -194,6 +195,7 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
|
|
|
194
195
|
constructor(domModel: DOMModel) {
|
|
195
196
|
super();
|
|
196
197
|
this.#domModel = domModel;
|
|
198
|
+
this.#frameManager = domModel.target().targetManager().getFrameManager();
|
|
197
199
|
this.#agent = this.#domModel.getAgent();
|
|
198
200
|
}
|
|
199
201
|
|
|
@@ -313,7 +315,7 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
|
|
|
313
315
|
}
|
|
314
316
|
|
|
315
317
|
private async requestChildDocument(frameId: Protocol.Page.FrameId, notInTarget: Target): Promise<DOMDocument|null> {
|
|
316
|
-
const frame = await
|
|
318
|
+
const frame = await this.#frameManager.getOrWaitForFrame(frameId, notInTarget);
|
|
317
319
|
const childModel = frame.resourceTreeModel()?.target().model(DOMModel);
|
|
318
320
|
return await (childModel?.requestDocument() || null);
|
|
319
321
|
}
|
|
@@ -341,7 +343,7 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
|
|
|
341
343
|
return undefined;
|
|
342
344
|
}
|
|
343
345
|
|
|
344
|
-
const frame =
|
|
346
|
+
const frame = this.#frameManager.getFrame(this.#frameOwnerFrameId);
|
|
345
347
|
if (frame && frame.adFrameType() !== Protocol.Page.AdFrameType.None) {
|
|
346
348
|
// The frame is ad-related, but provenance information is unavailable.
|
|
347
349
|
return {};
|
|
@@ -1478,7 +1480,7 @@ export class DOMModel extends SDKModel<EventTypes> {
|
|
|
1478
1480
|
return this.target().model(OverlayModel) as OverlayModel;
|
|
1479
1481
|
}
|
|
1480
1482
|
|
|
1481
|
-
static cancelSearch(targetManager: TargetManager
|
|
1483
|
+
static cancelSearch(targetManager: TargetManager): void {
|
|
1482
1484
|
for (const domModel of targetManager.models(DOMModel)) {
|
|
1483
1485
|
domModel.cancelSearch();
|
|
1484
1486
|
}
|
|
@@ -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 Root from '../../core/root/root.js';
|
|
5
6
|
import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
|
|
6
7
|
|
|
7
8
|
import {CategorizedBreakpoint, Category} from './CategorizedBreakpoint.js';
|
|
@@ -83,8 +84,6 @@ class EventListenerBreakpoint extends CategorizedBreakpoint {
|
|
|
83
84
|
static readonly instrumentationPrefix = 'instrumentation:';
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
let eventBreakpointManagerInstance: EventBreakpointsManager;
|
|
87
|
-
|
|
88
87
|
export class EventBreakpointsManager implements SDKModelObserver<EventBreakpointsModel> {
|
|
89
88
|
readonly #eventListenerBreakpoints: EventListenerBreakpoint[] = [];
|
|
90
89
|
readonly #targetManager: TargetManager;
|
|
@@ -151,11 +150,16 @@ export class EventBreakpointsManager implements SDKModelObserver<EventBreakpoint
|
|
|
151
150
|
targetManager?: TargetManager,
|
|
152
151
|
} = {forceNew: null}): EventBreakpointsManager {
|
|
153
152
|
const {forceNew, targetManager} = opts;
|
|
154
|
-
if (!
|
|
155
|
-
|
|
153
|
+
if (!Root.DevToolsContext.globalInstance().has(EventBreakpointsManager) || forceNew) {
|
|
154
|
+
Root.DevToolsContext.globalInstance().set(EventBreakpointsManager,
|
|
155
|
+
new EventBreakpointsManager(targetManager ?? TargetManager.instance()));
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
return
|
|
158
|
+
return Root.DevToolsContext.globalInstance().get(EventBreakpointsManager);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
static removeInstance(): void {
|
|
162
|
+
Root.DevToolsContext.globalInstance().delete(EventBreakpointsManager);
|
|
159
163
|
}
|
|
160
164
|
|
|
161
165
|
private createInstrumentationBreakpoints(category: Category, instrumentationNames: InstrumentationNames[]): void {
|
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as Common from '../common/common.js';
|
|
6
|
+
import * as Root from '../root/root.js';
|
|
6
7
|
|
|
7
8
|
import type {HeapProfilerModel} from './HeapProfilerModel.js';
|
|
8
9
|
import {RuntimeModel} from './RuntimeModel.js';
|
|
9
10
|
import {type SDKModelObserver, TargetManager} from './TargetManager.js';
|
|
10
11
|
|
|
11
|
-
let isolateManagerInstance: IsolateManager;
|
|
12
|
-
|
|
13
12
|
export class IsolateManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes> implements
|
|
14
13
|
SDKModelObserver<RuntimeModel> {
|
|
15
14
|
readonly #isolates = new Map<string, Isolate>();
|
|
@@ -28,15 +27,16 @@ export class IsolateManager extends Common.ObjectWrapper.ObjectWrapper<EventType
|
|
|
28
27
|
this.#targetManager.observeModels(RuntimeModel, this);
|
|
29
28
|
}
|
|
30
29
|
|
|
31
|
-
static instance(
|
|
30
|
+
static instance(opts: {
|
|
32
31
|
forceNew: boolean,
|
|
33
32
|
targetManager?: TargetManager,
|
|
34
33
|
} = {forceNew: false}): IsolateManager {
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
const {forceNew, targetManager} = opts;
|
|
35
|
+
if (!Root.DevToolsContext.globalInstance().has(IsolateManager) || forceNew) {
|
|
36
|
+
Root.DevToolsContext.globalInstance().set(IsolateManager, new IsolateManager(targetManager));
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
return
|
|
39
|
+
return Root.DevToolsContext.globalInstance().get(IsolateManager);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
observeIsolates(observer: Observer): void {
|
|
@@ -9,7 +9,7 @@ import * as i18n from '../i18n/i18n.js';
|
|
|
9
9
|
import * as Platform from '../platform/platform.js';
|
|
10
10
|
|
|
11
11
|
import {type DeferredDOMNode, DOMModel, type DOMNode} from './DOMModel.js';
|
|
12
|
-
import {FrameManager} from './FrameManager.js';
|
|
12
|
+
import type {FrameManager} from './FrameManager.js';
|
|
13
13
|
import {Events as NetworkManagerEvents, NetworkManager, type RequestUpdateDroppedEventData} from './NetworkManager.js';
|
|
14
14
|
import type {NetworkRequest} from './NetworkRequest.js';
|
|
15
15
|
import {Resource} from './Resource.js';
|
|
@@ -25,6 +25,7 @@ export class ResourceTreeModel extends SDKModel<EventTypes> {
|
|
|
25
25
|
readonly storageAgent: ProtocolProxyApi.StorageApi;
|
|
26
26
|
readonly #securityOriginManager: SecurityOriginManager;
|
|
27
27
|
readonly #storageKeyManager: StorageKeyManager;
|
|
28
|
+
readonly #frameManager: FrameManager;
|
|
28
29
|
readonly framesInternal = new Map<string, ResourceTreeFrame>();
|
|
29
30
|
#cachedResourcesProcessed = false;
|
|
30
31
|
#pendingReloadOptions: {
|
|
@@ -38,6 +39,7 @@ export class ResourceTreeModel extends SDKModel<EventTypes> {
|
|
|
38
39
|
|
|
39
40
|
constructor(target: Target) {
|
|
40
41
|
super(target);
|
|
42
|
+
this.#frameManager = target.targetManager().getFrameManager();
|
|
41
43
|
|
|
42
44
|
const networkManager = target.model(NetworkManager);
|
|
43
45
|
if (networkManager) {
|
|
@@ -216,8 +218,8 @@ export class ResourceTreeModel extends SDKModel<EventTypes> {
|
|
|
216
218
|
void this.updateStorageKeys();
|
|
217
219
|
|
|
218
220
|
if (frame.backForwardCacheDetails.restoredFromCache) {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
+
this.#frameManager.modelRemoved(this);
|
|
222
|
+
this.#frameManager.modelAdded(this);
|
|
221
223
|
void this.#buildResourceTree();
|
|
222
224
|
}
|
|
223
225
|
}
|