chrome-devtools-frontend 1.0.1556696 → 1.0.1559913
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/Images/src/container.svg +4 -0
- package/front_end/core/common/Gzip.ts +15 -0
- 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/CSSMetadata.ts +6 -6
- package/front_end/core/sdk/CSSModel.ts +2 -2
- package/front_end/core/sdk/DOMModel.ts +14 -3
- 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 +5 -4
- package/front_end/generated/SupportedCSSProperties.js +64 -32
- package/front_end/generated/protocol-mapping.d.ts +9 -0
- package/front_end/generated/protocol-proxy-api.d.ts +7 -0
- package/front_end/generated/protocol.ts +23 -1
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +11 -7
- 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/LanternComputationData.ts +4 -3
- package/front_end/models/trace/Processor.ts +6 -5
- package/front_end/models/trace/Styles.ts +10 -1
- package/front_end/models/trace/handlers/LargestImagePaintHandler.ts +2 -2
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +2 -2
- package/front_end/models/trace/handlers/MetaHandler.ts +14 -0
- package/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +54 -34
- package/front_end/models/trace/helpers/Timing.ts +8 -1
- package/front_end/models/trace/insights/Common.ts +1 -1
- package/front_end/models/trace/insights/LCPBreakdown.ts +4 -4
- package/front_end/models/trace/insights/LCPDiscovery.ts +3 -3
- package/front_end/models/trace/insights/RenderBlocking.ts +1 -1
- package/front_end/models/trace/insights/types.ts +1 -1
- package/front_end/models/trace/types/TraceEvents.ts +62 -10
- 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/common/AiCodeGenerationTeaser.ts +48 -12
- package/front_end/panels/common/aiCodeGenerationTeaser.css +14 -0
- package/front_end/panels/common/common.ts +1 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +4 -3
- package/front_end/panels/console/consoleView.css +1 -1
- package/front_end/panels/elements/CSSRuleValidator.ts +38 -0
- package/front_end/panels/elements/ElementsTreeElement.ts +108 -58
- package/front_end/panels/elements/ElementsTreeOutline.ts +0 -17
- package/front_end/panels/elements/ElementsTreeOutlineRenderer.ts +7 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +15 -4
- 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/StatusDialog.ts +4 -3
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +3 -16
- package/front_end/panels/timeline/TimelineFlameChartView.ts +64 -21
- package/front_end/panels/timeline/TimelinePanel.ts +71 -24
- package/front_end/panels/timeline/TimelineUIUtils.ts +28 -2
- package/front_end/panels/timeline/TimingsTrackAppender.ts +3 -1
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -1
- package/front_end/panels/timeline/components/insights/RenderBlocking.ts +6 -4
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +2 -0
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +4 -0
- package/front_end/panels/timeline/timelinePanel.css +8 -1
- package/front_end/panels/timeline/utils/EntryNodes.ts +2 -1
- 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 +202 -32
- 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/SearchableView.ts +11 -5
- package/front_end/ui/legacy/SplitWidget.ts +1 -1
- 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/front_end/ui/legacy/components/perf_ui/FlameChart.ts +43 -9
- package/front_end/ui/visual_logging/KnownContextValues.ts +13 -0
- package/package.json +1 -1
|
@@ -16,6 +16,8 @@ import {
|
|
|
16
16
|
type BrowserContextOptions,
|
|
17
17
|
type ScreenInfo,
|
|
18
18
|
type AddScreenParams,
|
|
19
|
+
type WindowBounds,
|
|
20
|
+
type WindowId,
|
|
19
21
|
type DebugInfo,
|
|
20
22
|
} from '../api/Browser.js';
|
|
21
23
|
import {BrowserContextEvent} from '../api/BrowserContext.js';
|
|
@@ -304,6 +306,17 @@ export class BidiBrowser extends Browser {
|
|
|
304
306
|
throw new UnsupportedOperation();
|
|
305
307
|
}
|
|
306
308
|
|
|
309
|
+
override getWindowBounds(_windowId: WindowId): Promise<WindowBounds> {
|
|
310
|
+
throw new UnsupportedOperation();
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
override setWindowBounds(
|
|
314
|
+
_windowId: WindowId,
|
|
315
|
+
_windowBounds: WindowBounds,
|
|
316
|
+
): Promise<void> {
|
|
317
|
+
throw new UnsupportedOperation();
|
|
318
|
+
}
|
|
319
|
+
|
|
307
320
|
override targets(): Target[] {
|
|
308
321
|
return [
|
|
309
322
|
this.#target,
|
|
@@ -109,17 +109,6 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
109
109
|
this.#request.on('authenticate', this.#handleAuthentication);
|
|
110
110
|
|
|
111
111
|
this.#frame.page().trustedEmitter.emit(PageEvent.Request, this);
|
|
112
|
-
|
|
113
|
-
if (this.#hasInternalHeaderOverwrite) {
|
|
114
|
-
this.interception.handlers.push(async () => {
|
|
115
|
-
await this.continue(
|
|
116
|
-
{
|
|
117
|
-
headers: this.headers(),
|
|
118
|
-
},
|
|
119
|
-
0,
|
|
120
|
-
);
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
112
|
}
|
|
124
113
|
|
|
125
114
|
protected canBeIntercepted(): boolean {
|
|
@@ -165,14 +154,6 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
165
154
|
return await this.#request.fetchPostData();
|
|
166
155
|
}
|
|
167
156
|
|
|
168
|
-
get #hasInternalHeaderOverwrite(): boolean {
|
|
169
|
-
return Boolean(Object.keys(this.#extraHTTPHeaders).length);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
get #extraHTTPHeaders(): Record<string, string> {
|
|
173
|
-
return this.#frame?.page()._extraHTTPHeaders ?? {};
|
|
174
|
-
}
|
|
175
|
-
|
|
176
157
|
override headers(): Record<string, string> {
|
|
177
158
|
// Callers should not be allowed to mutate internal structure.
|
|
178
159
|
const headers: Record<string, string> = {};
|
|
@@ -181,7 +162,6 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
181
162
|
}
|
|
182
163
|
return {
|
|
183
164
|
...headers,
|
|
184
|
-
...this.#extraHTTPHeaders,
|
|
185
165
|
};
|
|
186
166
|
}
|
|
187
167
|
|
|
@@ -215,19 +195,6 @@ export class BidiHTTPRequest extends HTTPRequest {
|
|
|
215
195
|
return this.#frame;
|
|
216
196
|
}
|
|
217
197
|
|
|
218
|
-
override async continue(
|
|
219
|
-
overrides?: ContinueRequestOverrides,
|
|
220
|
-
priority?: number | undefined,
|
|
221
|
-
): Promise<void> {
|
|
222
|
-
return await super.continue(
|
|
223
|
-
{
|
|
224
|
-
headers: this.#hasInternalHeaderOverwrite ? this.headers() : undefined,
|
|
225
|
-
...overrides,
|
|
226
|
-
},
|
|
227
|
-
priority,
|
|
228
|
-
);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
198
|
override async _continue(
|
|
232
199
|
overrides: ContinueRequestOverrides = {},
|
|
233
200
|
): Promise<void> {
|
|
@@ -9,6 +9,7 @@ import * as Bidi from 'webdriver-bidi-protocol';
|
|
|
9
9
|
|
|
10
10
|
import {firstValueFrom, from, raceWith} from '../../third_party/rxjs/rxjs.js';
|
|
11
11
|
import type {BluetoothEmulation} from '../api/BluetoothEmulation.js';
|
|
12
|
+
import type {WindowId} from '../api/Browser.js';
|
|
12
13
|
import type {CDPSession} from '../api/CDPSession.js';
|
|
13
14
|
import type {DeviceRequestPrompt} from '../api/DeviceRequestPrompt.js';
|
|
14
15
|
import type {BoundingBox} from '../api/ElementHandle.js';
|
|
@@ -47,12 +48,7 @@ import {EventEmitter} from '../common/EventEmitter.js';
|
|
|
47
48
|
import {FileChooser} from '../common/FileChooser.js';
|
|
48
49
|
import type {PDFOptions} from '../common/PDFOptions.js';
|
|
49
50
|
import type {Awaitable} from '../common/types.js';
|
|
50
|
-
import {
|
|
51
|
-
evaluationString,
|
|
52
|
-
isString,
|
|
53
|
-
parsePDFOptions,
|
|
54
|
-
timeout,
|
|
55
|
-
} from '../common/util.js';
|
|
51
|
+
import {evaluationString, parsePDFOptions, timeout} from '../common/util.js';
|
|
56
52
|
import type {Viewport} from '../common/Viewport.js';
|
|
57
53
|
import {assert} from '../util/assert.js';
|
|
58
54
|
import {bubble} from '../util/decorators.js';
|
|
@@ -260,15 +256,23 @@ export class BidiPage extends Page {
|
|
|
260
256
|
return this.#frame;
|
|
261
257
|
}
|
|
262
258
|
|
|
259
|
+
override async emulateFocusedPage(enabled: boolean): Promise<void> {
|
|
260
|
+
return await this.#cdpEmulationManager.emulateFocus(enabled);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
263
|
override resize(_params: {
|
|
264
264
|
contentWidth: number;
|
|
265
265
|
contentHeight: number;
|
|
266
266
|
}): Promise<void> {
|
|
267
|
-
throw new
|
|
267
|
+
throw new UnsupportedOperation();
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
override windowId(): Promise<WindowId> {
|
|
271
|
+
throw new UnsupportedOperation();
|
|
268
272
|
}
|
|
269
273
|
|
|
270
274
|
override openDevTools(): Promise<Page> {
|
|
271
|
-
throw new
|
|
275
|
+
throw new UnsupportedOperation();
|
|
272
276
|
}
|
|
273
277
|
|
|
274
278
|
async focusedFrame(): Promise<BidiFrame> {
|
|
@@ -725,9 +729,7 @@ export class BidiPage extends Page {
|
|
|
725
729
|
|
|
726
730
|
get isNetworkInterceptionEnabled(): boolean {
|
|
727
731
|
return (
|
|
728
|
-
Boolean(this.#requestInterception) ||
|
|
729
|
-
Boolean(this.#extraHeadersInterception) ||
|
|
730
|
-
Boolean(this.#authInterception)
|
|
732
|
+
Boolean(this.#requestInterception) || Boolean(this.#authInterception)
|
|
731
733
|
);
|
|
732
734
|
}
|
|
733
735
|
|
|
@@ -743,26 +745,10 @@ export class BidiPage extends Page {
|
|
|
743
745
|
/**
|
|
744
746
|
* @internal
|
|
745
747
|
*/
|
|
746
|
-
_extraHTTPHeaders: Record<string, string> = {};
|
|
747
|
-
#extraHeadersInterception?: string;
|
|
748
748
|
override async setExtraHTTPHeaders(
|
|
749
749
|
headers: Record<string, string>,
|
|
750
750
|
): Promise<void> {
|
|
751
|
-
|
|
752
|
-
for (const [key, value] of Object.entries(headers)) {
|
|
753
|
-
assert(
|
|
754
|
-
isString(value),
|
|
755
|
-
`Expected value of header "${key}" to be String, but "${typeof value}" is found.`,
|
|
756
|
-
);
|
|
757
|
-
extraHTTPHeaders[key.toLowerCase()] = value;
|
|
758
|
-
}
|
|
759
|
-
this._extraHTTPHeaders = extraHTTPHeaders;
|
|
760
|
-
|
|
761
|
-
this.#extraHeadersInterception = await this.#toggleInterception(
|
|
762
|
-
[Bidi.Network.InterceptPhase.BeforeRequestSent],
|
|
763
|
-
this.#extraHeadersInterception,
|
|
764
|
-
Boolean(Object.keys(this._extraHTTPHeaders).length),
|
|
765
|
-
);
|
|
751
|
+
await this.#frame.browsingContext.setExtraHTTPHeaders(headers);
|
|
766
752
|
}
|
|
767
753
|
|
|
768
754
|
/**
|
|
@@ -9,6 +9,8 @@ import type * as Bidi from 'webdriver-bidi-protocol';
|
|
|
9
9
|
import type {BluetoothEmulation} from '../../api/BluetoothEmulation.js';
|
|
10
10
|
import type {DeviceRequestPrompt} from '../../api/DeviceRequestPrompt.js';
|
|
11
11
|
import {EventEmitter} from '../../common/EventEmitter.js';
|
|
12
|
+
import {isString} from '../../common/util.js';
|
|
13
|
+
import {assert} from '../../util/assert.js';
|
|
12
14
|
import {inertIfDisposed, throwIfDisposed} from '../../util/decorators.js';
|
|
13
15
|
import {DisposableStack, disposeSymbol} from '../../util/disposable.js';
|
|
14
16
|
import {BidiBluetoothEmulation} from '../BluetoothEmulation.js';
|
|
@@ -785,4 +787,21 @@ export class BrowsingContext extends EventEmitter<{
|
|
|
785
787
|
signal,
|
|
786
788
|
);
|
|
787
789
|
}
|
|
790
|
+
|
|
791
|
+
async setExtraHTTPHeaders(headers: Record<string, string>): Promise<void> {
|
|
792
|
+
await this.#session.send('network.setExtraHeaders', {
|
|
793
|
+
headers: Object.entries(headers).map(([key, value]) => {
|
|
794
|
+
assert(
|
|
795
|
+
isString(value),
|
|
796
|
+
`Expected value of header "${key}" to be String, but "${typeof value}" is found.`,
|
|
797
|
+
);
|
|
798
|
+
|
|
799
|
+
return {
|
|
800
|
+
name: key.toLowerCase(),
|
|
801
|
+
value: {type: 'string', value: value},
|
|
802
|
+
};
|
|
803
|
+
}),
|
|
804
|
+
contexts: [this.id],
|
|
805
|
+
});
|
|
806
|
+
}
|
|
788
807
|
}
|
|
@@ -18,6 +18,8 @@ import {
|
|
|
18
18
|
type TargetFilterCallback,
|
|
19
19
|
type ScreenInfo,
|
|
20
20
|
type AddScreenParams,
|
|
21
|
+
type WindowBounds,
|
|
22
|
+
type WindowId,
|
|
21
23
|
} from '../api/Browser.js';
|
|
22
24
|
import {BrowserContextEvent} from '../api/BrowserContext.js';
|
|
23
25
|
import {CDPSessionEvent} from '../api/CDPSession.js';
|
|
@@ -453,6 +455,23 @@ export class CdpBrowser extends BrowserBase {
|
|
|
453
455
|
return await this.#connection.send('Emulation.removeScreen', {screenId});
|
|
454
456
|
}
|
|
455
457
|
|
|
458
|
+
override async getWindowBounds(windowId: WindowId): Promise<WindowBounds> {
|
|
459
|
+
const {bounds} = await this.#connection.send('Browser.getWindowBounds', {
|
|
460
|
+
windowId: Number(windowId),
|
|
461
|
+
});
|
|
462
|
+
return bounds;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
override async setWindowBounds(
|
|
466
|
+
windowId: WindowId,
|
|
467
|
+
windowBounds: WindowBounds,
|
|
468
|
+
): Promise<void> {
|
|
469
|
+
await this.#connection.send('Browser.setWindowBounds', {
|
|
470
|
+
windowId: Number(windowId),
|
|
471
|
+
bounds: windowBounds,
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
|
|
456
475
|
override targets(): CdpTarget[] {
|
|
457
476
|
return Array.from(
|
|
458
477
|
this.#targetManager.getAvailableTargets().values(),
|
|
@@ -66,6 +66,11 @@ interface JavascriptEnabledState {
|
|
|
66
66
|
active: boolean;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
interface FocusState {
|
|
70
|
+
enabled: boolean;
|
|
71
|
+
active: boolean;
|
|
72
|
+
}
|
|
73
|
+
|
|
69
74
|
/**
|
|
70
75
|
* @internal
|
|
71
76
|
*/
|
|
@@ -193,6 +198,14 @@ export class EmulationManager implements ClientProvider {
|
|
|
193
198
|
this,
|
|
194
199
|
this.#setJavaScriptEnabled,
|
|
195
200
|
);
|
|
201
|
+
#focusState = new EmulatedState<FocusState>(
|
|
202
|
+
{
|
|
203
|
+
enabled: true,
|
|
204
|
+
active: false,
|
|
205
|
+
},
|
|
206
|
+
this,
|
|
207
|
+
this.#emulateFocus,
|
|
208
|
+
);
|
|
196
209
|
|
|
197
210
|
#secondaryClients = new Set<CDPSession>();
|
|
198
211
|
|
|
@@ -578,4 +591,21 @@ export class EmulationManager implements ClientProvider {
|
|
|
578
591
|
javaScriptEnabled: enabled,
|
|
579
592
|
});
|
|
580
593
|
}
|
|
594
|
+
|
|
595
|
+
@invokeAtMostOnceForArguments
|
|
596
|
+
async #emulateFocus(client: CDPSession, state: FocusState): Promise<void> {
|
|
597
|
+
if (!state.active) {
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
await client.send('Emulation.setFocusEmulationEnabled', {
|
|
601
|
+
enabled: state.enabled,
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
async emulateFocus(enabled: boolean): Promise<void> {
|
|
606
|
+
await this.#focusState.setState({
|
|
607
|
+
active: true,
|
|
608
|
+
enabled,
|
|
609
|
+
});
|
|
610
|
+
}
|
|
581
611
|
}
|
|
@@ -8,7 +8,7 @@ import type {Protocol} from 'devtools-protocol';
|
|
|
8
8
|
|
|
9
9
|
import {firstValueFrom, from, raceWith} from '../../third_party/rxjs/rxjs.js';
|
|
10
10
|
import type {BluetoothEmulation} from '../api/BluetoothEmulation.js';
|
|
11
|
-
import type {Browser} from '../api/Browser.js';
|
|
11
|
+
import type {Browser, WindowId} from '../api/Browser.js';
|
|
12
12
|
import type {BrowserContext} from '../api/BrowserContext.js';
|
|
13
13
|
import {CDPSessionEvent, type CDPSession} from '../api/CDPSession.js';
|
|
14
14
|
import type {DeviceRequestPrompt} from '../api/DeviceRequestPrompt.js';
|
|
@@ -375,17 +375,22 @@ export class CdpPage extends Page {
|
|
|
375
375
|
contentWidth: number;
|
|
376
376
|
contentHeight: number;
|
|
377
377
|
}): Promise<void> {
|
|
378
|
-
const
|
|
379
|
-
'Browser.getWindowForTarget',
|
|
380
|
-
);
|
|
381
|
-
|
|
378
|
+
const windowId = await this.windowId();
|
|
382
379
|
await this.#primaryTargetClient.send('Browser.setContentsSize', {
|
|
383
|
-
windowId,
|
|
380
|
+
windowId: Number(windowId),
|
|
384
381
|
width: params.contentWidth,
|
|
385
382
|
height: params.contentHeight,
|
|
386
383
|
});
|
|
387
384
|
}
|
|
388
385
|
|
|
386
|
+
override async windowId(): Promise<WindowId> {
|
|
387
|
+
const {windowId} = await this.#primaryTargetClient.send(
|
|
388
|
+
'Browser.getWindowForTarget',
|
|
389
|
+
);
|
|
390
|
+
|
|
391
|
+
return windowId.toString();
|
|
392
|
+
}
|
|
393
|
+
|
|
389
394
|
async #onFileChooser(
|
|
390
395
|
event: Protocol.Page.FileChooserOpenedEvent,
|
|
391
396
|
): Promise<void> {
|
|
@@ -580,6 +585,10 @@ export class CdpPage extends Page {
|
|
|
580
585
|
);
|
|
581
586
|
}
|
|
582
587
|
|
|
588
|
+
override async emulateFocusedPage(enabled: boolean): Promise<void> {
|
|
589
|
+
return await this.#emulationManager.emulateFocus(enabled);
|
|
590
|
+
}
|
|
591
|
+
|
|
583
592
|
override setDefaultNavigationTimeout(timeout: number): void {
|
|
584
593
|
this._timeoutSettings.setDefaultNavigationTimeout(timeout);
|
|
585
594
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
10
|
export const PUPPETEER_REVISIONS = Object.freeze({
|
|
11
|
-
chrome: '143.0.7499.
|
|
12
|
-
'chrome-headless-shell': '143.0.7499.
|
|
13
|
-
firefox: '
|
|
11
|
+
chrome: '143.0.7499.42',
|
|
12
|
+
'chrome-headless-shell': '143.0.7499.42',
|
|
13
|
+
firefox: 'stable_146.0',
|
|
14
14
|
});
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
:host {
|
|
8
8
|
white-space: normal;
|
|
9
9
|
display: inline-block;
|
|
10
|
+
margin-right: var(--sys-size-1);
|
|
11
|
+
margin-left: var(--sys-size-1);
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
.icon-button {
|
|
@@ -33,7 +35,7 @@
|
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
.icon-button:focus-visible {
|
|
36
|
-
|
|
38
|
+
outline: var(--sys-size-2) solid var(--sys-color-state-focus-ring);
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
.compact .icon-button-title {
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
/* eslint-disable @devtools/no-lit-render-outside-of-view, @devtools/enforce-custom-element-definitions-location */
|
|
5
5
|
|
|
6
|
+
import * as Platform from '../../../core/platform/platform.js';
|
|
7
|
+
import * as Components from '../../legacy/components/utils/utils.js';
|
|
6
8
|
import {html, nothing, render} from '../../lit/lit.js';
|
|
7
9
|
|
|
8
10
|
import reportStyles from './report.css.js';
|
|
@@ -33,13 +35,16 @@ import reportValueStyles from './reportValue.css.js';
|
|
|
33
35
|
*/
|
|
34
36
|
export interface ReportData {
|
|
35
37
|
reportTitle: string;
|
|
38
|
+
reportUrl?: Platform.DevToolsPath.UrlString;
|
|
36
39
|
}
|
|
37
40
|
export class Report extends HTMLElement {
|
|
38
41
|
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
39
42
|
#reportTitle = '';
|
|
43
|
+
#reportUrl = Platform.DevToolsPath.EmptyUrlString;
|
|
40
44
|
|
|
41
|
-
set data({reportTitle}: ReportData) {
|
|
45
|
+
set data({reportTitle, reportUrl}: ReportData) {
|
|
42
46
|
this.#reportTitle = reportTitle;
|
|
47
|
+
this.#reportUrl = reportUrl ?? Platform.DevToolsPath.EmptyUrlString;
|
|
43
48
|
this.#render();
|
|
44
49
|
}
|
|
45
50
|
|
|
@@ -52,7 +57,11 @@ export class Report extends HTMLElement {
|
|
|
52
57
|
// clang-format off
|
|
53
58
|
render(html`
|
|
54
59
|
<style>${reportStyles}</style>
|
|
55
|
-
${this.#reportTitle ? html`<div class="report-title"
|
|
60
|
+
${this.#reportTitle ? html`<div class="report-title">
|
|
61
|
+
${this.#reportTitle}
|
|
62
|
+
${this.#reportUrl ? Components.Linkifier.Linkifier.linkifyURL(this.#reportUrl, {
|
|
63
|
+
tabStop: true, jslogContext: 'source-location', className: 'report-url'}) : nothing}
|
|
64
|
+
</div>` : nothing}
|
|
56
65
|
<div class="content">
|
|
57
66
|
<slot></slot>
|
|
58
67
|
</div>
|
|
@@ -26,3 +26,19 @@
|
|
|
26
26
|
color: var(--sys-color-on-surface);
|
|
27
27
|
background-color: var(--sys-color-cdt-base-container);
|
|
28
28
|
}
|
|
29
|
+
|
|
30
|
+
.report-url {
|
|
31
|
+
background: none;
|
|
32
|
+
border-radius: 2px;
|
|
33
|
+
border: none;
|
|
34
|
+
color: var(--text-link);
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
display: block;
|
|
37
|
+
font: var(--sys-typescale-body4-regular);
|
|
38
|
+
height: unset;
|
|
39
|
+
margin: 0;
|
|
40
|
+
outline-offset: 2px;
|
|
41
|
+
outline: none;
|
|
42
|
+
padding: 0 !important; /* stylelint-disable-line declaration-no-important */
|
|
43
|
+
text-decoration: underline;
|
|
44
|
+
}
|