chrome-devtools-frontend 1.0.1556696 → 1.0.1558690
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/front_end/core/common/Object.ts +5 -1
- package/front_end/core/host/ResourceLoader.ts +1 -1
- package/front_end/core/host/UserMetrics.ts +3 -1
- package/front_end/core/sdk/DOMModel.ts +7 -0
- package/front_end/core/sdk/NetworkManager.ts +0 -7
- package/front_end/core/sdk/SourceMap.ts +16 -2
- package/front_end/core/sdk/SourceMapManager.ts +1 -1
- package/front_end/core/sdk/SourceMapScopesInfo.ts +11 -4
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +1 -0
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +51 -8
- package/front_end/entrypoints/main/GlobalAiButton.ts +5 -1
- package/front_end/generated/Deprecation.ts +0 -7
- package/front_end/generated/InspectorBackendCommands.ts +3 -3
- package/front_end/generated/protocol.ts +9 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +3 -3
- package/front_end/models/bindings/CompilerScriptMapping.ts +7 -6
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +4 -4
- package/front_end/models/javascript_metadata/NativeFunctions.js +2 -2
- package/front_end/models/stack_trace/StackTraceImpl.ts +5 -3
- package/front_end/models/stack_trace/StackTraceModel.ts +53 -40
- package/front_end/models/trace/EventsSerializer.ts +8 -2
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +2 -2
- package/front_end/panels/application/AppManifestView.ts +134 -223
- package/front_end/panels/application/CookieItemsView.ts +1 -0
- package/front_end/panels/application/SharedStorageTreeElement.ts +3 -0
- package/front_end/panels/application/appManifestView.css +1 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +4 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +30 -1
- package/front_end/panels/elements/ElementsTreeOutlineRenderer.ts +7 -1
- package/front_end/panels/elements/components/AdornerManager.ts +8 -0
- package/front_end/panels/emulation/DeviceModeToolbar.ts +3 -1
- package/front_end/panels/issues/AffectedResourcesView.ts +0 -1
- package/front_end/panels/lighthouse/LighthousePanel.ts +10 -0
- package/front_end/panels/lighthouse/lighthousePanel.css +46 -3
- package/front_end/panels/network/NetworkLogViewColumns.ts +9 -9
- package/front_end/panels/network/RequestCookiesView.ts +125 -141
- package/front_end/panels/network/components/RequestHeadersView.ts +2 -2
- package/front_end/panels/network/requestCookiesView.css +22 -20
- package/front_end/panels/recorder/components/RecordingView.ts +3 -3
- package/front_end/panels/recorder/components/StepView.ts +2 -1
- package/front_end/panels/settings/keybindsSettingsTab.css +4 -0
- package/front_end/panels/sources/CallStackSidebarPane.ts +7 -3
- package/front_end/panels/sources/DebuggerPausedMessage.ts +125 -90
- package/front_end/panels/sources/SourcesPanel.ts +10 -7
- package/front_end/panels/sources/debuggerPausedMessage.css +8 -0
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +2 -0
- package/front_end/third_party/acorn/estree-legacy.d.ts +2 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +12 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +14 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +6 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +0 -20
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +10 -14
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +14 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +12 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.js +22 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +9 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +26 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +72 -15
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +12 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +14 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +6 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +0 -20
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +11 -15
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +14 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +12 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.js +22 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +9 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +26 -0
- package/front_end/third_party/puppeteer/package/package.json +1 -1
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +18 -0
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +16 -2
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +13 -0
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +0 -33
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +14 -28
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +19 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +19 -0
- package/front_end/third_party/puppeteer/package/src/cdp/EmulationManager.ts +30 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +15 -6
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/icon_button/iconButton.css +3 -1
- package/front_end/ui/components/report_view/ReportView.ts +11 -2
- package/front_end/ui/components/report_view/report.css +16 -0
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +135 -7
- package/front_end/ui/components/text_editor/config.ts +6 -6
- package/front_end/ui/legacy/ContextMenu.ts +11 -2
- package/front_end/ui/legacy/TextPrompt.ts +1 -1
- package/front_end/ui/legacy/Toolbar.ts +4 -0
- package/front_end/ui/legacy/UIUtils.ts +0 -2
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +18 -3
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +3 -3
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +6 -0
- package/package.json +1 -1
|
@@ -105,7 +105,11 @@ export class ObjectWrapper<Events> implements EventTarget<Events> {
|
|
|
105
105
|
// new listeners.
|
|
106
106
|
for (const listener of [...listeners]) {
|
|
107
107
|
if (!listener.disposed) {
|
|
108
|
-
|
|
108
|
+
try {
|
|
109
|
+
listener.listener.call(listener.thisObject, event);
|
|
110
|
+
} catch (err) {
|
|
111
|
+
console.error(`Event listener for ${String(eventType)} throw an error:`, err);
|
|
112
|
+
}
|
|
109
113
|
}
|
|
110
114
|
}
|
|
111
115
|
}
|
|
@@ -206,7 +206,7 @@ async function fetchToString(url: string): Promise<string> {
|
|
|
206
206
|
|
|
207
207
|
function canBeRemoteFilePath(url: string): boolean {
|
|
208
208
|
try {
|
|
209
|
-
const urlObject = new URL(url);
|
|
209
|
+
const urlObject = new URL(new URL(url).toString()); // Normalize first.
|
|
210
210
|
return urlObject.protocol === 'file:' && urlObject.host !== '';
|
|
211
211
|
} catch {
|
|
212
212
|
return false;
|
|
@@ -531,7 +531,9 @@ export enum Action {
|
|
|
531
531
|
AiCodeGenerationSuggestionAccepted = 196,
|
|
532
532
|
InsightTeaserModelDownloadStarted = 197,
|
|
533
533
|
InsightTeaserModelDownloadCompleted = 198,
|
|
534
|
-
|
|
534
|
+
AiCodeGenerationError = 199,
|
|
535
|
+
AiCodeGenerationRequestTriggered = 200,
|
|
536
|
+
MAX_VALUE = 201,
|
|
535
537
|
/* eslint-enable @typescript-eslint/naming-convention */
|
|
536
538
|
}
|
|
537
539
|
|
|
@@ -322,6 +322,13 @@ export class DOMNode extends Common.ObjectWrapper.ObjectWrapper<DOMNodeEventType
|
|
|
322
322
|
return false;
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
+
isRootNode(): boolean {
|
|
326
|
+
if (this.nodeType() === Node.ELEMENT_NODE && this.nodeName() === 'HTML') {
|
|
327
|
+
return true;
|
|
328
|
+
}
|
|
329
|
+
return false;
|
|
330
|
+
}
|
|
331
|
+
|
|
325
332
|
isSVGNode(): boolean {
|
|
326
333
|
return this.#isSVGNode;
|
|
327
334
|
}
|
|
@@ -2716,13 +2716,6 @@ export interface Conditions {
|
|
|
2716
2716
|
packetLoss?: number;
|
|
2717
2717
|
packetQueueLength?: number;
|
|
2718
2718
|
packetReordering?: boolean;
|
|
2719
|
-
// TODO(crbug.com/1219425): In the future, it might be worthwhile to
|
|
2720
|
-
// consider avoiding mixing up presentation state (e.g.: displayed
|
|
2721
|
-
// titles) with behavioral state (e.g.: the throttling amounts). In
|
|
2722
|
-
// this particular case, the title (along with other properties)
|
|
2723
|
-
// doubles as both part of group of fields which (loosely) uniquely
|
|
2724
|
-
// identify instances, as well as the literal string displayed in the
|
|
2725
|
-
// UI, which leads to complications around persistance.
|
|
2726
2719
|
// TODO(crbug.com/422682525): make this just a function because we use lazy string everywhere.
|
|
2727
2720
|
title: string|(() => string);
|
|
2728
2721
|
// Instances may be serialized to local storage, so localized titles
|
|
@@ -138,7 +138,7 @@ export class SourceMap {
|
|
|
138
138
|
|
|
139
139
|
readonly #debugId?: DebugId;
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
#scopesFallbackPromise?: Promise<void>;
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
144
|
* Implements Source Map V3 model. See https://github.com/google/closure-compiler/wiki/Source-Maps
|
|
@@ -225,6 +225,11 @@ export class SourceMap {
|
|
|
225
225
|
return this.#scopesInfo !== null && !this.#scopesInfo.isEmpty();
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
+
waitForScopeInfo(): Promise<void> {
|
|
229
|
+
this.#ensureSourceMapProcessed();
|
|
230
|
+
return this.#scopesFallbackPromise ?? Promise.resolve();
|
|
231
|
+
}
|
|
232
|
+
|
|
228
233
|
findEntry(lineNumber: number, columnNumber: number, inlineFrameIndex?: number): SourceMapEntry|null {
|
|
229
234
|
this.#ensureSourceMapProcessed();
|
|
230
235
|
if (inlineFrameIndex && this.#scopesInfo !== null) {
|
|
@@ -252,6 +257,15 @@ export class SourceMap {
|
|
|
252
257
|
return index ? mappings[index - 1] : null;
|
|
253
258
|
}
|
|
254
259
|
|
|
260
|
+
/** Returns the entry at the given position but only if an entry exists for that exact position */
|
|
261
|
+
findEntryExact(lineNumber: number, columnNumber: number): SourceMapEntry|null {
|
|
262
|
+
const entry = this.findEntry(lineNumber, columnNumber);
|
|
263
|
+
if (entry?.lineNumber === lineNumber && entry.columnNumber === columnNumber) {
|
|
264
|
+
return entry;
|
|
265
|
+
}
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
268
|
+
|
|
255
269
|
findEntryRanges(lineNumber: number, columnNumber: number): {
|
|
256
270
|
range: TextUtils.TextRange.TextRange,
|
|
257
271
|
sourceRange: TextUtils.TextRange.TextRange,
|
|
@@ -411,7 +425,7 @@ export class SourceMap {
|
|
|
411
425
|
try {
|
|
412
426
|
this.eachSection(this.parseMap.bind(this));
|
|
413
427
|
if (!this.hasScopeInfo()) {
|
|
414
|
-
this
|
|
428
|
+
this.#scopesFallbackPromise = this.#buildScopesFallback().then(info => {
|
|
415
429
|
this.#scopesInfo = info;
|
|
416
430
|
});
|
|
417
431
|
}
|
|
@@ -182,7 +182,7 @@ export class SourceMapManager<T extends FrameAssociated> extends Common.ObjectWr
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
waitForSourceMapsProcessedForTest(): Promise<unknown> {
|
|
185
|
-
return Promise.all(this.#sourceMaps.keys().map(sourceMap => sourceMap.
|
|
185
|
+
return Promise.all(this.#sourceMaps.keys().map(sourceMap => sourceMap.waitForScopeInfo()));
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
|
|
@@ -123,16 +123,23 @@ export class SourceMapScopesInfo {
|
|
|
123
123
|
sourceIndex < numSourceUrls;
|
|
124
124
|
const isStackFrame = node.kind === Formatter.FormatterWorkerPool.ScopeKind.FUNCTION ||
|
|
125
125
|
node.kind === Formatter.FormatterWorkerPool.ScopeKind.ARROW_FUNCTION;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
let name: string|undefined = undefined;
|
|
127
|
+
for (const offset of node.nameMappingLocations ?? []) {
|
|
128
|
+
const position = positionFromOffset(offset);
|
|
129
|
+
const entry = sourceMap.findEntryExact(position.line, position.column);
|
|
130
|
+
if (entry?.name !== undefined) {
|
|
131
|
+
// Only consider named mappings.
|
|
132
|
+
name = entry.name;
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
129
136
|
|
|
130
137
|
let scope: ScopesCodec.OriginalScope|undefined;
|
|
131
138
|
if (canMapOriginalPosition) {
|
|
132
139
|
scope = {
|
|
133
140
|
start: {line: startEntry.sourceLineNumber, column: startEntry.sourceColumnNumber},
|
|
134
141
|
end: {line: endEntry.sourceLineNumber, column: endEntry.sourceColumnNumber},
|
|
135
|
-
name,
|
|
142
|
+
name: name ?? node.name,
|
|
136
143
|
isStackFrame,
|
|
137
144
|
variables: [],
|
|
138
145
|
children: [],
|
|
@@ -57,6 +57,7 @@ export interface ScopeTreeNode {
|
|
|
57
57
|
end: number;
|
|
58
58
|
// If present, apply source map mappings to these locations to figure out the original function name.
|
|
59
59
|
nameMappingLocations?: number[];
|
|
60
|
+
name?: string;
|
|
60
61
|
kind: ScopeKind;
|
|
61
62
|
children: ScopeTreeNode[];
|
|
62
63
|
}
|
|
@@ -37,14 +37,17 @@ export class Scope {
|
|
|
37
37
|
readonly start: number;
|
|
38
38
|
readonly end: number;
|
|
39
39
|
readonly kind: ScopeKind;
|
|
40
|
+
readonly name?: string;
|
|
40
41
|
readonly nameMappingLocations?: number[];
|
|
41
42
|
readonly children: Scope[] = [];
|
|
42
43
|
|
|
43
|
-
constructor(
|
|
44
|
+
constructor(
|
|
45
|
+
start: number, end: number, parent: Scope|null, kind: ScopeKind, name?: string, nameMappingLocations?: number[]) {
|
|
44
46
|
this.start = start;
|
|
45
47
|
this.end = end;
|
|
46
48
|
this.parent = parent;
|
|
47
49
|
this.kind = kind;
|
|
50
|
+
this.name = name;
|
|
48
51
|
this.nameMappingLocations = nameMappingLocations;
|
|
49
52
|
if (parent) {
|
|
50
53
|
parent.children.push(this);
|
|
@@ -66,6 +69,7 @@ export class Scope {
|
|
|
66
69
|
end: this.end,
|
|
67
70
|
variables,
|
|
68
71
|
kind: this.kind,
|
|
72
|
+
name: this.name,
|
|
69
73
|
nameMappingLocations: this.nameMappingLocations,
|
|
70
74
|
children,
|
|
71
75
|
};
|
|
@@ -141,6 +145,7 @@ export class ScopeVariableAnalysis {
|
|
|
141
145
|
#currentScope: Scope;
|
|
142
146
|
readonly #rootNode: Acorn.ESTree.Node;
|
|
143
147
|
readonly #sourceText: string;
|
|
148
|
+
#methodName: string|undefined;
|
|
144
149
|
#additionalMappingLocations: number[] = [];
|
|
145
150
|
|
|
146
151
|
constructor(node: Acorn.ESTree.Node, sourceText: string) {
|
|
@@ -178,7 +183,9 @@ export class ScopeVariableAnalysis {
|
|
|
178
183
|
node.elements.forEach(item => this.#processNode(item));
|
|
179
184
|
break;
|
|
180
185
|
case 'ArrowFunctionExpression': {
|
|
181
|
-
this.#pushScope(
|
|
186
|
+
this.#pushScope(
|
|
187
|
+
node.start, node.end, ScopeKind.ARROW_FUNCTION, undefined,
|
|
188
|
+
mappingLocationsForArrowFunctions(node, this.#sourceText));
|
|
182
189
|
node.params.forEach(this.#processNodeAsDefinition.bind(this, DefinitionKind.VAR, false));
|
|
183
190
|
if (node.body.type === 'BlockStatement') {
|
|
184
191
|
// Include the body of the arrow function in the same scope as the arguments.
|
|
@@ -260,7 +267,7 @@ export class ScopeVariableAnalysis {
|
|
|
260
267
|
case 'FunctionDeclaration':
|
|
261
268
|
this.#processNodeAsDefinition(DefinitionKind.VAR, false, node.id);
|
|
262
269
|
this.#pushScope(
|
|
263
|
-
node.id?.end ?? node.start, node.end, ScopeKind.FUNCTION,
|
|
270
|
+
node.id?.end ?? node.start, node.end, ScopeKind.FUNCTION, node.id.name,
|
|
264
271
|
mappingLocationsForFunctionDeclaration(node, this.#sourceText));
|
|
265
272
|
this.#addVariable('this', node.start, DefinitionKind.FIXED);
|
|
266
273
|
this.#addVariable('arguments', node.start, DefinitionKind.FIXED);
|
|
@@ -271,8 +278,10 @@ export class ScopeVariableAnalysis {
|
|
|
271
278
|
break;
|
|
272
279
|
case 'FunctionExpression':
|
|
273
280
|
this.#pushScope(
|
|
274
|
-
node.id?.end ?? node.start, node.end, ScopeKind.FUNCTION,
|
|
281
|
+
node.id?.end ?? node.start, node.end, ScopeKind.FUNCTION, this.#methodName ?? node.id?.name,
|
|
275
282
|
[...this.#additionalMappingLocations, ...mappingLocationsForFunctionExpression(node, this.#sourceText)]);
|
|
283
|
+
this.#additionalMappingLocations = [];
|
|
284
|
+
this.#methodName = undefined;
|
|
276
285
|
this.#addVariable('this', node.start, DefinitionKind.FIXED);
|
|
277
286
|
this.#addVariable('arguments', node.start, DefinitionKind.FIXED);
|
|
278
287
|
node.params.forEach(this.#processNodeAsDefinition.bind(this, DefinitionKind.LET, false));
|
|
@@ -298,9 +307,9 @@ export class ScopeVariableAnalysis {
|
|
|
298
307
|
this.#processNode(node.key);
|
|
299
308
|
} else {
|
|
300
309
|
this.#additionalMappingLocations = mappingLocationsForMethodDefinition(node);
|
|
310
|
+
this.#methodName = nameForMethodDefinition(node);
|
|
301
311
|
}
|
|
302
312
|
this.#processNode(node.value);
|
|
303
|
-
this.#additionalMappingLocations = [];
|
|
304
313
|
break;
|
|
305
314
|
case 'NewExpression':
|
|
306
315
|
this.#processNode(node.callee);
|
|
@@ -335,6 +344,9 @@ export class ScopeVariableAnalysis {
|
|
|
335
344
|
} else {
|
|
336
345
|
if (node.computed) {
|
|
337
346
|
this.#processNode(node.key);
|
|
347
|
+
} else if (node.value.type === 'FunctionExpression') {
|
|
348
|
+
this.#additionalMappingLocations = mappingLocationsForMethodDefinition(node);
|
|
349
|
+
this.#methodName = nameForMethodDefinition(node);
|
|
338
350
|
}
|
|
339
351
|
this.#processNode(node.value);
|
|
340
352
|
}
|
|
@@ -437,8 +449,8 @@ export class ScopeVariableAnalysis {
|
|
|
437
449
|
return this.#allNames;
|
|
438
450
|
}
|
|
439
451
|
|
|
440
|
-
#pushScope(start: number, end: number, kind: ScopeKind, nameMappingLocations?: number[]): void {
|
|
441
|
-
this.#currentScope = new Scope(start, end, this.#currentScope, kind, nameMappingLocations);
|
|
452
|
+
#pushScope(start: number, end: number, kind: ScopeKind, name?: string, nameMappingLocations?: number[]): void {
|
|
453
|
+
this.#currentScope = new Scope(start, end, this.#currentScope, kind, name, nameMappingLocations);
|
|
442
454
|
}
|
|
443
455
|
|
|
444
456
|
#popScope(isFunctionContext: boolean): void {
|
|
@@ -537,7 +549,7 @@ function mappingLocationsForFunctionExpression(node: Acorn.ESTree.FunctionExpres
|
|
|
537
549
|
return result;
|
|
538
550
|
}
|
|
539
551
|
|
|
540
|
-
function mappingLocationsForMethodDefinition(node: Acorn.ESTree.MethodDefinition): number[] {
|
|
552
|
+
function mappingLocationsForMethodDefinition(node: Acorn.ESTree.MethodDefinition|Acorn.ESTree.Property): number[] {
|
|
541
553
|
// Method definitions use a FunctionExpression as their "value" child. So we only
|
|
542
554
|
// record the start of the "key" here and let 'mappingLocationsForFunctionExpression' handle
|
|
543
555
|
// the parenthesis.
|
|
@@ -548,6 +560,37 @@ function mappingLocationsForMethodDefinition(node: Acorn.ESTree.MethodDefinition
|
|
|
548
560
|
return [];
|
|
549
561
|
}
|
|
550
562
|
|
|
563
|
+
function nameForMethodDefinition(node: Acorn.ESTree.MethodDefinition|Acorn.ESTree.Property): string|undefined {
|
|
564
|
+
if (node.key.type === 'Identifier') {
|
|
565
|
+
return node.key.name;
|
|
566
|
+
}
|
|
567
|
+
if (node.key.type === 'PrivateIdentifier') {
|
|
568
|
+
return '#' + node.key.name;
|
|
569
|
+
}
|
|
570
|
+
return undefined;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
function mappingLocationsForArrowFunctions(node: Acorn.ESTree.ArrowFunctionExpression, sourceText: string): number[] {
|
|
574
|
+
// For arrow functions we use the `(' parenthesis if present, and the `=>` arrow as per spec.
|
|
575
|
+
// Both are not 100% accurate as acorn doesn't tell us their location so we have to search, which is brittle.
|
|
576
|
+
const result = [];
|
|
577
|
+
|
|
578
|
+
const searchParenStartPos = node.async ? node.start + 5 : node.start;
|
|
579
|
+
const searchParenEndPos = node.params.length ? node.params[0].start : node.body.start;
|
|
580
|
+
const parenPos = indexOfCharInBounds(sourceText, '(', searchParenStartPos, searchParenEndPos);
|
|
581
|
+
if (parenPos >= 0) {
|
|
582
|
+
result.push(parenPos);
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
const searchArrowStartPos = node.params.length ? node.params[node.params.length - 1].end : node.start;
|
|
586
|
+
const arrowPos = indexOfCharInBounds(sourceText, '=', searchArrowStartPos, node.body.start);
|
|
587
|
+
if (arrowPos >= 0 && sourceText[arrowPos + 1] === '>') {
|
|
588
|
+
result.push(arrowPos);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
return result;
|
|
592
|
+
}
|
|
593
|
+
|
|
551
594
|
function indexOfCharInBounds(str: string, needle: string, start: number, end: number): number {
|
|
552
595
|
for (let i = start; i < end; ++i) {
|
|
553
596
|
if (str[i] === needle) {
|
|
@@ -18,6 +18,10 @@ const UIStrings = {
|
|
|
18
18
|
* @description Button's string in promotion state.
|
|
19
19
|
*/
|
|
20
20
|
aiAssistance: 'AI assistance',
|
|
21
|
+
/**
|
|
22
|
+
* @description Button's tooltip text.
|
|
23
|
+
*/
|
|
24
|
+
openAiAssistance: 'Open AI assistance panel',
|
|
21
25
|
} as const;
|
|
22
26
|
const str_ = i18n.i18n.registerUIStrings('entrypoints/main/GlobalAiButton.ts', UIStrings);
|
|
23
27
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -55,7 +59,7 @@ export const DEFAULT_VIEW = (input: ViewInput, output: undefined, target: HTMLEl
|
|
|
55
59
|
render(html`
|
|
56
60
|
<style>${globalAiButtonStyles}</style>
|
|
57
61
|
<div class="global-ai-button-container">
|
|
58
|
-
<button class=${classes} @click=${input.onClick} jslog=${VisualLogging.action().track({click: true}).context('global-ai-button')}>
|
|
62
|
+
<button class=${classes} @click=${input.onClick} title=${i18nString(UIStrings.openAiAssistance)} jslog=${VisualLogging.action().track({click: true}).context('global-ai-button')}>
|
|
59
63
|
<devtools-icon name="smart-assistant"></devtools-icon>
|
|
60
64
|
<span class="button-text">${` ${i18nString(UIStrings.aiAssistance)}`}</span>
|
|
61
65
|
</button>
|
|
@@ -30,10 +30,6 @@ export const UIStrings = {
|
|
|
30
30
|
* @description This warning occurs when the website attempts to invoke the deprecated `chrome.loadTimes().wasAlternateProtocolAvailable` API.
|
|
31
31
|
*/
|
|
32
32
|
ChromeLoadTimesWasAlternateProtocolAvailable: "`chrome.loadTimes()` is deprecated, instead use standardized API: `nextHopProtocol` in Navigation Timing 2.",
|
|
33
|
-
/**
|
|
34
|
-
* @description This warning occurs when the browser attempts to store a cookie containing a banned character. Rather than the cookie string being truncated at the banned character, the entire cookie will be rejected now.
|
|
35
|
-
*/
|
|
36
|
-
CookieWithTruncatingChar: "Cookies containing a `\\(0|r|n)` character will be rejected instead of truncated.",
|
|
37
33
|
/**
|
|
38
34
|
* @description This warning occurs when a frame accesses another frame's data after having set `document.domain` without having set the `Origin-Agent-Cluster` http header. This is a companion warning to `documentDomainSettingWithoutOriginAgentClusterHeader`, where that warning occurs when `document.domain` is set, and this warning occurs when an access has been made, based on that previous `document.domain` setting.
|
|
39
35
|
*/
|
|
@@ -286,9 +282,6 @@ export const DEPRECATIONS_METADATA: Partial<Record<string, DeprecationDescriptor
|
|
|
286
282
|
"ChromeLoadTimesWasAlternateProtocolAvailable": {
|
|
287
283
|
"chromeStatusFeature": 5637885046816768
|
|
288
284
|
},
|
|
289
|
-
"CookieWithTruncatingChar": {
|
|
290
|
-
"milestone": 103
|
|
291
|
-
},
|
|
292
285
|
"CrossOriginAccessBasedOnDocumentDomain": {
|
|
293
286
|
"milestone": 115
|
|
294
287
|
},
|
|
@@ -81,7 +81,7 @@ inspectorBackend.registerEnum("Audits.AttributionReportingIssueType", {Permissio
|
|
|
81
81
|
inspectorBackend.registerEnum("Audits.SharedDictionaryError", {UseErrorCrossOriginNoCorsRequest: "UseErrorCrossOriginNoCorsRequest", UseErrorDictionaryLoadFailure: "UseErrorDictionaryLoadFailure", UseErrorMatchingDictionaryNotUsed: "UseErrorMatchingDictionaryNotUsed", UseErrorUnexpectedContentDictionaryHeader: "UseErrorUnexpectedContentDictionaryHeader", WriteErrorCossOriginNoCorsRequest: "WriteErrorCossOriginNoCorsRequest", WriteErrorDisallowedBySettings: "WriteErrorDisallowedBySettings", WriteErrorExpiredResponse: "WriteErrorExpiredResponse", WriteErrorFeatureDisabled: "WriteErrorFeatureDisabled", WriteErrorInsufficientResources: "WriteErrorInsufficientResources", WriteErrorInvalidMatchField: "WriteErrorInvalidMatchField", WriteErrorInvalidStructuredHeader: "WriteErrorInvalidStructuredHeader", WriteErrorInvalidTTLField: "WriteErrorInvalidTTLField", WriteErrorNavigationRequest: "WriteErrorNavigationRequest", WriteErrorNoMatchField: "WriteErrorNoMatchField", WriteErrorNonIntegerTTLField: "WriteErrorNonIntegerTTLField", WriteErrorNonListMatchDestField: "WriteErrorNonListMatchDestField", WriteErrorNonSecureContext: "WriteErrorNonSecureContext", WriteErrorNonStringIdField: "WriteErrorNonStringIdField", WriteErrorNonStringInMatchDestList: "WriteErrorNonStringInMatchDestList", WriteErrorNonStringMatchField: "WriteErrorNonStringMatchField", WriteErrorNonTokenTypeField: "WriteErrorNonTokenTypeField", WriteErrorRequestAborted: "WriteErrorRequestAborted", WriteErrorShuttingDown: "WriteErrorShuttingDown", WriteErrorTooLongIdField: "WriteErrorTooLongIdField", WriteErrorUnsupportedType: "WriteErrorUnsupportedType"});
|
|
82
82
|
inspectorBackend.registerEnum("Audits.SRIMessageSignatureError", {MissingSignatureHeader: "MissingSignatureHeader", MissingSignatureInputHeader: "MissingSignatureInputHeader", InvalidSignatureHeader: "InvalidSignatureHeader", InvalidSignatureInputHeader: "InvalidSignatureInputHeader", SignatureHeaderValueIsNotByteSequence: "SignatureHeaderValueIsNotByteSequence", SignatureHeaderValueIsParameterized: "SignatureHeaderValueIsParameterized", SignatureHeaderValueIsIncorrectLength: "SignatureHeaderValueIsIncorrectLength", SignatureInputHeaderMissingLabel: "SignatureInputHeaderMissingLabel", SignatureInputHeaderValueNotInnerList: "SignatureInputHeaderValueNotInnerList", SignatureInputHeaderValueMissingComponents: "SignatureInputHeaderValueMissingComponents", SignatureInputHeaderInvalidComponentType: "SignatureInputHeaderInvalidComponentType", SignatureInputHeaderInvalidComponentName: "SignatureInputHeaderInvalidComponentName", SignatureInputHeaderInvalidHeaderComponentParameter: "SignatureInputHeaderInvalidHeaderComponentParameter", SignatureInputHeaderInvalidDerivedComponentParameter: "SignatureInputHeaderInvalidDerivedComponentParameter", SignatureInputHeaderKeyIdLength: "SignatureInputHeaderKeyIdLength", SignatureInputHeaderInvalidParameter: "SignatureInputHeaderInvalidParameter", SignatureInputHeaderMissingRequiredParameters: "SignatureInputHeaderMissingRequiredParameters", ValidationFailedSignatureExpired: "ValidationFailedSignatureExpired", ValidationFailedInvalidLength: "ValidationFailedInvalidLength", ValidationFailedSignatureMismatch: "ValidationFailedSignatureMismatch", ValidationFailedIntegrityMismatch: "ValidationFailedIntegrityMismatch"});
|
|
83
83
|
inspectorBackend.registerEnum("Audits.UnencodedDigestError", {MalformedDictionary: "MalformedDictionary", UnknownAlgorithm: "UnknownAlgorithm", IncorrectDigestType: "IncorrectDigestType", IncorrectDigestLength: "IncorrectDigestLength"});
|
|
84
|
-
inspectorBackend.registerEnum("Audits.GenericIssueErrorType", {FormLabelForNameError: "FormLabelForNameError", FormDuplicateIdForInputError: "FormDuplicateIdForInputError", FormInputWithNoLabelError: "FormInputWithNoLabelError", FormAutocompleteAttributeEmptyError: "FormAutocompleteAttributeEmptyError", FormEmptyIdAndNameAttributesForInputError: "FormEmptyIdAndNameAttributesForInputError", FormAriaLabelledByToNonExistingIdError: "FormAriaLabelledByToNonExistingIdError", FormInputAssignedAutocompleteValueToIdOrNameAttributeError: "FormInputAssignedAutocompleteValueToIdOrNameAttributeError", FormLabelHasNeitherForNorNestedInputError: "FormLabelHasNeitherForNorNestedInputError", FormLabelForMatchesNonExistingIdError: "FormLabelForMatchesNonExistingIdError", FormInputHasWrongButWellIntendedAutocompleteValueError: "FormInputHasWrongButWellIntendedAutocompleteValueError", ResponseWasBlockedByORB: "ResponseWasBlockedByORB", NavigationEntryMarkedSkippable: "NavigationEntryMarkedSkippable"});
|
|
84
|
+
inspectorBackend.registerEnum("Audits.GenericIssueErrorType", {FormLabelForNameError: "FormLabelForNameError", FormDuplicateIdForInputError: "FormDuplicateIdForInputError", FormInputWithNoLabelError: "FormInputWithNoLabelError", FormAutocompleteAttributeEmptyError: "FormAutocompleteAttributeEmptyError", FormEmptyIdAndNameAttributesForInputError: "FormEmptyIdAndNameAttributesForInputError", FormAriaLabelledByToNonExistingIdError: "FormAriaLabelledByToNonExistingIdError", FormInputAssignedAutocompleteValueToIdOrNameAttributeError: "FormInputAssignedAutocompleteValueToIdOrNameAttributeError", FormLabelHasNeitherForNorNestedInputError: "FormLabelHasNeitherForNorNestedInputError", FormLabelForMatchesNonExistingIdError: "FormLabelForMatchesNonExistingIdError", FormInputHasWrongButWellIntendedAutocompleteValueError: "FormInputHasWrongButWellIntendedAutocompleteValueError", ResponseWasBlockedByORB: "ResponseWasBlockedByORB", NavigationEntryMarkedSkippable: "NavigationEntryMarkedSkippable", AutofillAndManualTextPolicyControlledFeaturesInfo: "AutofillAndManualTextPolicyControlledFeaturesInfo", AutofillPolicyControlledFeatureInfo: "AutofillPolicyControlledFeatureInfo", ManualTextPolicyControlledFeatureInfo: "ManualTextPolicyControlledFeatureInfo"});
|
|
85
85
|
inspectorBackend.registerEnum("Audits.ClientHintIssueReason", {MetaTagAllowListInvalidOrigin: "MetaTagAllowListInvalidOrigin", MetaTagModifiedHTML: "MetaTagModifiedHTML"});
|
|
86
86
|
inspectorBackend.registerEnum("Audits.FederatedAuthRequestIssueReason", {ShouldEmbargo: "ShouldEmbargo", TooManyRequests: "TooManyRequests", WellKnownHttpNotFound: "WellKnownHttpNotFound", WellKnownNoResponse: "WellKnownNoResponse", WellKnownInvalidResponse: "WellKnownInvalidResponse", WellKnownListEmpty: "WellKnownListEmpty", WellKnownInvalidContentType: "WellKnownInvalidContentType", ConfigNotInWellKnown: "ConfigNotInWellKnown", WellKnownTooBig: "WellKnownTooBig", ConfigHttpNotFound: "ConfigHttpNotFound", ConfigNoResponse: "ConfigNoResponse", ConfigInvalidResponse: "ConfigInvalidResponse", ConfigInvalidContentType: "ConfigInvalidContentType", ClientMetadataHttpNotFound: "ClientMetadataHttpNotFound", ClientMetadataNoResponse: "ClientMetadataNoResponse", ClientMetadataInvalidResponse: "ClientMetadataInvalidResponse", ClientMetadataInvalidContentType: "ClientMetadataInvalidContentType", IdpNotPotentiallyTrustworthy: "IdpNotPotentiallyTrustworthy", DisabledInSettings: "DisabledInSettings", DisabledInFlags: "DisabledInFlags", ErrorFetchingSignin: "ErrorFetchingSignin", InvalidSigninResponse: "InvalidSigninResponse", AccountsHttpNotFound: "AccountsHttpNotFound", AccountsNoResponse: "AccountsNoResponse", AccountsInvalidResponse: "AccountsInvalidResponse", AccountsListEmpty: "AccountsListEmpty", AccountsInvalidContentType: "AccountsInvalidContentType", IdTokenHttpNotFound: "IdTokenHttpNotFound", IdTokenNoResponse: "IdTokenNoResponse", IdTokenInvalidResponse: "IdTokenInvalidResponse", IdTokenIdpErrorResponse: "IdTokenIdpErrorResponse", IdTokenCrossSiteIdpErrorResponse: "IdTokenCrossSiteIdpErrorResponse", IdTokenInvalidRequest: "IdTokenInvalidRequest", IdTokenInvalidContentType: "IdTokenInvalidContentType", ErrorIdToken: "ErrorIdToken", Canceled: "Canceled", RpPageNotVisible: "RpPageNotVisible", SilentMediationFailure: "SilentMediationFailure", ThirdPartyCookiesBlocked: "ThirdPartyCookiesBlocked", NotSignedInWithIdp: "NotSignedInWithIdp", MissingTransientUserActivation: "MissingTransientUserActivation", ReplacedByActiveMode: "ReplacedByActiveMode", InvalidFieldsSpecified: "InvalidFieldsSpecified", RelyingPartyOriginIsOpaque: "RelyingPartyOriginIsOpaque", TypeNotMatching: "TypeNotMatching", UiDismissedNoEmbargo: "UiDismissedNoEmbargo", CorsError: "CorsError", SuppressedBySegmentationPlatform: "SuppressedBySegmentationPlatform"});
|
|
87
87
|
inspectorBackend.registerEnum("Audits.FederatedAuthUserInfoRequestIssueReason", {NotSameOrigin: "NotSameOrigin", NotIframe: "NotIframe", NotPotentiallyTrustworthy: "NotPotentiallyTrustworthy", NoAPIPermission: "NoApiPermission", NotSignedInWithIdp: "NotSignedInWithIdp", NoAccountSharingPermission: "NoAccountSharingPermission", InvalidConfigOrWellKnown: "InvalidConfigOrWellKnown", InvalidAccountsResponse: "InvalidAccountsResponse", NoReturningUserFromFetchedAccounts: "NoReturningUserFromFetchedAccounts"});
|
|
@@ -191,7 +191,7 @@ inspectorBackend.registerType("BluetoothEmulation.CharacteristicProperties", [{"
|
|
|
191
191
|
|
|
192
192
|
// Browser.
|
|
193
193
|
inspectorBackend.registerEnum("Browser.WindowState", {Normal: "normal", Minimized: "minimized", Maximized: "maximized", Fullscreen: "fullscreen"});
|
|
194
|
-
inspectorBackend.registerEnum("Browser.PermissionType", {Ar: "ar", AudioCapture: "audioCapture", AutomaticFullscreen: "automaticFullscreen", BackgroundFetch: "backgroundFetch", BackgroundSync: "backgroundSync", CameraPanTiltZoom: "cameraPanTiltZoom", CapturedSurfaceControl: "capturedSurfaceControl", ClipboardReadWrite: "clipboardReadWrite", ClipboardSanitizedWrite: "clipboardSanitizedWrite", DisplayCapture: "displayCapture", DurableStorage: "durableStorage", Geolocation: "geolocation", HandTracking: "handTracking", IdleDetection: "idleDetection", KeyboardLock: "keyboardLock", LocalFonts: "localFonts", LocalNetworkAccess: "localNetworkAccess", Midi: "midi", MidiSysex: "midiSysex", Nfc: "nfc", Notifications: "notifications", PaymentHandler: "paymentHandler", PeriodicBackgroundSync: "periodicBackgroundSync", PointerLock: "pointerLock", ProtectedMediaIdentifier: "protectedMediaIdentifier", Sensors: "sensors", SmartCard: "smartCard", SpeakerSelection: "speakerSelection", StorageAccess: "storageAccess", TopLevelStorageAccess: "topLevelStorageAccess", VideoCapture: "videoCapture", Vr: "vr", WakeLockScreen: "wakeLockScreen", WakeLockSystem: "wakeLockSystem", WebAppInstallation: "webAppInstallation", WebPrinting: "webPrinting", WindowManagement: "windowManagement"});
|
|
194
|
+
inspectorBackend.registerEnum("Browser.PermissionType", {Ar: "ar", AudioCapture: "audioCapture", AutomaticFullscreen: "automaticFullscreen", BackgroundFetch: "backgroundFetch", BackgroundSync: "backgroundSync", CameraPanTiltZoom: "cameraPanTiltZoom", CapturedSurfaceControl: "capturedSurfaceControl", ClipboardReadWrite: "clipboardReadWrite", ClipboardSanitizedWrite: "clipboardSanitizedWrite", DisplayCapture: "displayCapture", DurableStorage: "durableStorage", Geolocation: "geolocation", HandTracking: "handTracking", IdleDetection: "idleDetection", KeyboardLock: "keyboardLock", LocalFonts: "localFonts", LocalNetwork: "localNetwork", LocalNetworkAccess: "localNetworkAccess", LoopbackNetwork: "loopbackNetwork", Midi: "midi", MidiSysex: "midiSysex", Nfc: "nfc", Notifications: "notifications", PaymentHandler: "paymentHandler", PeriodicBackgroundSync: "periodicBackgroundSync", PointerLock: "pointerLock", ProtectedMediaIdentifier: "protectedMediaIdentifier", Sensors: "sensors", SmartCard: "smartCard", SpeakerSelection: "speakerSelection", StorageAccess: "storageAccess", TopLevelStorageAccess: "topLevelStorageAccess", VideoCapture: "videoCapture", Vr: "vr", WakeLockScreen: "wakeLockScreen", WakeLockSystem: "wakeLockSystem", WebAppInstallation: "webAppInstallation", WebPrinting: "webPrinting", WindowManagement: "windowManagement"});
|
|
195
195
|
inspectorBackend.registerEnum("Browser.PermissionSetting", {Granted: "granted", Denied: "denied", Prompt: "prompt"});
|
|
196
196
|
inspectorBackend.registerEnum("Browser.BrowserCommandId", {OpenTabSearch: "openTabSearch", CloseTabSearch: "closeTabSearch", OpenGlic: "openGlic"});
|
|
197
197
|
inspectorBackend.registerEnum("Browser.PrivacySandboxAPI", {BiddingAndAuctionServices: "BiddingAndAuctionServices", TrustedKeyValue: "TrustedKeyValue"});
|
|
@@ -1345,7 +1345,7 @@ inspectorBackend.registerCommand("Target.attachToBrowserTarget", [], ["sessionId
|
|
|
1345
1345
|
inspectorBackend.registerCommand("Target.closeTarget", [{"name": "targetId", "type": "string", "optional": false, "description": "", "typeRef": "Target.TargetID"}], ["success"], "Closes the target. If the target is a page that gets closed too.");
|
|
1346
1346
|
inspectorBackend.registerCommand("Target.exposeDevToolsProtocol", [{"name": "targetId", "type": "string", "optional": false, "description": "", "typeRef": "Target.TargetID"}, {"name": "bindingName", "type": "string", "optional": true, "description": "Binding name, 'cdp' if not specified.", "typeRef": null}, {"name": "inheritPermissions", "type": "boolean", "optional": true, "description": "If true, inherits the current root session's permissions (default: false).", "typeRef": null}], [], "Inject object to the target's main frame that provides a communication channel with browser target. Injected object will be available as `window[bindingName]`. The object has the following API: - `binding.send(json)` - a method to send messages over the remote debugging protocol - `binding.onmessage = json => handleMessage(json)` - a callback that will be called for the protocol notifications and command responses.");
|
|
1347
1347
|
inspectorBackend.registerCommand("Target.createBrowserContext", [{"name": "disposeOnDetach", "type": "boolean", "optional": true, "description": "If specified, disposes this context when debugging session disconnects.", "typeRef": null}, {"name": "proxyServer", "type": "string", "optional": true, "description": "Proxy server, similar to the one passed to --proxy-server", "typeRef": null}, {"name": "proxyBypassList", "type": "string", "optional": true, "description": "Proxy bypass list, similar to the one passed to --proxy-bypass-list", "typeRef": null}, {"name": "originsWithUniversalNetworkAccess", "type": "array", "optional": true, "description": "An optional list of origins to grant unlimited cross-origin access to. Parts of the URL other than those constituting origin are ignored.", "typeRef": "string"}], ["browserContextId"], "Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than one.");
|
|
1348
|
-
inspectorBackend.registerCommand("Target.getBrowserContexts", [], ["browserContextIds"], "Returns all browser contexts created with `Target.createBrowserContext` method.");
|
|
1348
|
+
inspectorBackend.registerCommand("Target.getBrowserContexts", [], ["browserContextIds", "defaultBrowserContextId"], "Returns all browser contexts created with `Target.createBrowserContext` method.");
|
|
1349
1349
|
inspectorBackend.registerCommand("Target.createTarget", [{"name": "url", "type": "string", "optional": false, "description": "The initial URL the page will be navigated to. An empty string indicates about:blank.", "typeRef": null}, {"name": "left", "type": "number", "optional": true, "description": "Frame left origin in DIP (requires newWindow to be true or headless shell).", "typeRef": null}, {"name": "top", "type": "number", "optional": true, "description": "Frame top origin in DIP (requires newWindow to be true or headless shell).", "typeRef": null}, {"name": "width", "type": "number", "optional": true, "description": "Frame width in DIP (requires newWindow to be true or headless shell).", "typeRef": null}, {"name": "height", "type": "number", "optional": true, "description": "Frame height in DIP (requires newWindow to be true or headless shell).", "typeRef": null}, {"name": "windowState", "type": "string", "optional": true, "description": "Frame window state (requires newWindow to be true or headless shell). Default is normal.", "typeRef": "Target.WindowState"}, {"name": "browserContextId", "type": "string", "optional": true, "description": "The browser context to create the page in.", "typeRef": "Browser.BrowserContextID"}, {"name": "enableBeginFrameControl", "type": "boolean", "optional": true, "description": "Whether BeginFrames for this target will be controlled via DevTools (headless shell only, not supported on MacOS yet, false by default).", "typeRef": null}, {"name": "newWindow", "type": "boolean", "optional": true, "description": "Whether to create a new Window or Tab (false by default, not supported by headless shell).", "typeRef": null}, {"name": "background", "type": "boolean", "optional": true, "description": "Whether to create the target in background or foreground (false by default, not supported by headless shell).", "typeRef": null}, {"name": "forTab", "type": "boolean", "optional": true, "description": "Whether to create the target of type \\\"tab\\\".", "typeRef": null}, {"name": "hidden", "type": "boolean", "optional": true, "description": "Whether to create a hidden target. The hidden target is observable via protocol, but not present in the tab UI strip. Cannot be created with `forTab: true`, `newWindow: true` or `background: false`. The life-time of the tab is limited to the life-time of the session.", "typeRef": null}], ["targetId"], "Creates a new page.");
|
|
1350
1350
|
inspectorBackend.registerCommand("Target.detachFromTarget", [{"name": "sessionId", "type": "string", "optional": true, "description": "Session to detach.", "typeRef": "Target.SessionID"}, {"name": "targetId", "type": "string", "optional": true, "description": "Deprecated.", "typeRef": "Target.TargetID"}], [], "Detaches session with given id.");
|
|
1351
1351
|
inspectorBackend.registerCommand("Target.disposeBrowserContext", [{"name": "browserContextId", "type": "string", "optional": false, "description": "", "typeRef": "Browser.BrowserContextID"}], [], "Deletes a BrowserContext. All the belonging pages will be closed without calling their beforeunload hooks.");
|
|
@@ -1194,6 +1194,9 @@ export namespace Audits {
|
|
|
1194
1194
|
FormInputHasWrongButWellIntendedAutocompleteValueError = 'FormInputHasWrongButWellIntendedAutocompleteValueError',
|
|
1195
1195
|
ResponseWasBlockedByORB = 'ResponseWasBlockedByORB',
|
|
1196
1196
|
NavigationEntryMarkedSkippable = 'NavigationEntryMarkedSkippable',
|
|
1197
|
+
AutofillAndManualTextPolicyControlledFeaturesInfo = 'AutofillAndManualTextPolicyControlledFeaturesInfo',
|
|
1198
|
+
AutofillPolicyControlledFeatureInfo = 'AutofillPolicyControlledFeatureInfo',
|
|
1199
|
+
ManualTextPolicyControlledFeatureInfo = 'ManualTextPolicyControlledFeatureInfo',
|
|
1197
1200
|
}
|
|
1198
1201
|
|
|
1199
1202
|
/**
|
|
@@ -2226,7 +2229,9 @@ export namespace Browser {
|
|
|
2226
2229
|
IdleDetection = 'idleDetection',
|
|
2227
2230
|
KeyboardLock = 'keyboardLock',
|
|
2228
2231
|
LocalFonts = 'localFonts',
|
|
2232
|
+
LocalNetwork = 'localNetwork',
|
|
2229
2233
|
LocalNetworkAccess = 'localNetworkAccess',
|
|
2234
|
+
LoopbackNetwork = 'loopbackNetwork',
|
|
2230
2235
|
Midi = 'midi',
|
|
2231
2236
|
MidiSysex = 'midiSysex',
|
|
2232
2237
|
Nfc = 'nfc',
|
|
@@ -18390,6 +18395,10 @@ export namespace Target {
|
|
|
18390
18395
|
* An array of browser context ids.
|
|
18391
18396
|
*/
|
|
18392
18397
|
browserContextIds: Browser.BrowserContextID[];
|
|
18398
|
+
/**
|
|
18399
|
+
* The id of the default browser context if available.
|
|
18400
|
+
*/
|
|
18401
|
+
defaultBrowserContextId?: Browser.BrowserContextID;
|
|
18393
18402
|
}
|
|
18394
18403
|
|
|
18395
18404
|
export interface CreateTargetRequest {
|
package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt
CHANGED
|
@@ -534,7 +534,7 @@ Metrics (lab / observed):
|
|
|
534
534
|
- Load delay: 90 ms, bounds: {min: 157423704371, max: 157423794709}
|
|
535
535
|
- Load duration: 64 ms, bounds: {min: 157423794709, max: 157423858674}
|
|
536
536
|
- Render delay: 94 ms, bounds: {min: 157423858674, max: 157423953162}
|
|
537
|
-
- CLS: 0.04, event: (eventKey: s
|
|
537
|
+
- CLS: 0.04, event: (eventKey: s-166266, ts: 157425604232)
|
|
538
538
|
Metrics (field / real users): n/a – no data for this page in CrUX
|
|
539
539
|
Available insights:
|
|
540
540
|
- insight name: LCPBreakdown
|
|
@@ -665,7 +665,7 @@ Metrics (lab / observed):
|
|
|
665
665
|
- Load delay: 46 ms, bounds: {min: 59728656735, max: 59728702313}
|
|
666
666
|
- Load duration: 506 ms, bounds: {min: 59728702313, max: 59729208600}
|
|
667
667
|
- Render delay: 104 ms, bounds: {min: 59729208600, max: 59729312744}
|
|
668
|
-
- CLS: 0.31, event: (eventKey: s
|
|
668
|
+
- CLS: 0.31, event: (eventKey: s-14787, ts: 59729100192)
|
|
669
669
|
Metrics (field / real users): n/a – no data for this page in CrUX
|
|
670
670
|
Available insights:
|
|
671
671
|
- insight name: Cache
|
|
@@ -738,7 +738,7 @@ Metrics (lab / observed):
|
|
|
738
738
|
- Load delay: 46 ms, bounds: {min: 59728656735, max: 59728702313}
|
|
739
739
|
- Load duration: 506 ms, bounds: {min: 59728702313, max: 59729208600}
|
|
740
740
|
- Render delay: 104 ms, bounds: {min: 59729208600, max: 59729312744}
|
|
741
|
-
- CLS: 0.31, event: (eventKey: s
|
|
741
|
+
- CLS: 0.31, event: (eventKey: s-14787, ts: 59729100192)
|
|
742
742
|
Metrics (field / real users):
|
|
743
743
|
- LCP: 1740 ms (scope: url)
|
|
744
744
|
- INP: 185 ms (scope: url)
|
|
@@ -281,6 +281,7 @@ export class CompilerScriptMapping implements DebuggerSourceMapping {
|
|
|
281
281
|
if (!sourceMap) {
|
|
282
282
|
return null;
|
|
283
283
|
}
|
|
284
|
+
await sourceMap.waitForScopeInfo();
|
|
284
285
|
|
|
285
286
|
const {lineNumber, columnNumber} = script.rawLocationToRelativeLocation(rawLocation);
|
|
286
287
|
const {url, scope} = sourceMap.findOriginalFunctionScope({line: lineNumber, column: columnNumber}) ?? {};
|
|
@@ -313,17 +314,16 @@ export class CompilerScriptMapping implements DebuggerSourceMapping {
|
|
|
313
314
|
return new Workspace.UISourceCode.UIFunctionBounds(uiSourceCode, range, name);
|
|
314
315
|
}
|
|
315
316
|
|
|
316
|
-
translateRawFramesStep(
|
|
317
|
+
async translateRawFramesStep(
|
|
317
318
|
rawFrames: StackTraceImpl.Trie.RawFrame[],
|
|
318
|
-
translatedFrames: Awaited<ReturnType<StackTraceImpl.StackTraceModel.TranslateRawFrames>>): boolean {
|
|
319
|
+
translatedFrames: Awaited<ReturnType<StackTraceImpl.StackTraceModel.TranslateRawFrames>>): Promise<boolean> {
|
|
319
320
|
const frame = rawFrames[0];
|
|
320
321
|
if (StackTraceImpl.Trie.isBuiltinFrame(frame)) {
|
|
321
322
|
return false;
|
|
322
323
|
}
|
|
323
324
|
|
|
324
|
-
const sourceMapWithScopeInfoForFrame =
|
|
325
|
-
|
|
326
|
-
null => {
|
|
325
|
+
const sourceMapWithScopeInfoForFrame = async(rawFrame: StackTraceImpl.Trie.RawFrame):
|
|
326
|
+
Promise<{sourceMap: SDK.SourceMap.SourceMap, script: SDK.Script.Script}|null> => {
|
|
327
327
|
const script = this.#debuggerModel.scriptForId(rawFrame.scriptId ?? '');
|
|
328
328
|
if (!script || this.#stubUISourceCodes.has(script)) {
|
|
329
329
|
// Use fallback while source map is being loaded.
|
|
@@ -331,10 +331,11 @@ export class CompilerScriptMapping implements DebuggerSourceMapping {
|
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
const sourceMap = script.sourceMap();
|
|
334
|
+
await sourceMap?.waitForScopeInfo();
|
|
334
335
|
return sourceMap?.hasScopeInfo() ? {sourceMap, script} : null;
|
|
335
336
|
};
|
|
336
337
|
|
|
337
|
-
const sourceMapAndScript = sourceMapWithScopeInfoForFrame(frame);
|
|
338
|
+
const sourceMapAndScript = await sourceMapWithScopeInfoForFrame(frame);
|
|
338
339
|
if (!sourceMapAndScript) {
|
|
339
340
|
return false;
|
|
340
341
|
}
|
|
@@ -496,7 +496,7 @@ export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObser
|
|
|
496
496
|
const modelData =
|
|
497
497
|
this.#debuggerModelToData.get(target.model(SDK.DebuggerModel.DebuggerModel) as SDK.DebuggerModel.DebuggerModel);
|
|
498
498
|
if (modelData) {
|
|
499
|
-
modelData.translateRawFramesStep(rawFrames, translatedFrames);
|
|
499
|
+
await modelData.translateRawFramesStep(rawFrames, translatedFrames);
|
|
500
500
|
return;
|
|
501
501
|
}
|
|
502
502
|
|
|
@@ -609,10 +609,10 @@ class ModelData {
|
|
|
609
609
|
return scope;
|
|
610
610
|
}
|
|
611
611
|
|
|
612
|
-
translateRawFramesStep(
|
|
612
|
+
async translateRawFramesStep(
|
|
613
613
|
rawFrames: StackTraceImpl.Trie.RawFrame[],
|
|
614
|
-
translatedFrames: Awaited<ReturnType<StackTraceImpl.StackTraceModel.TranslateRawFrames>>): void {
|
|
615
|
-
if (!this.compilerMapping.translateRawFramesStep(rawFrames, translatedFrames)) {
|
|
614
|
+
translatedFrames: Awaited<ReturnType<StackTraceImpl.StackTraceModel.TranslateRawFrames>>): Promise<void> {
|
|
615
|
+
if (!await this.compilerMapping.translateRawFramesStep(rawFrames, translatedFrames)) {
|
|
616
616
|
this.#defaultTranslateRawFramesStep(rawFrames, translatedFrames);
|
|
617
617
|
}
|
|
618
618
|
}
|
|
@@ -8896,11 +8896,11 @@ export const NativeFunctions = [
|
|
|
8896
8896
|
},
|
|
8897
8897
|
{
|
|
8898
8898
|
name: "texElementImage2D",
|
|
8899
|
-
signatures: [["target","level","internalformat","format","type","element"],["target","level","internalformat","width","height","format","type","element"]]
|
|
8899
|
+
signatures: [["target","level","internalformat","format","type","element"],["target","level","internalformat","width","height","format","type","element"],["target","level","internalformat","sx","sy","swidth","sheight","format","type","element"],["target","level","internalformat","sx","sy","swidth","sheight","width","height","format","type","element"]]
|
|
8900
8900
|
},
|
|
8901
8901
|
{
|
|
8902
8902
|
name: "texElement2D",
|
|
8903
|
-
signatures: [["target","level","internalformat","format","type","element"],["target","level","internalformat","width","height","format","type","element"]]
|
|
8903
|
+
signatures: [["target","level","internalformat","format","type","element"],["target","level","internalformat","width","height","format","type","element"],["target","level","internalformat","sx","sy","swidth","sheight","format","type","element"],["target","level","internalformat","sx","sy","swidth","sheight","width","height","format","type","element"]]
|
|
8904
8904
|
},
|
|
8905
8905
|
{
|
|
8906
8906
|
name: "drawingBufferStorage",
|
|
@@ -105,9 +105,11 @@ export class DebuggableFragmentImpl implements StackTrace.StackTrace.DebuggableF
|
|
|
105
105
|
|
|
106
106
|
let index = 0;
|
|
107
107
|
for (const node of this.fragment.node.getCallStack()) {
|
|
108
|
-
for (const frame of node.frames) {
|
|
109
|
-
//
|
|
110
|
-
|
|
108
|
+
for (const [inlineIdx, frame] of node.frames.entries()) {
|
|
109
|
+
// Create virtual frames for inlined frames.
|
|
110
|
+
const sdkFrame = inlineIdx === 0 ? this.callFrames[index] :
|
|
111
|
+
this.callFrames[index].createVirtualCallFrame(inlineIdx, frame.name ?? '');
|
|
112
|
+
frames.push(new DebuggableFrameImpl(frame, sdkFrame));
|
|
111
113
|
}
|
|
112
114
|
index++;
|
|
113
115
|
}
|