chrome-devtools-frontend 1.0.1672388 → 1.0.1674545
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/eslint.config.mjs +3 -3
- package/front_end/core/common/SettingRegistration.ts +1 -26
- package/front_end/core/common/Settings.ts +4 -53
- package/front_end/core/host/UserMetrics.ts +127 -117
- package/front_end/core/protocol_client/PuppeteerDevToolsConnection.ts +42 -9
- package/front_end/core/root/Runtime.ts +7 -2
- package/front_end/core/sdk/NetworkManager.ts +0 -35
- package/front_end/core/sdk/SourceMap.ts +1 -19
- package/front_end/core/sdk/SourceMapManager.ts +75 -48
- package/front_end/core/sdk/SourceMapScopesInfo.ts +0 -62
- package/front_end/devtools_compatibility.js +1 -1
- package/front_end/generated/InspectorBackendCommands.ts +4 -3
- package/front_end/generated/{SupportedCSSProperties.js → SupportedCSSProperties.ts} +32 -1
- package/front_end/generated/protocol-mapping.d.ts +8 -0
- package/front_end/generated/protocol-proxy-api.d.ts +6 -0
- package/front_end/generated/protocol.ts +16 -2
- package/front_end/models/ai_assistance/AiSetting.ts +66 -3
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +4 -3
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +1 -1
- package/front_end/models/bindings/CompilerScriptMapping.ts +1 -1
- package/front_end/models/emulation/DeviceModeModel.ts +25 -34
- package/front_end/models/emulation/EmulatedDevices.ts +1 -1
- package/front_end/models/javascript_metadata/NativeFunctions.js +4 -4
- package/front_end/models/trace/ModelImpl.ts +5 -0
- package/front_end/models/trace/Processor.ts +47 -10
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +18 -19
- package/front_end/models/trace/handlers/MetaHandler.ts +46 -9
- package/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +11 -0
- package/front_end/models/trace/insights/CLSCulprits.ts +1 -2
- package/front_end/models/trace/insights/CharacterSet.ts +1 -1
- package/front_end/models/trace/insights/Common.ts +21 -2
- package/front_end/models/trace/insights/DocumentLatency.ts +1 -1
- package/front_end/models/trace/insights/LCPBreakdown.ts +7 -6
- package/front_end/models/trace/insights/LCPDiscovery.ts +1 -1
- package/front_end/models/trace/insights/ModernHTTP.ts +7 -3
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +1 -1
- package/front_end/models/trace/insights/RenderBlocking.ts +1 -1
- package/front_end/models/trace/insights/ThirdParties.ts +5 -2
- package/front_end/models/trace/insights/types.ts +11 -6
- package/front_end/models/trace/types/Configuration.ts +5 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +11 -10
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +3 -45
- package/front_end/panels/application/BackgroundServiceView.ts +42 -40
- package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -0
- package/front_end/panels/common/ExtensionServer.ts +7 -1
- package/front_end/panels/common/common.ts +0 -1
- package/front_end/panels/console/ConsoleInsightTeaser.ts +7 -6
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
- package/front_end/panels/elements/ClassesPaneWidget.ts +2 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +56 -5
- package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
- package/front_end/panels/elements/components/AdornerManager.ts +1 -0
- package/front_end/panels/emulation/AdvancedApp.ts +3 -3
- package/front_end/panels/emulation/DeviceModeToolbar.ts +2 -11
- package/front_end/panels/emulation/DeviceModeView.ts +234 -75
- package/front_end/panels/emulation/InspectedPagePlaceholder.ts +1 -1
- package/front_end/panels/emulation/deviceModeView.css +4 -21
- package/front_end/panels/emulation/emulation-meta.ts +4 -30
- package/front_end/panels/emulation/emulation.ts +0 -3
- package/front_end/panels/explain/components/ConsoleInsight.ts +11 -7
- package/front_end/panels/layers/LayersPanel.ts +2 -2
- package/front_end/panels/layers/layers-meta.ts +2 -2
- package/front_end/panels/lighthouse/LighthouseController.ts +3 -7
- package/front_end/panels/mobile_throttling/CPUThrottlingSelector.ts +313 -0
- package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +0 -10
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +23 -10
- package/front_end/panels/mobile_throttling/mobile_throttling.ts +3 -0
- package/front_end/panels/network/NetworkConfigView.ts +1 -71
- package/front_end/panels/network/networkConfigView.css +1 -2
- package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +3 -3
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +5 -5
- package/front_end/panels/profiler/HeapProfileView.ts +32 -32
- package/front_end/panels/profiler/HeapProfilerPanel.ts +2 -2
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +33 -37
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +26 -27
- package/front_end/panels/profiler/HeapSnapshotView.ts +48 -48
- package/front_end/panels/profiler/IsolateSelector.ts +10 -10
- package/front_end/panels/profiler/ModuleUIStrings.ts +25 -25
- package/front_end/panels/profiler/ProfileLauncherView.ts +6 -6
- package/front_end/panels/profiler/ProfilesPanel.ts +6 -6
- package/front_end/panels/profiler/WritableProfileHeader.ts +6 -6
- package/front_end/panels/profiler/profiler-meta.ts +7 -7
- package/front_end/panels/recorder/RecorderPanel.ts +1 -1
- package/front_end/panels/settings/AISettingsTab.ts +27 -23
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +463 -13
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +12 -17
- package/front_end/panels/timeline/TimelinePanel.ts +22 -35
- package/front_end/panels/timeline/components/CWVMetrics.ts +16 -3
- package/front_end/panels/timeline/components/LiveMetricsView.ts +27 -6
- package/front_end/panels/timeline/components/NetworkTrackWidget.ts +1 -1
- package/front_end/panels/timeline/components/components.ts +0 -4
- package/front_end/panels/timeline/components/cwvMetrics.css +4 -0
- package/front_end/panels/timeline/components/liveMetricsView.css +7 -17
- package/front_end/panels/timeline/components/metricValueStyles.css +17 -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/es5-iife/puppeteer-core-browser.d.ts +64 -15
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +65 -16
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +50 -7
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js +5 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js +8 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Dialog.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Dialog.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Dialog.js.map +1 -1
- 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 +16 -1
- 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/Connection.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.js +11 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Dialog.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Dialog.js +5 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Dialog.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js +10 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.d.ts +27 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.js +12 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js +5 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
- 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 +64 -15
- package/front_end/third_party/puppeteer/package/package.json +2 -2
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +50 -7
- package/front_end/third_party/puppeteer/package/src/bidi/BidiOverCdp.ts +9 -7
- package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +9 -6
- package/front_end/third_party/puppeteer/package/src/bidi/Dialog.ts +4 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +24 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Connection.ts +11 -6
- package/front_end/third_party/puppeteer/package/src/cdp/Dialog.ts +7 -0
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +11 -0
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +7 -3
- package/front_end/third_party/puppeteer/package/src/common/Debug.ts +30 -5
- package/front_end/third_party/puppeteer/package/src/common/util.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/node/ScreenRecorder.ts +6 -4
- 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/third_party/source-map-scopes-codec/package/CONTRIBUTING.md +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/LICENSE +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/README.md +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts.map +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/scopes.d.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/scopes.d.ts.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/deno.json +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/package.json +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js +2 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js.map +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.ts +2 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/codec.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/codec.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/codec.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/mod.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/mod.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/mod.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/scopes.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/scopes.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/scopes.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/util.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/util.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/util.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/vlq.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/vlq.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/vlq.ts +0 -0
- package/front_end/ui/components/dialogs/ShortcutDialog.ts +2 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +4 -12
- package/front_end/ui/components/settings/settingCheckbox.css +0 -7
- package/front_end/ui/legacy/Treeoutline.ts +14 -14
- package/front_end/ui/legacy/UIUtils.ts +2 -47
- package/front_end/ui/legacy/Widget.ts +10 -2
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +1 -1
- package/front_end/ui/lit/Directives.ts +80 -0
- package/front_end/ui/lit/lit.ts +1 -0
- package/front_end/ui/lit/render.ts +8 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +18 -0
- package/mcp/mcp.ts +1 -0
- package/package.json +1 -1
- package/front_end/panels/common/ThrottlingUtils.ts +0 -51
- package/front_end/panels/emulation/DeviceModeWrapper.ts +0 -248
- package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +0 -235
- package/front_end/panels/timeline/components/NetworkThrottlingSelector.ts +0 -245
- package/front_end/panels/timeline/components/cpuThrottlingSelector.css +0 -30
- package/front_end/panels/timeline/components/networkThrottlingSelector.css +0 -24
- /package/front_end/core/host/{UserMetricsEnums.d.ts → UserMetricsEnums.ts} +0 -0
- /package/front_end/generated/{ARIAProperties.js → ARIAProperties.ts} +0 -0
|
@@ -125,18 +125,58 @@ import type {WebWorker} from './WebWorker.js';
|
|
|
125
125
|
* @public
|
|
126
126
|
*/
|
|
127
127
|
export interface Metrics {
|
|
128
|
+
/**
|
|
129
|
+
* The timestamp when the metrics sample was taken, in monotonic time
|
|
130
|
+
* (seconds since an arbitrary point in the past).
|
|
131
|
+
*/
|
|
128
132
|
Timestamp?: number;
|
|
133
|
+
/**
|
|
134
|
+
* Number of documents in the page.
|
|
135
|
+
*/
|
|
129
136
|
Documents?: number;
|
|
137
|
+
/**
|
|
138
|
+
* Number of frames in the page.
|
|
139
|
+
*/
|
|
130
140
|
Frames?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Number of events in the page.
|
|
143
|
+
*/
|
|
131
144
|
JSEventListeners?: number;
|
|
145
|
+
/**
|
|
146
|
+
* Number of DOM nodes in the page.
|
|
147
|
+
*/
|
|
132
148
|
Nodes?: number;
|
|
149
|
+
/**
|
|
150
|
+
* Total number of full or partial page layouts.
|
|
151
|
+
*/
|
|
133
152
|
LayoutCount?: number;
|
|
153
|
+
/**
|
|
154
|
+
* Total number of page style recalculations.
|
|
155
|
+
*/
|
|
134
156
|
RecalcStyleCount?: number;
|
|
157
|
+
/**
|
|
158
|
+
* Combined duration of all page layouts, in seconds.
|
|
159
|
+
*/
|
|
135
160
|
LayoutDuration?: number;
|
|
161
|
+
/**
|
|
162
|
+
* Combined duration of all page style recalculations, in seconds.
|
|
163
|
+
*/
|
|
136
164
|
RecalcStyleDuration?: number;
|
|
165
|
+
/**
|
|
166
|
+
* Combined duration of JavaScript execution, in seconds.
|
|
167
|
+
*/
|
|
137
168
|
ScriptDuration?: number;
|
|
169
|
+
/**
|
|
170
|
+
* Combined duration of all tasks performed by the browser, in seconds.
|
|
171
|
+
*/
|
|
138
172
|
TaskDuration?: number;
|
|
173
|
+
/**
|
|
174
|
+
* Used JavaScript heap size, in bytes.
|
|
175
|
+
*/
|
|
139
176
|
JSHeapUsedSize?: number;
|
|
177
|
+
/**
|
|
178
|
+
* Total JavaScript heap size, in bytes.
|
|
179
|
+
*/
|
|
140
180
|
JSHeapTotalSize?: number;
|
|
141
181
|
}
|
|
142
182
|
|
|
@@ -1720,7 +1760,8 @@ export abstract class Page extends EventEmitter<PageEvents> {
|
|
|
1720
1760
|
*
|
|
1721
1761
|
* @returns
|
|
1722
1762
|
*
|
|
1723
|
-
* - `Timestamp` : The timestamp when the metrics sample was taken
|
|
1763
|
+
* - `Timestamp` : The timestamp when the metrics sample was taken, in
|
|
1764
|
+
* monotonic time (seconds).
|
|
1724
1765
|
*
|
|
1725
1766
|
* - `Documents` : Number of documents in the page.
|
|
1726
1767
|
*
|
|
@@ -1734,18 +1775,20 @@ export abstract class Page extends EventEmitter<PageEvents> {
|
|
|
1734
1775
|
*
|
|
1735
1776
|
* - `RecalcStyleCount` : Total number of page style recalculations.
|
|
1736
1777
|
*
|
|
1737
|
-
* - `LayoutDuration` : Combined durations of all page layouts.
|
|
1778
|
+
* - `LayoutDuration` : Combined durations of all page layouts, in seconds.
|
|
1738
1779
|
*
|
|
1739
1780
|
* - `RecalcStyleDuration` : Combined duration of all page style
|
|
1740
|
-
* recalculations.
|
|
1781
|
+
* recalculations, in seconds.
|
|
1741
1782
|
*
|
|
1742
|
-
* - `ScriptDuration` : Combined duration of JavaScript execution
|
|
1783
|
+
* - `ScriptDuration` : Combined duration of JavaScript execution, in
|
|
1784
|
+
* seconds.
|
|
1743
1785
|
*
|
|
1744
|
-
* - `TaskDuration` : Combined duration of all tasks performed by the
|
|
1786
|
+
* - `TaskDuration` : Combined duration of all tasks performed by the
|
|
1787
|
+
* browser, in seconds.
|
|
1745
1788
|
*
|
|
1746
|
-
* - `JSHeapUsedSize` : Used JavaScript heap size.
|
|
1789
|
+
* - `JSHeapUsedSize` : Used JavaScript heap size, in bytes.
|
|
1747
1790
|
*
|
|
1748
|
-
* - `JSHeapTotalSize` : Total JavaScript heap size.
|
|
1791
|
+
* - `JSHeapTotalSize` : Total JavaScript heap size, in bytes.
|
|
1749
1792
|
*
|
|
1750
1793
|
* @remarks
|
|
1751
1794
|
* All timestamps are in monotonic time: monotonically increasing time
|
|
@@ -9,24 +9,25 @@ import type {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js'
|
|
|
9
9
|
|
|
10
10
|
import type {CDPEvents, CDPSession} from '../api/CDPSession.js';
|
|
11
11
|
import type {Connection as CdpConnection} from '../cdp/Connection.js';
|
|
12
|
-
import {debug} from '../common/Debug.js';
|
|
12
|
+
import {debug, type DebugPrefix, type Logger} from '../common/Debug.js';
|
|
13
13
|
import {TargetCloseError} from '../common/Errors.js';
|
|
14
14
|
import type {Handler} from '../common/EventEmitter.js';
|
|
15
15
|
|
|
16
16
|
import {BidiConnection} from './Connection.js';
|
|
17
17
|
|
|
18
|
-
const bidiServerLogger = (
|
|
19
|
-
prefix: string,
|
|
20
|
-
): ((...args: unknown[]) => void) | undefined => {
|
|
21
|
-
return debug(`bidi:${prefix}`);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
18
|
/**
|
|
25
19
|
* @internal
|
|
26
20
|
*/
|
|
27
21
|
export async function connectBidiOverCdp(
|
|
28
22
|
cdp: CdpConnection,
|
|
23
|
+
logger: Logger = debug,
|
|
29
24
|
): Promise<BidiConnection> {
|
|
25
|
+
const bidiServerLogger = (
|
|
26
|
+
prefix: string,
|
|
27
|
+
): ((...args: unknown[]) => void) | undefined => {
|
|
28
|
+
return logger(`bidi:${prefix}` as DebugPrefix);
|
|
29
|
+
};
|
|
30
|
+
|
|
30
31
|
const transportBiDi = new NoOpTransport();
|
|
31
32
|
const cdpConnectionAdapter = new CdpConnectionAdapter(cdp);
|
|
32
33
|
const pptrTransport = {
|
|
@@ -53,6 +54,7 @@ export async function connectBidiOverCdp(
|
|
|
53
54
|
cdp._idGenerator,
|
|
54
55
|
cdp.delay,
|
|
55
56
|
cdp.timeout,
|
|
57
|
+
logger,
|
|
56
58
|
);
|
|
57
59
|
const bidiServer = await BidiMapper.BidiServer.createAndStart(
|
|
58
60
|
transportBiDi,
|
|
@@ -9,7 +9,7 @@ import type * as Bidi from 'webdriver-bidi-protocol';
|
|
|
9
9
|
|
|
10
10
|
import {CallbackRegistry} from '../common/CallbackRegistry.js';
|
|
11
11
|
import type {ConnectionTransport} from '../common/ConnectionTransport.js';
|
|
12
|
-
import {debug} from '../common/Debug.js';
|
|
12
|
+
import {debug, DEBUG_PREFIXES, type Logger} from '../common/Debug.js';
|
|
13
13
|
import {ConnectionClosedError} from '../common/Errors.js';
|
|
14
14
|
import type {EventsWithWildcard} from '../common/EventEmitter.js';
|
|
15
15
|
import {EventEmitter} from '../common/EventEmitter.js';
|
|
@@ -23,9 +23,6 @@ import type {
|
|
|
23
23
|
Connection,
|
|
24
24
|
} from './core/Connection.js';
|
|
25
25
|
|
|
26
|
-
const debugProtocolSend = debug('puppeteer:webDriverBiDi:SEND ►');
|
|
27
|
-
const debugProtocolReceive = debug('puppeteer:webDriverBiDi:RECV ◀');
|
|
28
|
-
|
|
29
26
|
export type CdpEvent = ChromiumBidi.Cdp.Event;
|
|
30
27
|
|
|
31
28
|
/**
|
|
@@ -60,6 +57,8 @@ export class BidiConnection
|
|
|
60
57
|
#closed = false;
|
|
61
58
|
#callbacks: CallbackRegistry;
|
|
62
59
|
#emitters: Array<EventEmitter<any>> = [];
|
|
60
|
+
#debugProtocolSend: ((...args: unknown[]) => void) | undefined;
|
|
61
|
+
#debugProtocolReceive: ((...args: unknown[]) => void) | undefined;
|
|
63
62
|
|
|
64
63
|
constructor(
|
|
65
64
|
url: string,
|
|
@@ -67,6 +66,7 @@ export class BidiConnection
|
|
|
67
66
|
idGenerator: GetIdFn,
|
|
68
67
|
delay = 0,
|
|
69
68
|
timeout?: number,
|
|
69
|
+
logger: Logger = debug,
|
|
70
70
|
) {
|
|
71
71
|
super();
|
|
72
72
|
this.#url = url;
|
|
@@ -74,6 +74,9 @@ export class BidiConnection
|
|
|
74
74
|
this.#timeout = timeout ?? 180_000;
|
|
75
75
|
this.#callbacks = new CallbackRegistry(idGenerator);
|
|
76
76
|
|
|
77
|
+
this.#debugProtocolSend = logger(DEBUG_PREFIXES.bidiSend);
|
|
78
|
+
this.#debugProtocolReceive = logger(DEBUG_PREFIXES.bidiReceive);
|
|
79
|
+
|
|
77
80
|
this.#transport = transport;
|
|
78
81
|
this.#transport.onmessage = this.onMessage.bind(this);
|
|
79
82
|
this.#transport.onclose = this.unbind.bind(this);
|
|
@@ -131,7 +134,7 @@ export class BidiConnection
|
|
|
131
134
|
method,
|
|
132
135
|
params,
|
|
133
136
|
} as Bidi.Command);
|
|
134
|
-
debugProtocolSend?.(stringifiedMessage);
|
|
137
|
+
this.#debugProtocolSend?.(stringifiedMessage);
|
|
135
138
|
this.#transport.send(stringifiedMessage);
|
|
136
139
|
}) as Promise<{result: Commands[T]['returnType']}>;
|
|
137
140
|
}
|
|
@@ -145,7 +148,7 @@ export class BidiConnection
|
|
|
145
148
|
return setTimeout(f, this.#delay);
|
|
146
149
|
});
|
|
147
150
|
}
|
|
148
|
-
debugProtocolReceive?.(message);
|
|
151
|
+
this.#debugProtocolReceive?.(message);
|
|
149
152
|
const object: Bidi.Message | CdpEvent = JSON.parse(message);
|
|
150
153
|
if ('type' in object) {
|
|
151
154
|
switch (object.type) {
|
|
@@ -18,6 +18,10 @@ export class BidiDialog extends Dialog {
|
|
|
18
18
|
super(prompt.info.type, prompt.info.message, prompt.info.defaultValue);
|
|
19
19
|
this.#prompt = prompt;
|
|
20
20
|
this.handled = prompt.handled;
|
|
21
|
+
|
|
22
|
+
prompt.once('handled', () => {
|
|
23
|
+
this.handled = true;
|
|
24
|
+
});
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
override async handle(options: {
|
|
@@ -132,6 +132,7 @@ export class CdpBrowser extends BrowserBase {
|
|
|
132
132
|
#handleDevToolsAsPage = false;
|
|
133
133
|
#extensions = new Map<string, Extension>();
|
|
134
134
|
#version?: Deferred<Protocol.Browser.GetVersionResponse>;
|
|
135
|
+
#hasNetworkRestrictions = false;
|
|
135
136
|
|
|
136
137
|
constructor(
|
|
137
138
|
connection: Connection,
|
|
@@ -162,10 +163,12 @@ export class CdpBrowser extends BrowserBase {
|
|
|
162
163
|
});
|
|
163
164
|
this.#handleDevToolsAsPage = handleDevToolsAsPage;
|
|
164
165
|
this.#setIsPageTargetCallback(isPageTargetCallback);
|
|
165
|
-
|
|
166
|
+
this.#hasNetworkRestrictions = Boolean(
|
|
166
167
|
(blocklist && blocklist.length > 0) ||
|
|
167
168
|
(allowlist && allowlist.length > 0),
|
|
168
169
|
);
|
|
170
|
+
connection.rejectEmulateNetworkConditionsCalls =
|
|
171
|
+
this.#hasNetworkRestrictions;
|
|
169
172
|
this.#targetManager = new TargetManager(
|
|
170
173
|
connection,
|
|
171
174
|
this.#createTarget,
|
|
@@ -529,6 +532,11 @@ export class CdpBrowser extends BrowserBase {
|
|
|
529
532
|
}
|
|
530
533
|
|
|
531
534
|
override async installPWA(options: InstallPWAOptions): Promise<string> {
|
|
535
|
+
if (this.#hasNetworkRestrictions) {
|
|
536
|
+
throw new Error(
|
|
537
|
+
'PWA APIs are not supported when network restrictions are configured.',
|
|
538
|
+
);
|
|
539
|
+
}
|
|
532
540
|
await this.#connection.send('PWA.install', {
|
|
533
541
|
manifestId: options.manifestId,
|
|
534
542
|
installUrlOrBundleUrl: options.installUrlOrBundleUrl,
|
|
@@ -543,12 +551,22 @@ export class CdpBrowser extends BrowserBase {
|
|
|
543
551
|
}
|
|
544
552
|
|
|
545
553
|
override async uninstallPWA(options: UninstallPWAOptions): Promise<void> {
|
|
554
|
+
if (this.#hasNetworkRestrictions) {
|
|
555
|
+
throw new Error(
|
|
556
|
+
'PWA APIs are not supported when network restrictions are configured.',
|
|
557
|
+
);
|
|
558
|
+
}
|
|
546
559
|
await this.#connection.send('PWA.uninstall', {
|
|
547
560
|
manifestId: options.manifestId,
|
|
548
561
|
});
|
|
549
562
|
}
|
|
550
563
|
|
|
551
564
|
override async launchPWA(options: LaunchPWAOptions): Promise<Page> {
|
|
565
|
+
if (this.#hasNetworkRestrictions) {
|
|
566
|
+
throw new Error(
|
|
567
|
+
'PWA APIs are not supported when network restrictions are configured.',
|
|
568
|
+
);
|
|
569
|
+
}
|
|
552
570
|
// `PWA.launch` resolves with the id of the launched *tab* target (see the
|
|
553
571
|
// CDP `PWA.LaunchResponse` docs). Tab targets sit above page targets in the
|
|
554
572
|
// target hierarchy and are not exposed through `browser.targets()`, so the
|
|
@@ -582,6 +600,11 @@ export class CdpBrowser extends BrowserBase {
|
|
|
582
600
|
}
|
|
583
601
|
|
|
584
602
|
override async getPWAState(options: GetPWAStateOptions): Promise<PWAState> {
|
|
603
|
+
if (this.#hasNetworkRestrictions) {
|
|
604
|
+
throw new Error(
|
|
605
|
+
'PWA APIs are not supported when network restrictions are configured.',
|
|
606
|
+
);
|
|
607
|
+
}
|
|
585
608
|
const {badgeCount, fileHandlers} = await this.#connection.send(
|
|
586
609
|
'PWA.getOsAppState',
|
|
587
610
|
{manifestId: options.manifestId},
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from '../api/CDPSession.js';
|
|
16
16
|
import {CallbackRegistry} from '../common/CallbackRegistry.js';
|
|
17
17
|
import type {ConnectionTransport} from '../common/ConnectionTransport.js';
|
|
18
|
-
import {debug} from '../common/Debug.js';
|
|
18
|
+
import {debug, DEBUG_PREFIXES, type Logger} from '../common/Debug.js';
|
|
19
19
|
import {ConnectionClosedError, TargetCloseError} from '../common/Errors.js';
|
|
20
20
|
import {EventEmitter} from '../common/EventEmitter.js';
|
|
21
21
|
import {createProtocolErrorMessage} from '../util/ErrorLike.js';
|
|
@@ -26,9 +26,6 @@ import {
|
|
|
26
26
|
|
|
27
27
|
import {CdpCDPSession} from './CdpSession.js';
|
|
28
28
|
|
|
29
|
-
const debugProtocolSend = debug('puppeteer:protocol:SEND ►');
|
|
30
|
-
const debugProtocolReceive = debug('puppeteer:protocol:RECV ◀');
|
|
31
|
-
|
|
32
29
|
/**
|
|
33
30
|
* @public
|
|
34
31
|
*/
|
|
@@ -44,7 +41,12 @@ export class Connection extends EventEmitter<CDPSessionEvents> {
|
|
|
44
41
|
#callbacks: CallbackRegistry;
|
|
45
42
|
#rawErrors = false;
|
|
46
43
|
#idGenerator: GetIdFn;
|
|
44
|
+
#debugProtocolSend: ((...args: unknown[]) => void) | undefined;
|
|
45
|
+
#debugProtocolReceive: ((...args: unknown[]) => void) | undefined;
|
|
47
46
|
|
|
47
|
+
/**
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
48
50
|
constructor(
|
|
49
51
|
url: string,
|
|
50
52
|
transport: ConnectionTransport,
|
|
@@ -52,12 +54,15 @@ export class Connection extends EventEmitter<CDPSessionEvents> {
|
|
|
52
54
|
timeout?: number,
|
|
53
55
|
rawErrors = false,
|
|
54
56
|
idGenerator: () => number = createIncrementalIdGenerator(),
|
|
57
|
+
logger: Logger = debug,
|
|
55
58
|
) {
|
|
56
59
|
super();
|
|
57
60
|
this.#rawErrors = rawErrors;
|
|
58
61
|
this.#idGenerator = idGenerator;
|
|
59
62
|
this.#callbacks = new CallbackRegistry(idGenerator);
|
|
60
63
|
this.#url = url;
|
|
64
|
+
this.#debugProtocolSend = logger(DEBUG_PREFIXES.cdpSend);
|
|
65
|
+
this.#debugProtocolReceive = logger(DEBUG_PREFIXES.cdpReceive);
|
|
61
66
|
this.#delay = delay;
|
|
62
67
|
this.#timeout = timeout ?? 180_000;
|
|
63
68
|
|
|
@@ -176,7 +181,7 @@ export class Connection extends EventEmitter<CDPSessionEvents> {
|
|
|
176
181
|
id,
|
|
177
182
|
sessionId,
|
|
178
183
|
});
|
|
179
|
-
debugProtocolSend?.(stringifiedMessage);
|
|
184
|
+
this.#debugProtocolSend?.(stringifiedMessage);
|
|
180
185
|
this.#transport.send(stringifiedMessage);
|
|
181
186
|
}) as Promise<ProtocolMapping.Commands[T]['returnType']>;
|
|
182
187
|
}
|
|
@@ -197,7 +202,7 @@ export class Connection extends EventEmitter<CDPSessionEvents> {
|
|
|
197
202
|
return setTimeout(r, this.#delay);
|
|
198
203
|
});
|
|
199
204
|
}
|
|
200
|
-
debugProtocolReceive?.(message);
|
|
205
|
+
this.#debugProtocolReceive?.(message);
|
|
201
206
|
const object = JSON.parse(message);
|
|
202
207
|
if (object.method === 'Target.attachedToTarget') {
|
|
203
208
|
const sessionId = object.params.sessionId;
|
|
@@ -23,6 +23,8 @@ export class CdpDialog extends Dialog {
|
|
|
23
23
|
) {
|
|
24
24
|
super(type, message, defaultValue);
|
|
25
25
|
this.#client = client;
|
|
26
|
+
|
|
27
|
+
client.once('Page.javascriptDialogClosed', this.#onDialogClosed);
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
override async handle(options: {
|
|
@@ -33,5 +35,10 @@ export class CdpDialog extends Dialog {
|
|
|
33
35
|
accept: options.accept,
|
|
34
36
|
promptText: options.text,
|
|
35
37
|
});
|
|
38
|
+
this.#client.off('Page.javascriptDialogClosed', this.#onDialogClosed);
|
|
36
39
|
}
|
|
40
|
+
|
|
41
|
+
#onDialogClosed = () => {
|
|
42
|
+
this.handled = true;
|
|
43
|
+
};
|
|
37
44
|
}
|
|
@@ -85,6 +85,7 @@ export class NetworkManager extends EventEmitter<NetworkManagerEvents> {
|
|
|
85
85
|
#userAgentMetadata?: Protocol.Emulation.UserAgentMetadata;
|
|
86
86
|
#platform?: string;
|
|
87
87
|
#acceptLanguage?: string;
|
|
88
|
+
#userAgentOverrideApplied = false;
|
|
88
89
|
|
|
89
90
|
readonly #handlers = [
|
|
90
91
|
['Fetch.requestPaused', this.#onRequestPaused],
|
|
@@ -285,6 +286,15 @@ export class NetworkManager extends EventEmitter<NetworkManagerEvents> {
|
|
|
285
286
|
}
|
|
286
287
|
|
|
287
288
|
async #applyUserAgent(client: CDPSession) {
|
|
289
|
+
const nothingToEmulate =
|
|
290
|
+
this.#userAgent === undefined &&
|
|
291
|
+
this.#userAgentMetadata === undefined &&
|
|
292
|
+
this.#acceptLanguage === undefined &&
|
|
293
|
+
this.#platform === undefined;
|
|
294
|
+
// Still need to send once to reset a previously-applied override.
|
|
295
|
+
if (nothingToEmulate && !this.#userAgentOverrideApplied) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
288
298
|
const userAgent =
|
|
289
299
|
this.#userAgent ??
|
|
290
300
|
(await this.#frameManager.page().browser().userAgent());
|
|
@@ -298,6 +308,7 @@ export class NetworkManager extends EventEmitter<NetworkManagerEvents> {
|
|
|
298
308
|
userAgentMetadata: this.#userAgentMetadata,
|
|
299
309
|
platform: this.#platform,
|
|
300
310
|
});
|
|
311
|
+
this.#userAgentOverrideApplied = !nothingToEmulate;
|
|
301
312
|
} catch (error) {
|
|
302
313
|
if (this.#canIgnoreError(error)) {
|
|
303
314
|
return;
|
|
@@ -115,10 +115,10 @@ async function getConnectionTransport(
|
|
|
115
115
|
endpointUrl: browserWSEndpoint,
|
|
116
116
|
};
|
|
117
117
|
} else if (browserURL) {
|
|
118
|
-
const connectionURL = await getWSEndpoint(browserURL);
|
|
118
|
+
const connectionURL = await getWSEndpoint(browserURL, headers);
|
|
119
119
|
const WebSocketClass = await getWebSocketTransportClass();
|
|
120
120
|
const connectionTransport: ConnectionTransport =
|
|
121
|
-
await WebSocketClass.create(connectionURL);
|
|
121
|
+
await WebSocketClass.create(connectionURL, headers);
|
|
122
122
|
return {
|
|
123
123
|
connectionTransport: connectionTransport,
|
|
124
124
|
endpointUrl: connectionURL,
|
|
@@ -181,12 +181,16 @@ async function getConnectionTransport(
|
|
|
181
181
|
throw new Error('Invalid connection options');
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
async function getWSEndpoint(
|
|
184
|
+
async function getWSEndpoint(
|
|
185
|
+
browserURL: string,
|
|
186
|
+
headers?: Record<string, string>,
|
|
187
|
+
): Promise<string> {
|
|
185
188
|
const endpointURL = new URL('/json/version', browserURL);
|
|
186
189
|
|
|
187
190
|
try {
|
|
188
191
|
const result = await globalThis.fetch(endpointURL.toString(), {
|
|
189
192
|
method: 'GET',
|
|
193
|
+
headers,
|
|
190
194
|
});
|
|
191
195
|
if (!result.ok) {
|
|
192
196
|
throw new Error(`HTTP ${result.statusText}`);
|
|
@@ -9,6 +9,33 @@ import {isNode, environment} from '../environment.js';
|
|
|
9
9
|
declare global {
|
|
10
10
|
const __PUPPETEER_DEBUG: string;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export const DEBUG_PREFIXES = {
|
|
16
|
+
cdpSend: 'puppeteer:protocol:SEND ►',
|
|
17
|
+
cdpReceive: 'puppeteer:protocol:RECV ◀',
|
|
18
|
+
bidiSend: 'puppeteer:webDriverBiDi:SEND ►',
|
|
19
|
+
bidiReceive: 'puppeteer:webDriverBiDi:RECV ◀',
|
|
20
|
+
error: 'puppeteer:error',
|
|
21
|
+
ffmpeg: 'puppeteer:ffmpeg',
|
|
22
|
+
} as const;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
export type DebugPrefix = (typeof DEBUG_PREFIXES)[keyof typeof DEBUG_PREFIXES];
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @public
|
|
31
|
+
* @experimental
|
|
32
|
+
*/
|
|
33
|
+
export type LoggerFunction = (...args: unknown[]) => void;
|
|
34
|
+
/**
|
|
35
|
+
* @public
|
|
36
|
+
* @experimental
|
|
37
|
+
*/
|
|
38
|
+
export type Logger = (prefix: string) => LoggerFunction | undefined;
|
|
12
39
|
/**
|
|
13
40
|
* A debug function that can be used in any environment.
|
|
14
41
|
*
|
|
@@ -36,7 +63,7 @@ declare global {
|
|
|
36
63
|
* @example
|
|
37
64
|
*
|
|
38
65
|
* ```
|
|
39
|
-
* const log = debug(
|
|
66
|
+
* const log = debug(DEBUG_PREFIXES.error);
|
|
40
67
|
*
|
|
41
68
|
* log('new page created')
|
|
42
69
|
* // logs "Page: new page created"
|
|
@@ -47,9 +74,7 @@ declare global {
|
|
|
47
74
|
*
|
|
48
75
|
* @internal
|
|
49
76
|
*/
|
|
50
|
-
export const debug = (
|
|
51
|
-
prefix: string,
|
|
52
|
-
): ((...args: unknown[]) => void) | undefined => {
|
|
77
|
+
export const debug: Logger = (prefix): LoggerFunction | undefined => {
|
|
53
78
|
if (isNode) {
|
|
54
79
|
const nodeDebug = environment.value.debuglog?.(prefix);
|
|
55
80
|
if (!nodeDebug || !nodeDebug.enabled) {
|
|
@@ -60,7 +85,7 @@ export const debug = (
|
|
|
60
85
|
if (captureLogs) {
|
|
61
86
|
capturedLogs.push(prefix + logArgs);
|
|
62
87
|
}
|
|
63
|
-
(nodeDebug as
|
|
88
|
+
(nodeDebug as LoggerFunction)(...logArgs);
|
|
64
89
|
};
|
|
65
90
|
}
|
|
66
91
|
|
|
@@ -21,7 +21,7 @@ import {assert} from '../util/assert.js';
|
|
|
21
21
|
import {mergeUint8Arrays, stringToTypedArray} from '../util/encoding.js';
|
|
22
22
|
import {packageVersion} from '../util/version.js';
|
|
23
23
|
|
|
24
|
-
import {debug} from './Debug.js';
|
|
24
|
+
import {debug, DEBUG_PREFIXES} from './Debug.js';
|
|
25
25
|
import {TimeoutError} from './Errors.js';
|
|
26
26
|
import type {EventEmitter, EventType} from './EventEmitter.js';
|
|
27
27
|
import type {
|
|
@@ -34,7 +34,7 @@ import {paperFormats} from './PDFOptions.js';
|
|
|
34
34
|
/**
|
|
35
35
|
* @internal
|
|
36
36
|
*/
|
|
37
|
-
export const debugError = debug(
|
|
37
|
+
export const debugError = debug(DEBUG_PREFIXES.error);
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* @internal
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
import {CDPSessionEvent} from '../api/CDPSession.js';
|
|
27
27
|
import type {BoundingBox} from '../api/ElementHandle.js';
|
|
28
28
|
import type {Page, VideoFormat} from '../api/Page.js';
|
|
29
|
-
import {debug} from '../common/Debug.js';
|
|
29
|
+
import {debug, DEBUG_PREFIXES, type Logger} from '../common/Debug.js';
|
|
30
30
|
import {fromEmitterEvent, debugCatchError} from '../common/util.js';
|
|
31
31
|
import {guarded} from '../util/decorators.js';
|
|
32
32
|
import {asyncDisposeSymbol} from '../util/disposable.js';
|
|
@@ -34,8 +34,6 @@ import {asyncDisposeSymbol} from '../util/disposable.js';
|
|
|
34
34
|
const CRF_VALUE = 30;
|
|
35
35
|
const DEFAULT_FPS = 30;
|
|
36
36
|
|
|
37
|
-
const debugFfmpeg = debug('puppeteer:ffmpeg');
|
|
38
|
-
|
|
39
37
|
/**
|
|
40
38
|
* Computes how many encoder frames to emit for a captured frame that spans
|
|
41
39
|
* `[previousTimestamp, timestamp]`, so that the cumulative number of emitted
|
|
@@ -96,6 +94,7 @@ export class ScreenRecorder extends PassThrough {
|
|
|
96
94
|
#lastFrame: Promise<readonly [Buffer, number]>;
|
|
97
95
|
|
|
98
96
|
#fps: number;
|
|
97
|
+
#debugFfmpeg: ((...args: unknown[]) => void) | undefined;
|
|
99
98
|
|
|
100
99
|
/**
|
|
101
100
|
* @internal
|
|
@@ -118,9 +117,12 @@ export class ScreenRecorder extends PassThrough {
|
|
|
118
117
|
path,
|
|
119
118
|
overwrite,
|
|
120
119
|
}: ScreenRecorderOptions = {},
|
|
120
|
+
logger: Logger = debug,
|
|
121
121
|
) {
|
|
122
122
|
super({allowHalfOpen: false});
|
|
123
123
|
|
|
124
|
+
this.#debugFfmpeg = logger(DEBUG_PREFIXES.ffmpeg);
|
|
125
|
+
|
|
124
126
|
ffmpegPath ??= 'ffmpeg';
|
|
125
127
|
format ??= 'webm';
|
|
126
128
|
fps ??= DEFAULT_FPS;
|
|
@@ -216,7 +218,7 @@ export class ScreenRecorder extends PassThrough {
|
|
|
216
218
|
);
|
|
217
219
|
this.#process.stdout.pipe(this);
|
|
218
220
|
this.#process.stderr.on('data', (data: Buffer) => {
|
|
219
|
-
debugFfmpeg?.(data.toString('utf8'));
|
|
221
|
+
this.#debugFfmpeg?.(data.toString('utf8'));
|
|
220
222
|
});
|
|
221
223
|
|
|
222
224
|
this.#page = page;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
10
|
export const PUPPETEER_REVISIONS = Object.freeze({
|
|
11
|
-
chrome: '151.0.7922.
|
|
12
|
-
'chrome-headless-shell': '151.0.7922.
|
|
13
|
-
firefox: '
|
|
11
|
+
chrome: '151.0.7922.71',
|
|
12
|
+
'chrome-headless-shell': '151.0.7922.71',
|
|
13
|
+
firefox: 'stable_153.0.1',
|
|
14
14
|
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts
CHANGED
|
File without changes
|
package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.d.ts","sources":["../../../src/builder/builder.ts"],"names":[],"mappings":"AAIA,cACE,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,SAAS,uBACW;AAEtB;;;;;;;;;CASC,GACD,OAAO,cAAM;EAWX,gBAAgB,IAAI;EAKpB,WACE,MAAM,MAAM,EACZ,QAAQ,MAAM,EACd;IACE,OAAO,MAAM;IACb,OAAO,MAAM;IACb,eAAe,OAAO;IACtB,YAAY,MAAM;IAClB,MAAM;GACP,GACA,IAAI;EAsBP,aAAa,MAAM,MAAM,GAAG,IAAI;EAMhC,aAAa,MAAM,MAAM,GAAG,IAAI;EAMhC,mBAAmB,cAAc,OAAO,GAAG,IAAI;EAM/C,kBAAkB,WAAW,MAAM,EAAE,GAAG,IAAI;EAO5C,SAAS,MAAM,MAAM,EAAE,QAAQ,MAAM,GAAG,IAAI;EAgB5C;;GAEC,GACD,gBAAgB,gBAAgB,IAAI;EAIpC;;GAEC,GACD,aAAa,gBAAgB,IAAI;EAIjC;;;GAGC,GACD,WACE,MAAM,MAAM,EACZ,QAAQ,MAAM,EACd;IACE,QAAQ;IACR,WAAW;IACX,eAAe,OAAO;IACtB,WAAW,OAAO;IAClB,SAAS;IACT,WAAW;GACZ,GACA,IAAI;EA6BP,wBAAwB,OAAO,aAAa,GAAG,IAAI;EAMnD,2BAA2B,UAAU,QAAQ,GAAG,IAAI;EAMpD,mBAAmB,cAAc,OAAO,GAAG,IAAI;EAO/C,eAAe,UAAU,OAAO,GAAG,IAAI;EAOvC,eAAe,QAAQ,SAAS,GAAG,IAAI;EAOvC,iBAAiB,UAAU,gBAAgB,GAAG,IAAI;EAOlD,SAAS,MAAM,MAAM,EAAE,QAAQ,MAAM,GAAG,IAAI;EAe5C,SAAS;
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sources":["../../../src/builder/builder.ts"],"names":[],"mappings":"AAIA,cACE,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,SAAS,uBACW;AAEtB;;;;;;;;;CASC,GACD,OAAO,cAAM;EAWX,gBAAgB,IAAI;EAKpB,WACE,MAAM,MAAM,EACZ,QAAQ,MAAM,EACd;IACE,OAAO,MAAM;IACb,OAAO,MAAM;IACb,eAAe,OAAO;IACtB,YAAY,MAAM;IAClB,MAAM;GACP,GACA,IAAI;EAsBP,aAAa,MAAM,MAAM,GAAG,IAAI;EAMhC,aAAa,MAAM,MAAM,GAAG,IAAI;EAMhC,mBAAmB,cAAc,OAAO,GAAG,IAAI;EAM/C,kBAAkB,WAAW,MAAM,EAAE,GAAG,IAAI;EAO5C,SAAS,MAAM,MAAM,EAAE,QAAQ,MAAM,GAAG,IAAI;EAgB5C;;GAEC,GACD,gBAAgB,gBAAgB,IAAI;EAIpC;;GAEC,GACD,aAAa,gBAAgB,IAAI;EAIjC;;;GAGC,GACD,WACE,MAAM,MAAM,EACZ,QAAQ,MAAM,EACd;IACE,QAAQ;IACR,WAAW;IACX,eAAe,OAAO;IACtB,WAAW,OAAO;IAClB,SAAS;IACT,WAAW;GACZ,GACA,IAAI;EA6BP,wBAAwB,OAAO,aAAa,GAAG,IAAI;EAMnD,2BAA2B,UAAU,QAAQ,GAAG,IAAI;EAMpD,mBAAmB,cAAc,OAAO,GAAG,IAAI;EAO/C,eAAe,UAAU,OAAO,GAAG,IAAI;EAOvC,eAAe,QAAQ,SAAS,GAAG,IAAI;EAOvC,iBAAiB,UAAU,gBAAgB,GAAG,IAAI;EAOlD,SAAS,MAAM,MAAM,EAAE,QAAQ,MAAM,GAAG,IAAI;EAe5C,SAAS;EAYT,cAAc,cAAc,cAAc;EAI1C,cAAc,cAAc,cAAc;EAI1C,UAAU,aAAa,OAAO,aAAa,GAAG,OAAO;EAIrD,UAAU,gBAAgB,KAAK,QAAQ,GAAG,OAAO;EAIjD,UAAU,mBAAmB,KAAK,QAAQ,GAAG;AAG/C;AAEA;;;;;CAKC,GACD,YAAY,WAAW,OAAO"}
|
package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts.map
CHANGED
|
File without changes
|
|
File without changes
|
package/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts.map
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|