chrome-devtools-frontend 1.0.1650100 → 1.0.1650677
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/version-control/SKILL.md +5 -1
- package/config/typescript/tsconfig.base.json +1 -0
- package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
- package/front_end/core/host/UserMetrics.ts +0 -26
- package/front_end/core/sdk/CSSMetadata.ts +72 -0
- package/front_end/devtools_compatibility.js +1 -2
- package/front_end/foundation/Universe.ts +7 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +11 -1
- package/front_end/models/ai_assistance/README.md +4 -0
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +2 -0
- package/front_end/models/ai_assistance/agents/AiAgent.ts +3 -0
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +13 -4
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +3 -7
- package/front_end/models/ai_assistance/ai_assistance.ts +4 -0
- package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +2 -0
- package/front_end/models/ai_assistance/skills/accessibility.md +13 -0
- package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +54 -0
- package/front_end/models/ai_assistance/tools/ResolveLighthousePath.ts +124 -0
- package/front_end/models/ai_assistance/tools/Tool.ts +12 -2
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +4 -0
- package/front_end/models/persistence/NetworkPersistenceManager.ts +9 -1
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +3 -11
- package/front_end/panels/common/ExtensionServer.ts +70 -50
- package/front_end/panels/elements/ElementsPanel.ts +1 -1
- package/front_end/panels/js_timeline/js_timeline-meta.ts +1 -2
- package/front_end/panels/network/RequestConditionsDrawer.ts +236 -198
- package/front_end/panels/network/RequestHeadersView.ts +2 -2
- package/front_end/panels/network/components/RequestHeadersView.css +1 -0
- package/front_end/panels/network/components/ResponseHeaderSection.css +5 -1
- package/front_end/panels/network/requestConditionsDrawer.css +3 -0
- package/front_end/panels/recorder/testing/RecorderHelpers.ts +2 -0
- package/front_end/panels/timeline/timeline-meta.ts +1 -1
- package/front_end/panels/whats_new/ReleaseNoteText.ts +12 -6
- package/front_end/panels/whats_new/resources/WNDT.md +8 -7
- 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/README.md +14 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +60 -24
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +271 -164
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +2 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.js +11 -7
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.js +3 -10
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +9 -4
- 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 +4 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/WebWorker.d.ts +13 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/WebWorker.js +14 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js +5 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js +2 -2
- 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/Browser.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.js +5 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserContext.js +6 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts +1 -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 +3 -3
- 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/Deserializer.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Deserializer.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/ExposedFunction.js +6 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/ExposedFunction.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Realm.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js +11 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Accessibility.js +4 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Binding.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Binding.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 +13 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/BrowserConnector.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.js +2 -2
- 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/Coverage.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Coverage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ElementHandle.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/EmulationManager.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/EmulationManager.js +25 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/EmulationManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExecutionContext.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExecutionContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Extension.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Extension.js +9 -11
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Extension.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js +7 -7
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/JSHandle.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts +3 -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 +18 -10
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js +17 -11
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.js +28 -10
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js +10 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebWorker.d.ts +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebWorker.js +20 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js +11 -0
- 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/BrowserWebSocketTransport.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserWebSocketTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/CallbackRegistry.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Configuration.d.ts +4 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Configuration.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts +26 -13
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.d.ts +1 -6
- 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 +24 -33
- 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/EventEmitter.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts +8 -1
- 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 +8 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/environment.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/environment.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/environment.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/environment.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/TextContent.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/TextContent.js +15 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/TextContent.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +17 -16
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js +14 -9
- 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/FirefoxLauncher.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/FirefoxLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/PipeTransport.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/PipeTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts +20 -0
- 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 +38 -9
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node-env-setup.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node-env-setup.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node-env-setup.js +16 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node-env-setup.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/puppeteer-core.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/puppeteer-core.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/puppeteer-core.js +3 -8
- package/front_end/third_party/puppeteer/package/lib/puppeteer/puppeteer-core.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/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +60 -24
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +4 -8
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/api/HTTPRequest.ts +10 -10
- package/front_end/third_party/puppeteer/package/src/api/JSHandle.ts +3 -10
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +14 -8
- package/front_end/third_party/puppeteer/package/src/api/WebWorker.ts +30 -0
- package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +5 -5
- package/front_end/third_party/puppeteer/package/src/bidi/BidiOverCdp.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserConnector.ts +5 -3
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +6 -6
- package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +4 -4
- package/front_end/third_party/puppeteer/package/src/bidi/Deserializer.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/bidi/ExposedFunction.ts +6 -6
- package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +4 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Realm.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +11 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +6 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Binding.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +14 -2
- package/front_end/third_party/puppeteer/package/src/cdp/BrowserConnector.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/Connection.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/Coverage.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/ElementHandle.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/EmulationManager.ts +36 -4
- package/front_end/third_party/puppeteer/package/src/cdp/ExecutionContext.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/cdp/Extension.ts +16 -17
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +12 -7
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/JSHandle.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +22 -11
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +18 -10
- package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +37 -12
- package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +11 -9
- package/front_end/third_party/puppeteer/package/src/cdp/WebWorker.ts +33 -5
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +11 -0
- package/front_end/third_party/puppeteer/package/src/common/BrowserWebSocketTransport.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/common/CallbackRegistry.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/common/Configuration.ts +4 -2
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +26 -13
- package/front_end/third_party/puppeteer/package/src/common/Debug.ts +30 -40
- package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/common/util.ts +9 -1
- package/front_end/third_party/puppeteer/package/src/environment.ts +7 -3
- package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/injected/TextContent.ts +15 -5
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +23 -23
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +19 -13
- package/front_end/third_party/puppeteer/package/src/node/FirefoxLauncher.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/node/NodeWebSocketTransport.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/node/PipeTransport.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/node/ScreenRecorder.ts +44 -9
- package/front_end/third_party/puppeteer/package/src/node-env-setup.ts +18 -0
- package/front_end/third_party/puppeteer/package/src/puppeteer-core.ts +5 -9
- 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/puppeteer/puppeteer-tsconfig.json +1 -0
- package/front_end/third_party/third-party-web/lib/nostats-subset.js +21 -15
- package/front_end/third_party/third-party-web/package/README.md +619 -582
- package/front_end/third_party/third-party-web/package/dist/entities-httparchive-nostats.json +1 -1
- package/front_end/third_party/third-party-web/package/dist/entities-httparchive.json +1 -1
- package/front_end/third_party/third-party-web/package/dist/entities-nostats.json +1 -1
- package/front_end/third_party/third-party-web/package/dist/entities.json +1 -1
- package/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.js +27 -15
- package/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.test.js +14 -0
- package/front_end/third_party/third-party-web/package/lib/entities.test.js +10 -0
- package/front_end/third_party/third-party-web/package/lib/index.test.js +6 -6
- package/front_end/third_party/third-party-web/package/lib/markdown/template.md +1 -3
- package/front_end/third_party/third-party-web/package/package.json +7 -3
- package/front_end/third_party/third-party-web/package.json +1 -1
- package/front_end/tsconfig.json +1 -2
- package/front_end/ui/components/buttons/floatingButton.css +3 -3
- package/front_end/ui/components/lists/list.css +2 -0
- package/front_end/ui/legacy/ListWidget.ts +8 -5
- package/front_end/ui/legacy/TextPrompt.ts +5 -2
- package/front_end/ui/legacy/textPrompt.css +1 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/inspector_overlay/tsconfig.json +3 -10
- package/mcp/tsconfig.json +1 -5
- package/package.json +1 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
1
2
|
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
|
|
2
3
|
function _classPrivateGetter(s, r, a) { return a(_assertClassBrand(s, r)); }
|
|
3
4
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
4
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
5
5
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -2828,8 +2828,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
2828
2828
|
get fs() {
|
|
2829
2829
|
throw new Error('fs is not available in this environment');
|
|
2830
2830
|
},
|
|
2831
|
-
|
|
2832
|
-
|
|
2831
|
+
ScreenRecorder: class {
|
|
2832
|
+
constructor() {
|
|
2833
|
+
throw new Error('ScreenRecorder is not available in this environment');
|
|
2834
|
+
}
|
|
2833
2835
|
}
|
|
2834
2836
|
}
|
|
2835
2837
|
};
|
|
@@ -2922,7 +2924,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
2922
2924
|
*/
|
|
2923
2925
|
// If moved update release-please config
|
|
2924
2926
|
// x-release-please-start-version
|
|
2925
|
-
const packageVersion = '25.1
|
|
2927
|
+
const packageVersion = '25.2.1';
|
|
2926
2928
|
// x-release-please-end
|
|
2927
2929
|
|
|
2928
2930
|
/**
|
|
@@ -2930,19 +2932,6 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
2930
2932
|
* Copyright 2020 Google Inc.
|
|
2931
2933
|
* SPDX-License-Identifier: Apache-2.0
|
|
2932
2934
|
*/
|
|
2933
|
-
/**
|
|
2934
|
-
* @internal
|
|
2935
|
-
*/
|
|
2936
|
-
let debugModule = null;
|
|
2937
|
-
/**
|
|
2938
|
-
* @internal
|
|
2939
|
-
*/
|
|
2940
|
-
async function importDebug() {
|
|
2941
|
-
if (!debugModule) {
|
|
2942
|
-
debugModule = (await Promise.resolve().then(() => _interopRequireWildcard(require('node:util')))).debuglog;
|
|
2943
|
-
}
|
|
2944
|
-
return debugModule;
|
|
2945
|
-
}
|
|
2946
2935
|
/**
|
|
2947
2936
|
* A debug function that can be used in any environment.
|
|
2948
2937
|
*
|
|
@@ -2983,29 +2972,33 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
2983
2972
|
*/
|
|
2984
2973
|
const debug = prefix => {
|
|
2985
2974
|
if (isNode) {
|
|
2986
|
-
|
|
2975
|
+
const nodeDebug = environment.value.debuglog?.(prefix);
|
|
2976
|
+
if (!nodeDebug || !nodeDebug.enabled) {
|
|
2977
|
+
return;
|
|
2978
|
+
}
|
|
2979
|
+
return (...logArgs) => {
|
|
2987
2980
|
if (captureLogs) {
|
|
2988
2981
|
capturedLogs.push(prefix + logArgs);
|
|
2989
2982
|
}
|
|
2990
|
-
(
|
|
2983
|
+
nodeDebug(...logArgs);
|
|
2991
2984
|
};
|
|
2992
2985
|
}
|
|
2986
|
+
const debugLevel = globalThis.__PUPPETEER_DEBUG;
|
|
2987
|
+
if (!debugLevel) {
|
|
2988
|
+
return;
|
|
2989
|
+
}
|
|
2990
|
+
const everythingShouldBeLogged = debugLevel === '*';
|
|
2991
|
+
const prefixMatchesDebugLevel = everythingShouldBeLogged || (
|
|
2992
|
+
/**
|
|
2993
|
+
* If the debug level is `foo*`, that means we match any prefix that
|
|
2994
|
+
* starts with `foo`. If the level is `foo`, we match only the prefix
|
|
2995
|
+
* `foo`.
|
|
2996
|
+
*/
|
|
2997
|
+
debugLevel.endsWith('*') ? prefix.startsWith(debugLevel.slice(0, -1)) : prefix === debugLevel);
|
|
2998
|
+
if (!prefixMatchesDebugLevel) {
|
|
2999
|
+
return;
|
|
3000
|
+
}
|
|
2993
3001
|
return (...logArgs) => {
|
|
2994
|
-
const debugLevel = globalThis.__PUPPETEER_DEBUG;
|
|
2995
|
-
if (!debugLevel) {
|
|
2996
|
-
return;
|
|
2997
|
-
}
|
|
2998
|
-
const everythingShouldBeLogged = debugLevel === '*';
|
|
2999
|
-
const prefixMatchesDebugLevel = everythingShouldBeLogged || (
|
|
3000
|
-
/**
|
|
3001
|
-
* If the debug level is `foo*`, that means we match any prefix that
|
|
3002
|
-
* starts with `foo`. If the level is `foo`, we match only the prefix
|
|
3003
|
-
* `foo`.
|
|
3004
|
-
*/
|
|
3005
|
-
debugLevel.endsWith('*') ? prefix.startsWith(debugLevel) : prefix === debugLevel);
|
|
3006
|
-
if (!prefixMatchesDebugLevel) {
|
|
3007
|
-
return;
|
|
3008
|
-
}
|
|
3009
3002
|
console.log(`${prefix}:`, ...logArgs);
|
|
3010
3003
|
};
|
|
3011
3004
|
};
|
|
@@ -3258,6 +3251,13 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
3258
3251
|
* @internal
|
|
3259
3252
|
*/
|
|
3260
3253
|
const debugError = debug('puppeteer:error');
|
|
3254
|
+
/**
|
|
3255
|
+
* @internal
|
|
3256
|
+
*
|
|
3257
|
+
* Use this instead of debugError so the catch functions
|
|
3258
|
+
* don't re-throw the error.
|
|
3259
|
+
*/
|
|
3260
|
+
const debugCatchError = debugError ?? (() => {});
|
|
3261
3261
|
/**
|
|
3262
3262
|
* @internal
|
|
3263
3263
|
*/
|
|
@@ -3428,7 +3428,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
3428
3428
|
}
|
|
3429
3429
|
return concat;
|
|
3430
3430
|
} catch (error) {
|
|
3431
|
-
debugError(error);
|
|
3431
|
+
debugError?.(error);
|
|
3432
3432
|
return null;
|
|
3433
3433
|
}
|
|
3434
3434
|
}
|
|
@@ -3738,7 +3738,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
3738
3738
|
* @internal
|
|
3739
3739
|
*/
|
|
3740
3740
|
[disposeSymbol]() {
|
|
3741
|
-
return void this[asyncDisposeSymbol]().catch(
|
|
3741
|
+
return void this[asyncDisposeSymbol]().catch(debugCatchError);
|
|
3742
3742
|
}
|
|
3743
3743
|
/**
|
|
3744
3744
|
* @internal
|
|
@@ -3915,7 +3915,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
3915
3915
|
}
|
|
3916
3916
|
/** @internal */
|
|
3917
3917
|
[disposeSymbol]() {
|
|
3918
|
-
return void this[asyncDisposeSymbol]().catch(
|
|
3918
|
+
return void this[asyncDisposeSymbol]().catch(debugCatchError);
|
|
3919
3919
|
}
|
|
3920
3920
|
/** @internal */
|
|
3921
3921
|
async [asyncDisposeSymbol]() {
|
|
@@ -4266,7 +4266,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
4266
4266
|
}
|
|
4267
4267
|
/** @internal */
|
|
4268
4268
|
[disposeSymbol]() {
|
|
4269
|
-
return void this[asyncDisposeSymbol]().catch(
|
|
4269
|
+
return void this[asyncDisposeSymbol]().catch(debugCatchError);
|
|
4270
4270
|
}
|
|
4271
4271
|
/** @internal */
|
|
4272
4272
|
async [asyncDisposeSymbol]() {
|
|
@@ -5127,7 +5127,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
5127
5127
|
}) => {
|
|
5128
5128
|
return cssQuerySelectorAll(element, selector);
|
|
5129
5129
|
});
|
|
5130
|
-
const source = "\"use strict\";var N=Object.defineProperty;var
|
|
5130
|
+
const source = "\"use strict\";var N=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var G=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var r in e)N(t,r,{get:e[r],enumerable:!0})},J=(t,e,r,o)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let n of Y(e))!G.call(t,n)&&n!==r&&N(t,n,{get:()=>e[n],enumerable:!(o=B(e,n))||o.enumerable});return t};var z=t=>J(N({},\"__esModule\",{value:!0}),t);var ye={};l(ye,{default:()=>pe});module.exports=z(ye);var b=class extends Error{constructor(e,r){super(e,r),this.name=this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},p=class extends b{};var c=class t{static create(e){return new t(e)}static async race(e){let r=new Set;try{let o=e.map(n=>n instanceof t?(n.#n&&r.add(n),n.valueOrThrow()):n);return await Promise.race(o)}finally{for(let o of r)o.reject(new Error(\"Timeout cleared\"))}}#e=!1;#r=!1;#o;#t;#a=new Promise(e=>{this.#t=e});#n;#i;constructor(e){e&&e.timeout>0&&(this.#i=new p(e.message),this.#n=setTimeout(()=>{this.reject(this.#i)},e.timeout))}#l(e){clearTimeout(this.#n),this.#o=e,this.#t()}resolve(e){this.#r||this.#e||(this.#e=!0,this.#l(e))}reject(e){this.#r||this.#e||(this.#r=!0,this.#l(e))}resolved(){return this.#e}finished(){return this.#e||this.#r}value(){return this.#o}#s;valueOrThrow(){return this.#s||(this.#s=(async()=>{if(await this.#a,this.#r)throw this.#o;return this.#o})()),this.#s}};var W=new Map,j=t=>{let e=W.get(t);return e||(e=new Function(`return ${t}`)(),W.set(t,e),e)};var v={};l(v,{ariaQuerySelector:()=>K,ariaQuerySelectorAll:()=>x});var K=(t,e)=>globalThis.__ariaQuerySelector(t,e),x=async function*(t,e){yield*await globalThis.__ariaQuerySelectorAll(t,e)};var E={};l(E,{cssQuerySelector:()=>Z,cssQuerySelectorAll:()=>ee});var Z=(t,e)=>t.querySelector(e),ee=function(t,e){return t.querySelectorAll(e)};var A={};l(A,{CustomQuerySelectorRegistry:()=>y,customQuerySelectors:()=>P});var y=class{#e=new Map;register(e,r){if(!r.queryOne&&r.queryAll){let o=r.queryAll;r.queryOne=(n,i)=>{for(let s of o(n,i))return s;return null}}else if(r.queryOne&&!r.queryAll){let o=r.queryOne;r.queryAll=(n,i)=>{let s=o(n,i);return s?[s]:[]}}else if(!r.queryOne||!r.queryAll)throw new Error(\"At least one query method must be defined.\");this.#e.set(e,{querySelector:r.queryOne,querySelectorAll:r.queryAll})}unregister(e){this.#e.delete(e)}get(e){return this.#e.get(e)}clear(){this.#e.clear()}},P=new y;var R={};l(R,{pierceQuerySelector:()=>te,pierceQuerySelectorAll:()=>re});var te=(t,e)=>{let r=null,o=n=>{let i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT);do{let s=i.currentNode;s.shadowRoot&&o(s.shadowRoot),!(s instanceof ShadowRoot)&&s!==n&&!r&&s.matches(e)&&(r=s)}while(!r&&i.nextNode())};return t instanceof Document&&(t=t.documentElement),o(t),r},re=(t,e)=>{let r=[],o=n=>{let i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT);do{let s=i.currentNode;s.shadowRoot&&o(s.shadowRoot),!(s instanceof ShadowRoot)&&s!==n&&s.matches(e)&&r.push(s)}while(i.nextNode())};return t instanceof Document&&(t=t.documentElement),o(t),r};var u=(t,e)=>{if(!t)throw new Error(e)};var w=class{#e;#r;#o;#t;constructor(e,r){this.#e=e,this.#r=r}async start(){let e=this.#t=c.create(),r=await this.#e();if(r){e.resolve(r);return}this.#o=new MutationObserver(async()=>{let o=await this.#e();o&&(e.resolve(o),await this.stop())}),this.#o.observe(this.#r,{childList:!0,subtree:!0,attributes:!0})}async stop(){u(this.#t,\"Polling never started.\"),this.#t.finished()||this.#t.reject(new Error(\"Polling stopped\")),this.#o&&(this.#o.disconnect(),this.#o=void 0)}result(){return u(this.#t,\"Polling never started.\"),this.#t.valueOrThrow()}},T=class{#e;#r;constructor(e){this.#e=e}async start(){let e=this.#r=c.create(),r=await this.#e();if(r){e.resolve(r);return}let o=async()=>{if(e.finished())return;let n=await this.#e();if(!n){window.requestAnimationFrame(o);return}e.resolve(n),await this.stop()};window.requestAnimationFrame(o)}async stop(){u(this.#r,\"Polling never started.\"),this.#r.finished()||this.#r.reject(new Error(\"Polling stopped\"))}result(){return u(this.#r,\"Polling never started.\"),this.#r.valueOrThrow()}},S=class{#e;#r;#o;#t;constructor(e,r){this.#e=e,this.#r=r}async start(){let e=this.#t=c.create(),r=await this.#e();if(r){e.resolve(r);return}this.#o=setInterval(async()=>{let o=await this.#e();o&&(e.resolve(o),await this.stop())},this.#r)}async stop(){u(this.#t,\"Polling never started.\"),this.#t.finished()||this.#t.reject(new Error(\"Polling stopped\")),this.#o&&(clearInterval(this.#o),this.#o=void 0)}result(){return u(this.#t,\"Polling never started.\"),this.#t.valueOrThrow()}};var L={};l(L,{PCombinator:()=>U,pQuerySelector:()=>me,pQuerySelectorAll:()=>X});var a=class{static async*map(e,r){for await(let o of e)yield await r(o)}static async*flatMap(e,r){for await(let o of e)yield*r(o)}static async collect(e){let r=[];for await(let o of e)r.push(o);return r}static async first(e){for await(let r of e)return r}};var O={};l(O,{textQuerySelectorAll:()=>m});var oe=new Set([\"checkbox\",\"image\",\"radio\"]),ne=t=>t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&!oe.has(t.type),se=new Set([\"SCRIPT\",\"STYLE\"]),f=t=>!se.has(t.nodeName)&&!document.head?.contains(t),C=new WeakMap,V=t=>{for(;t;)C.delete(t),t instanceof ShadowRoot?t=t.host:t=t.parentNode},F=new WeakSet,I,ie=()=>{let t=globalThis.MutationObserver;if(!t)throw new Error(\"MutationObserver is not available in this environment.\");return I||(I=new t(e=>{for(let r of e)V(r.target)})),I},d=t=>{let e=C.get(t);if(e||(e={full:\"\",immediate:[]},!f(t)))return e;let r=\"\";if(ne(t))e.full=t.value,e.immediate.push(t.value),t.addEventListener(\"input\",o=>{V(o.target)},{once:!0,capture:!0});else{for(let o=t.firstChild;o;o=o.nextSibling){if(o.nodeType===Node.TEXT_NODE){e.full+=o.nodeValue??\"\",r+=o.nodeValue??\"\";continue}r&&e.immediate.push(r),r=\"\",o.nodeType===Node.ELEMENT_NODE&&(e.full+=d(o).full)}r&&e.immediate.push(r),t instanceof Element&&t.shadowRoot&&(e.full+=d(t.shadowRoot).full),F.has(t)||(ie().observe(t,{childList:!0,characterData:!0,subtree:!0}),F.add(t))}return C.set(t,e),e};var m=function*(t,e){let r=!1;for(let o of t.childNodes)if(o instanceof Element&&f(o)){let n;o.shadowRoot?n=m(o.shadowRoot,e):n=m(o,e);for(let i of n)yield i,r=!0}r||t instanceof Element&&f(t)&&d(t).full.includes(e)&&(yield t)};var M={};l(M,{checkVisibility:()=>ae,pierce:()=>g,pierceAll:()=>k});var le=[\"hidden\",\"collapse\"],ae=(t,e)=>{if(!t)return e===!1;if(e===void 0)return t;let r=t.nodeType===Node.TEXT_NODE?t.parentElement:t,o=window.getComputedStyle(r),n=o&&!le.includes(o.visibility)&&!ce(r);return e===n?t:!1};function ce(t){let e=t.getBoundingClientRect();return e.width===0||e.height===0}var ue=t=>\"shadowRoot\"in t&&t.shadowRoot instanceof ShadowRoot;function*g(t){ue(t)?yield t.shadowRoot:yield t}function*k(t){t=g(t).next().value,yield t;let e=[document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT)];for(let r of e){let o;for(;o=r.nextNode();)o.shadowRoot&&(yield o.shadowRoot,e.push(document.createTreeWalker(o.shadowRoot,NodeFilter.SHOW_ELEMENT)))}}var D={};l(D,{xpathQuerySelectorAll:()=>q});var q=function*(t,e,r=-1){let n=(t.ownerDocument||document).evaluate(e,t,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE),i=[],s;for(;(s=n.iterateNext())&&(i.push(s),!(r&&i.length===r)););for(let h=0;h<i.length;h++)s=i[h],yield s,i[h]=null};var de=/[-\\w\\P{ASCII}*]/u,U=(r=>(r.Descendent=\">>>\",r.Child=\">>>>\",r))(U||{}),H=t=>\"querySelectorAll\"in t,Q=class{#e;#r=[];#o=void 0;elements;constructor(e,r){this.elements=[e],this.#e=r,this.#t()}async run(){for(typeof this.#o==\"string\"&&this.#o.trimStart()===\":scope\"&&this.#t();this.#o!==void 0;this.#t()){let e=this.#o;typeof e==\"string\"?e[0]&&de.test(e[0])?this.elements=a.flatMap(this.elements,async function*(r){H(r)&&(yield*r.querySelectorAll(e))}):this.elements=a.flatMap(this.elements,async function*(r){if(!r.parentElement){if(!H(r))return;yield*r.querySelectorAll(e);return}let o=0;for(let n of r.parentElement.children)if(++o,n===r)break;yield*r.parentElement.querySelectorAll(`:scope>:nth-child(${o})${e}`)}):this.elements=a.flatMap(this.elements,async function*(r){switch(e.name){case\"text\":yield*m(r,e.value);break;case\"xpath\":yield*q(r,e.value);break;case\"aria\":yield*x(r,e.value);break;default:let o=P.get(e.name);if(!o)throw new Error(`Unknown selector type: ${e.name}`);yield*o.querySelectorAll(r,e.value)}})}}#t(){if(this.#r.length!==0){this.#o=this.#r.shift();return}if(this.#e.length===0){this.#o=void 0;return}let e=this.#e.shift();switch(e){case\">>>>\":{this.elements=a.flatMap(this.elements,g),this.#t();break}case\">>>\":{this.elements=a.flatMap(this.elements,k),this.#t();break}default:this.#r=e,this.#t();break}}},_=class{#e=new WeakMap;calculate(e,r=[]){if(e===null)return r;e instanceof ShadowRoot&&(e=e.host);let o=this.#e.get(e);if(o)return[...o,...r];let n=0;for(let s=e.previousSibling;s;s=s.previousSibling)++n;let i=this.calculate(e.parentNode,[n]);return this.#e.set(e,i),[...i,...r]}},$=(t,e)=>{if(t.length+e.length===0)return 0;let[r=-1,...o]=t,[n=-1,...i]=e;return r===n?$(o,i):r<n?-1:1},fe=async function*(t){let e=new Set;for await(let o of t)e.add(o);let r=new _;yield*[...e.values()].map(o=>[o,r.calculate(o)]).sort(([,o],[,n])=>$(o,n)).map(([o])=>o)},X=function(t,e){let r=JSON.parse(e);if(r.some(o=>{let n=0;return o.some(i=>(typeof i==\"string\"?++n:n=0,n>1))}))throw new Error(\"Multiple deep combinators found in sequence.\");return fe(a.flatMap(r,o=>{let n=new Q(t,o);return n.run(),n.elements}))},me=async function(t,e){for await(let r of X(t,e))return r;return null};var he=Object.freeze({...v,...A,...R,...L,...O,...M,...D,...E,Deferred:c,createFunction:j,createTextContent:d,IntervalPoller:S,isSuitableNodeForTextMatching:f,MutationPoller:w,RAFPoller:T}),pe=he;\n";
|
|
5131
5131
|
|
|
5132
5132
|
/**
|
|
5133
5133
|
* @license
|
|
@@ -6098,14 +6098,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
6098
6098
|
*/
|
|
6099
6099
|
async getProperties() {
|
|
6100
6100
|
const propertyNames = await this.evaluate(object => {
|
|
6101
|
-
|
|
6102
|
-
const descriptors = Object.getOwnPropertyDescriptors(object);
|
|
6103
|
-
for (const propertyName in descriptors) {
|
|
6104
|
-
if (descriptors[propertyName]?.enumerable) {
|
|
6105
|
-
enumerableProperties.push(propertyName);
|
|
6106
|
-
}
|
|
6107
|
-
}
|
|
6108
|
-
return enumerableProperties;
|
|
6101
|
+
return Object.keys(object ?? {});
|
|
6109
6102
|
});
|
|
6110
6103
|
const map = new Map();
|
|
6111
6104
|
const results = await Promise.all(propertyNames.map(key => {
|
|
@@ -6133,7 +6126,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
6133
6126
|
}
|
|
6134
6127
|
/** @internal */
|
|
6135
6128
|
[_ref]() {
|
|
6136
|
-
return void this[asyncDisposeSymbol]().catch(
|
|
6129
|
+
return void this[asyncDisposeSymbol]().catch(debugCatchError);
|
|
6137
6130
|
}
|
|
6138
6131
|
/** @internal */
|
|
6139
6132
|
[asyncDisposeSymbol]() {
|
|
@@ -6598,7 +6591,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
6598
6591
|
return this.emit(exports.LocatorEvent.Action, undefined);
|
|
6599
6592
|
}), mergeMap(handle => {
|
|
6600
6593
|
return from(handle.click(options)).pipe(catchError(err => {
|
|
6601
|
-
void handle.dispose().catch(
|
|
6594
|
+
void handle.dispose().catch(debugCatchError);
|
|
6602
6595
|
throw err;
|
|
6603
6596
|
}));
|
|
6604
6597
|
}), this.operators.retryAndRaceWithSignalAndTimer(signal, cause));
|
|
@@ -6730,7 +6723,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
6730
6723
|
throw new Error(`Element cannot be filled out.`);
|
|
6731
6724
|
}
|
|
6732
6725
|
})).pipe(catchError(err => {
|
|
6733
|
-
void handle.dispose().catch(
|
|
6726
|
+
void handle.dispose().catch(debugCatchError);
|
|
6734
6727
|
throw err;
|
|
6735
6728
|
}));
|
|
6736
6729
|
}), this.operators.retryAndRaceWithSignalAndTimer(signal, cause));
|
|
@@ -6742,7 +6735,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
6742
6735
|
return this.emit(exports.LocatorEvent.Action, undefined);
|
|
6743
6736
|
}), mergeMap(handle => {
|
|
6744
6737
|
return from(handle.hover()).pipe(catchError(err => {
|
|
6745
|
-
void handle.dispose().catch(
|
|
6738
|
+
void handle.dispose().catch(debugCatchError);
|
|
6746
6739
|
throw err;
|
|
6747
6740
|
}));
|
|
6748
6741
|
}), this.operators.retryAndRaceWithSignalAndTimer(signal, cause));
|
|
@@ -6761,7 +6754,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
6761
6754
|
el.scrollLeft = scrollLeft;
|
|
6762
6755
|
}
|
|
6763
6756
|
}, options?.scrollTop, options?.scrollLeft)).pipe(catchError(err => {
|
|
6764
|
-
void handle.dispose().catch(
|
|
6757
|
+
void handle.dispose().catch(debugCatchError);
|
|
6765
6758
|
throw err;
|
|
6766
6759
|
}));
|
|
6767
6760
|
}), this.operators.retryAndRaceWithSignalAndTimer(signal, cause));
|
|
@@ -10361,16 +10354,22 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
10361
10354
|
*/
|
|
10362
10355
|
function headersArray(headers) {
|
|
10363
10356
|
const result = [];
|
|
10364
|
-
for (const name
|
|
10357
|
+
for (const name of Object.keys(headers)) {
|
|
10365
10358
|
const value = headers[name];
|
|
10366
|
-
if (
|
|
10367
|
-
|
|
10368
|
-
|
|
10369
|
-
|
|
10359
|
+
if (value !== undefined) {
|
|
10360
|
+
if (Array.isArray(value)) {
|
|
10361
|
+
for (const v of value) {
|
|
10362
|
+
result.push({
|
|
10363
|
+
name,
|
|
10364
|
+
value: v + ''
|
|
10365
|
+
});
|
|
10366
|
+
}
|
|
10367
|
+
} else {
|
|
10368
|
+
result.push({
|
|
10370
10369
|
name,
|
|
10371
10370
|
value: value + ''
|
|
10372
|
-
};
|
|
10373
|
-
}
|
|
10371
|
+
});
|
|
10372
|
+
}
|
|
10374
10373
|
}
|
|
10375
10374
|
}
|
|
10376
10375
|
return result;
|
|
@@ -10477,7 +10476,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
10477
10476
|
// In certain cases, protocol will return error if the request was
|
|
10478
10477
|
// already canceled or the page was closed. We should tolerate these
|
|
10479
10478
|
// errors.
|
|
10480
|
-
debugError(error);
|
|
10479
|
+
debugError?.(error);
|
|
10481
10480
|
}
|
|
10482
10481
|
|
|
10483
10482
|
/**
|
|
@@ -11869,7 +11868,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
11869
11868
|
...scrollDimensions
|
|
11870
11869
|
});
|
|
11871
11870
|
stack.defer(async () => {
|
|
11872
|
-
await this.setViewport(viewport).catch(
|
|
11871
|
+
await this.setViewport(viewport).catch(debugCatchError);
|
|
11873
11872
|
});
|
|
11874
11873
|
}
|
|
11875
11874
|
} else {
|
|
@@ -12245,7 +12244,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
12245
12244
|
}
|
|
12246
12245
|
/** @internal */
|
|
12247
12246
|
[_ref2]() {
|
|
12248
|
-
return void this[asyncDisposeSymbol]().catch(
|
|
12247
|
+
return void this[asyncDisposeSymbol]().catch(debugCatchError);
|
|
12249
12248
|
}
|
|
12250
12249
|
/** @internal */
|
|
12251
12250
|
async [asyncDisposeSymbol]() {
|
|
@@ -12287,7 +12286,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
12287
12286
|
deviceScaleFactor: 0
|
|
12288
12287
|
});
|
|
12289
12288
|
stack.defer(() => {
|
|
12290
|
-
void this.setViewport(viewport).catch(
|
|
12289
|
+
void this.setViewport(viewport).catch(debugCatchError);
|
|
12291
12290
|
});
|
|
12292
12291
|
}
|
|
12293
12292
|
return await this.mainFrame().isolatedRealm().evaluate(() => {
|
|
@@ -12791,6 +12790,20 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
12791
12790
|
func = withSourcePuppeteerURLIfNone(this.evaluateHandle.name, func);
|
|
12792
12791
|
return await this.mainRealm().evaluateHandle(func, ...args);
|
|
12793
12792
|
}
|
|
12793
|
+
/**
|
|
12794
|
+
* Waits for the provided function, `workerFunction`, to return a truthy value when
|
|
12795
|
+
* evaluated in the page's context.
|
|
12796
|
+
*
|
|
12797
|
+
* @param workerFunction - Function to be evaluated in browser context until it
|
|
12798
|
+
* returns a truthy value.
|
|
12799
|
+
* @param options - Options for configuring waiting behavior.
|
|
12800
|
+
*/
|
|
12801
|
+
waitForFunction(workerFunction, options = {}, ...args) {
|
|
12802
|
+
return this.mainRealm().waitForFunction(workerFunction, {
|
|
12803
|
+
polling: 100,
|
|
12804
|
+
...options
|
|
12805
|
+
}, ...args);
|
|
12806
|
+
}
|
|
12794
12807
|
async close() {
|
|
12795
12808
|
throw new UnsupportedOperation('WebWorker.close() is not supported');
|
|
12796
12809
|
}
|
|
@@ -12984,7 +12997,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
12984
12997
|
root.iframeSnapshot = iframeSnapshot ?? undefined;
|
|
12985
12998
|
} catch (error) {
|
|
12986
12999
|
// Frames can get detached at any time resulting in errors.
|
|
12987
|
-
debugError(error);
|
|
13000
|
+
debugError?.(error);
|
|
12988
13001
|
}
|
|
12989
13002
|
} catch (e_1) {
|
|
12990
13003
|
env_1.error = e_1;
|
|
@@ -12993,9 +13006,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
12993
13006
|
__disposeResources$4(env_1);
|
|
12994
13007
|
}
|
|
12995
13008
|
}
|
|
12996
|
-
|
|
12997
|
-
|
|
12998
|
-
}
|
|
13009
|
+
await Promise.all(root.children.map(child => {
|
|
13010
|
+
return populateIframes(child);
|
|
13011
|
+
}));
|
|
12999
13012
|
};
|
|
13000
13013
|
let needle = defaultRoot;
|
|
13001
13014
|
if (!defaultRoot) {
|
|
@@ -13532,14 +13545,14 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
13532
13545
|
const callbacks = globalThis[name].callbacks;
|
|
13533
13546
|
callbacks.get(seq).reject(error);
|
|
13534
13547
|
callbacks.delete(seq);
|
|
13535
|
-
}, _classPrivateFieldGet(_name3, this), id, error.message, error.stack).catch(
|
|
13548
|
+
}, _classPrivateFieldGet(_name3, this), id, error.message, error.stack).catch(debugCatchError);
|
|
13536
13549
|
} else {
|
|
13537
13550
|
await context.evaluate((name, seq, error) => {
|
|
13538
13551
|
// @ts-expect-error Code is evaluated in a different context.
|
|
13539
13552
|
const callbacks = globalThis[name].callbacks;
|
|
13540
13553
|
callbacks.get(seq).reject(error);
|
|
13541
13554
|
callbacks.delete(seq);
|
|
13542
|
-
}, _classPrivateFieldGet(_name3, this), id, error).catch(
|
|
13555
|
+
}, _classPrivateFieldGet(_name3, this), id, error).catch(debugCatchError);
|
|
13543
13556
|
}
|
|
13544
13557
|
}
|
|
13545
13558
|
}
|
|
@@ -13787,7 +13800,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
13787
13800
|
} catch (error) {
|
|
13788
13801
|
// We still throw sync errors synchronously and clean up the scheduled
|
|
13789
13802
|
// callback.
|
|
13790
|
-
callback.promise.catch(
|
|
13803
|
+
void callback.promise.catch(debugCatchError).finally(() => {
|
|
13791
13804
|
_classPrivateFieldGet(_callbacks, this).delete(callback.id);
|
|
13792
13805
|
});
|
|
13793
13806
|
callback.reject(error);
|
|
@@ -14164,7 +14177,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
14164
14177
|
id,
|
|
14165
14178
|
sessionId
|
|
14166
14179
|
});
|
|
14167
|
-
debugProtocolSend(stringifiedMessage);
|
|
14180
|
+
debugProtocolSend?.(stringifiedMessage);
|
|
14168
14181
|
_classPrivateFieldGet(_transport, this).send(stringifiedMessage);
|
|
14169
14182
|
});
|
|
14170
14183
|
}
|
|
@@ -14183,7 +14196,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
14183
14196
|
return setTimeout(r, _classPrivateFieldGet(_delay2, this));
|
|
14184
14197
|
});
|
|
14185
14198
|
}
|
|
14186
|
-
debugProtocolReceive(message);
|
|
14199
|
+
debugProtocolReceive?.(message);
|
|
14187
14200
|
const object = JSON.parse(message);
|
|
14188
14201
|
if (object.method === 'Target.attachedToTarget') {
|
|
14189
14202
|
const sessionId = object.params.sessionId;
|
|
@@ -14537,7 +14550,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
14537
14550
|
_classPrivateFieldGet(_scriptSources, this).set(event.scriptId, response.scriptSource);
|
|
14538
14551
|
} catch (error) {
|
|
14539
14552
|
// This might happen if the page has already navigated away.
|
|
14540
|
-
debugError(error);
|
|
14553
|
+
debugError?.(error);
|
|
14541
14554
|
}
|
|
14542
14555
|
}
|
|
14543
14556
|
var _client3 = /*#__PURE__*/new WeakMap();
|
|
@@ -14636,7 +14649,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
14636
14649
|
_classPrivateFieldGet(_stylesheetSources, this).set(header.styleSheetId, response.text);
|
|
14637
14650
|
} catch (error) {
|
|
14638
14651
|
// This might happen if the page has already navigated away.
|
|
14639
|
-
debugError(error);
|
|
14652
|
+
debugError?.(error);
|
|
14640
14653
|
}
|
|
14641
14654
|
}
|
|
14642
14655
|
function convertToDisjointRanges(nestedRanges) {
|
|
@@ -14805,7 +14818,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
14805
14818
|
/**
|
|
14806
14819
|
* @internal
|
|
14807
14820
|
*/
|
|
14808
|
-
let EmulationManager = ((_EmulationManager, _client5, _emulatingMobile, _hasTouch, _states, _viewportState, _idleOverridesState, _timezoneState, _visionDeficiencyState, _cpuThrottlingState, _mediaFeaturesState, _mediaTypeState, _geoLocationState, _defaultBackgroundColorState, _javascriptEnabledState, _focusState, _secondaryClients, _EmulationManager_brand) => {
|
|
14821
|
+
let EmulationManager = ((_EmulationManager, _client5, _emulatingMobile, _hasTouch, _states, _viewportState, _idleOverridesState, _timezoneState, _localeState, _visionDeficiencyState, _cpuThrottlingState, _mediaFeaturesState, _mediaTypeState, _geoLocationState, _defaultBackgroundColorState, _javascriptEnabledState, _focusState, _secondaryClients, _EmulationManager_brand) => {
|
|
14809
14822
|
let _instanceExtraInitializers = [];
|
|
14810
14823
|
let _private_applyViewport_decorators;
|
|
14811
14824
|
let _private_applyViewport_descriptor;
|
|
@@ -14813,6 +14826,8 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
14813
14826
|
let _private_emulateIdleState_descriptor;
|
|
14814
14827
|
let _private_emulateTimezone_decorators;
|
|
14815
14828
|
let _private_emulateTimezone_descriptor;
|
|
14829
|
+
let _private_emulateLocale_decorators;
|
|
14830
|
+
let _private_emulateLocale_descriptor;
|
|
14816
14831
|
let _private_emulateVisionDeficiency_decorators;
|
|
14817
14832
|
let _private_emulateVisionDeficiency_descriptor;
|
|
14818
14833
|
let _private_emulateCpuThrottling_decorators;
|
|
@@ -14829,7 +14844,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
14829
14844
|
let _private_setJavaScriptEnabled_descriptor;
|
|
14830
14845
|
let _private_emulateFocus_decorators;
|
|
14831
14846
|
let _private_emulateFocus_descriptor;
|
|
14832
|
-
return _client5 = /*#__PURE__*/new WeakMap(), _emulatingMobile = /*#__PURE__*/new WeakMap(), _hasTouch = /*#__PURE__*/new WeakMap(), _states = /*#__PURE__*/new WeakMap(), _viewportState = /*#__PURE__*/new WeakMap(), _idleOverridesState = /*#__PURE__*/new WeakMap(), _timezoneState = /*#__PURE__*/new WeakMap(), _visionDeficiencyState = /*#__PURE__*/new WeakMap(), _cpuThrottlingState = /*#__PURE__*/new WeakMap(), _mediaFeaturesState = /*#__PURE__*/new WeakMap(), _mediaTypeState = /*#__PURE__*/new WeakMap(), _geoLocationState = /*#__PURE__*/new WeakMap(), _defaultBackgroundColorState = /*#__PURE__*/new WeakMap(), _javascriptEnabledState = /*#__PURE__*/new WeakMap(), _focusState = /*#__PURE__*/new WeakMap(), _secondaryClients = /*#__PURE__*/new WeakMap(), _EmulationManager_brand = /*#__PURE__*/new WeakSet(), _EmulationManager = class EmulationManager {
|
|
14847
|
+
return _client5 = /*#__PURE__*/new WeakMap(), _emulatingMobile = /*#__PURE__*/new WeakMap(), _hasTouch = /*#__PURE__*/new WeakMap(), _states = /*#__PURE__*/new WeakMap(), _viewportState = /*#__PURE__*/new WeakMap(), _idleOverridesState = /*#__PURE__*/new WeakMap(), _timezoneState = /*#__PURE__*/new WeakMap(), _localeState = /*#__PURE__*/new WeakMap(), _visionDeficiencyState = /*#__PURE__*/new WeakMap(), _cpuThrottlingState = /*#__PURE__*/new WeakMap(), _mediaFeaturesState = /*#__PURE__*/new WeakMap(), _mediaTypeState = /*#__PURE__*/new WeakMap(), _geoLocationState = /*#__PURE__*/new WeakMap(), _defaultBackgroundColorState = /*#__PURE__*/new WeakMap(), _javascriptEnabledState = /*#__PURE__*/new WeakMap(), _focusState = /*#__PURE__*/new WeakMap(), _secondaryClients = /*#__PURE__*/new WeakMap(), _EmulationManager_brand = /*#__PURE__*/new WeakSet(), _EmulationManager = class EmulationManager {
|
|
14833
14848
|
constructor(client) {
|
|
14834
14849
|
_classPrivateMethodInitSpec(this, _EmulationManager_brand);
|
|
14835
14850
|
_classPrivateFieldInitSpec(this, _client5, __runInitializers$2(this, _instanceExtraInitializers));
|
|
@@ -14845,6 +14860,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
14845
14860
|
_classPrivateFieldInitSpec(this, _timezoneState, new EmulatedState({
|
|
14846
14861
|
active: false
|
|
14847
14862
|
}, this, _classPrivateGetter(_EmulationManager_brand, this, _get_emulateTimezone)));
|
|
14863
|
+
_classPrivateFieldInitSpec(this, _localeState, new EmulatedState({
|
|
14864
|
+
active: false
|
|
14865
|
+
}, this, _classPrivateGetter(_EmulationManager_brand, this, _get_emulateLocale)));
|
|
14848
14866
|
_classPrivateFieldInitSpec(this, _visionDeficiencyState, new EmulatedState({
|
|
14849
14867
|
active: false
|
|
14850
14868
|
}, this, _classPrivateGetter(_EmulationManager_brand, this, _get_emulateVisionDeficiency)));
|
|
@@ -14892,7 +14910,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
14892
14910
|
// We don't await here because we want to register all state changes before
|
|
14893
14911
|
// the target is unpaused.
|
|
14894
14912
|
void Promise.all(_classPrivateFieldGet(_states, this).map(s => {
|
|
14895
|
-
return s.sync().catch(
|
|
14913
|
+
return s.sync().catch(debugCatchError);
|
|
14896
14914
|
}));
|
|
14897
14915
|
}
|
|
14898
14916
|
get javascriptEnabled() {
|
|
@@ -14928,6 +14946,12 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
14928
14946
|
active: true
|
|
14929
14947
|
});
|
|
14930
14948
|
}
|
|
14949
|
+
async emulateLocale(locale) {
|
|
14950
|
+
await _classPrivateFieldGet(_localeState, this).setState({
|
|
14951
|
+
locale,
|
|
14952
|
+
active: true
|
|
14953
|
+
});
|
|
14954
|
+
}
|
|
14931
14955
|
async emulateVisionDeficiency(type) {
|
|
14932
14956
|
const visionDeficiencies = new Set(['none', 'achromatopsia', 'blurredVision', 'deuteranopia', 'protanopia', 'reducedContrast', 'tritanopia']);
|
|
14933
14957
|
assert(!type || visionDeficiencies.has(type), `Unsupported vision deficiency: ${type}`);
|
|
@@ -15026,6 +15050,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
15026
15050
|
_private_applyViewport_decorators = [invokeAtMostOnceForArguments];
|
|
15027
15051
|
_private_emulateIdleState_decorators = [invokeAtMostOnceForArguments];
|
|
15028
15052
|
_private_emulateTimezone_decorators = [invokeAtMostOnceForArguments];
|
|
15053
|
+
_private_emulateLocale_decorators = [invokeAtMostOnceForArguments];
|
|
15029
15054
|
_private_emulateVisionDeficiency_decorators = [invokeAtMostOnceForArguments];
|
|
15030
15055
|
_private_emulateCpuThrottling_decorators = [invokeAtMostOnceForArguments];
|
|
15031
15056
|
_private_emulateMediaFeatures_decorators = [invokeAtMostOnceForArguments];
|
|
@@ -15039,7 +15064,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
15039
15064
|
if (!viewportState.viewport) {
|
|
15040
15065
|
await Promise.all([client.send('Emulation.clearDeviceMetricsOverride'), client.send('Emulation.setTouchEmulationEnabled', {
|
|
15041
15066
|
enabled: false
|
|
15042
|
-
})]).catch(
|
|
15067
|
+
})]).catch(debugCatchError);
|
|
15043
15068
|
return;
|
|
15044
15069
|
}
|
|
15045
15070
|
const {
|
|
@@ -15065,7 +15090,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
15065
15090
|
screenOrientation
|
|
15066
15091
|
}).catch(err => {
|
|
15067
15092
|
if (err.message.includes('Target does not support metrics override')) {
|
|
15068
|
-
debugError(err);
|
|
15093
|
+
debugError?.(err);
|
|
15069
15094
|
return;
|
|
15070
15095
|
}
|
|
15071
15096
|
throw err;
|
|
@@ -15136,6 +15161,26 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
15136
15161
|
},
|
|
15137
15162
|
metadata: _metadata
|
|
15138
15163
|
}, null, _instanceExtraInitializers);
|
|
15164
|
+
__esDecorate$2(_EmulationManager, _private_emulateLocale_descriptor = {
|
|
15165
|
+
value: __setFunctionName(async function (client, localeState) {
|
|
15166
|
+
if (!localeState.active) {
|
|
15167
|
+
return;
|
|
15168
|
+
}
|
|
15169
|
+
await client.send('Emulation.setLocaleOverride', {
|
|
15170
|
+
locale: localeState.locale
|
|
15171
|
+
});
|
|
15172
|
+
}, "#emulateLocale")
|
|
15173
|
+
}, _private_emulateLocale_decorators, {
|
|
15174
|
+
kind: "method",
|
|
15175
|
+
name: "#emulateLocale",
|
|
15176
|
+
static: false,
|
|
15177
|
+
private: true,
|
|
15178
|
+
access: {
|
|
15179
|
+
has: obj => _EmulationManager_brand.has(_checkInRHS(obj)),
|
|
15180
|
+
get: obj => _classPrivateGetter(_EmulationManager_brand, obj, _get_emulateLocale)
|
|
15181
|
+
},
|
|
15182
|
+
metadata: _metadata
|
|
15183
|
+
}, null, _instanceExtraInitializers);
|
|
15139
15184
|
__esDecorate$2(_EmulationManager, _private_emulateVisionDeficiency_descriptor = {
|
|
15140
15185
|
value: __setFunctionName(async function (client, visionDeficiency) {
|
|
15141
15186
|
if (!visionDeficiency.active) {
|
|
@@ -15314,28 +15359,31 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
15314
15359
|
function _get_emulateTimezone(_this5) {
|
|
15315
15360
|
return _private_emulateTimezone_descriptor.value;
|
|
15316
15361
|
}
|
|
15317
|
-
function
|
|
15362
|
+
function _get_emulateLocale(_this6) {
|
|
15363
|
+
return _private_emulateLocale_descriptor.value;
|
|
15364
|
+
}
|
|
15365
|
+
function _get_emulateVisionDeficiency(_this7) {
|
|
15318
15366
|
return _private_emulateVisionDeficiency_descriptor.value;
|
|
15319
15367
|
}
|
|
15320
|
-
function _get_emulateCpuThrottling(
|
|
15368
|
+
function _get_emulateCpuThrottling(_this8) {
|
|
15321
15369
|
return _private_emulateCpuThrottling_descriptor.value;
|
|
15322
15370
|
}
|
|
15323
|
-
function _get_emulateMediaFeatures(
|
|
15371
|
+
function _get_emulateMediaFeatures(_this9) {
|
|
15324
15372
|
return _private_emulateMediaFeatures_descriptor.value;
|
|
15325
15373
|
}
|
|
15326
|
-
function _get_emulateMediaType(
|
|
15374
|
+
function _get_emulateMediaType(_this0) {
|
|
15327
15375
|
return _private_emulateMediaType_descriptor.value;
|
|
15328
15376
|
}
|
|
15329
|
-
function _get_setGeolocation(
|
|
15377
|
+
function _get_setGeolocation(_this1) {
|
|
15330
15378
|
return _private_setGeolocation_descriptor.value;
|
|
15331
15379
|
}
|
|
15332
|
-
function _get_setDefaultBackgroundColor(
|
|
15380
|
+
function _get_setDefaultBackgroundColor(_this10) {
|
|
15333
15381
|
return _private_setDefaultBackgroundColor_descriptor.value;
|
|
15334
15382
|
}
|
|
15335
|
-
function _get_setJavaScriptEnabled(
|
|
15383
|
+
function _get_setJavaScriptEnabled(_this11) {
|
|
15336
15384
|
return _private_setJavaScriptEnabled_descriptor.value;
|
|
15337
15385
|
}
|
|
15338
|
-
function _get_emulateFocus(
|
|
15386
|
+
function _get_emulateFocus(_this12) {
|
|
15339
15387
|
return _private_emulateFocus_descriptor.value;
|
|
15340
15388
|
}
|
|
15341
15389
|
})();
|
|
@@ -15914,7 +15962,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
15914
15962
|
}).catch(error => {
|
|
15915
15963
|
// Exceptions might happen in case of a page been navigated or closed.
|
|
15916
15964
|
// Swallow these since they are harmless and we don't leak anything in this case.
|
|
15917
|
-
debugError(error);
|
|
15965
|
+
debugError?.(error);
|
|
15918
15966
|
});
|
|
15919
15967
|
}
|
|
15920
15968
|
|
|
@@ -16015,7 +16063,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16015
16063
|
objectId: this.id
|
|
16016
16064
|
});
|
|
16017
16065
|
} catch (error) {
|
|
16018
|
-
debugError(error);
|
|
16066
|
+
debugError?.(error);
|
|
16019
16067
|
// Fallback to Element.scrollIntoView if DOM.scrollIntoViewIfNeeded is not supported
|
|
16020
16068
|
await super.scrollIntoView();
|
|
16021
16069
|
}
|
|
@@ -16176,8 +16224,8 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16176
16224
|
value: _metadata
|
|
16177
16225
|
});
|
|
16178
16226
|
})(), _CdpElementHandle;
|
|
16179
|
-
function _get_frameManager(
|
|
16180
|
-
return
|
|
16227
|
+
function _get_frameManager(_this13) {
|
|
16228
|
+
return _this13.frame._frameManager;
|
|
16181
16229
|
}
|
|
16182
16230
|
})();
|
|
16183
16231
|
|
|
@@ -16465,7 +16513,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16465
16513
|
return;
|
|
16466
16514
|
}
|
|
16467
16515
|
}
|
|
16468
|
-
debugError(error);
|
|
16516
|
+
debugError?.(error);
|
|
16469
16517
|
}
|
|
16470
16518
|
} catch (e_1) {
|
|
16471
16519
|
env_1.error = e_1;
|
|
@@ -16505,7 +16553,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16505
16553
|
const binding = _classPrivateFieldGet(_bindings, this).get(name);
|
|
16506
16554
|
await binding?.run(this, seq, args, isTrivial);
|
|
16507
16555
|
} catch (err) {
|
|
16508
|
-
debugError(err);
|
|
16556
|
+
debugError?.(err);
|
|
16509
16557
|
}
|
|
16510
16558
|
}
|
|
16511
16559
|
function _onConsoleAPI(event) {
|
|
@@ -16520,7 +16568,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16520
16568
|
} catch (err) {
|
|
16521
16569
|
// If the binding cannot be added, the context is broken. We cannot
|
|
16522
16570
|
// recover so we ignore the error.
|
|
16523
|
-
debugError(err);
|
|
16571
|
+
debugError?.(err);
|
|
16524
16572
|
}
|
|
16525
16573
|
}
|
|
16526
16574
|
async function _evaluate(returnByValue, pageFunction, ...args) {
|
|
@@ -16716,6 +16764,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16716
16764
|
var _id7 = /*#__PURE__*/new WeakMap();
|
|
16717
16765
|
var _targetType2 = /*#__PURE__*/new WeakMap();
|
|
16718
16766
|
var _emitter2 = /*#__PURE__*/new WeakMap();
|
|
16767
|
+
var _workerLoaded = /*#__PURE__*/new WeakMap();
|
|
16719
16768
|
class CdpWebWorker extends WebWorker {
|
|
16720
16769
|
get internalEmitter() {
|
|
16721
16770
|
return _classPrivateFieldGet(_emitter2, this);
|
|
@@ -16727,6 +16776,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16727
16776
|
_classPrivateFieldInitSpec(this, _id7, void 0);
|
|
16728
16777
|
_classPrivateFieldInitSpec(this, _targetType2, void 0);
|
|
16729
16778
|
_classPrivateFieldInitSpec(this, _emitter2, void 0);
|
|
16779
|
+
_classPrivateFieldInitSpec(this, _workerLoaded, new Deferred());
|
|
16730
16780
|
_classPrivateFieldSet(_id7, this, targetId);
|
|
16731
16781
|
_classPrivateFieldSet(_client9, this, client);
|
|
16732
16782
|
_classPrivateFieldSet(_targetType2, this, targetType);
|
|
@@ -16735,6 +16785,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16735
16785
|
_classPrivateFieldGet(_client9, this).once('Runtime.executionContextCreated', async event => {
|
|
16736
16786
|
_classPrivateFieldGet(_world4, this).setContext(new ExecutionContext(client, event.context, _classPrivateFieldGet(_world4, this)));
|
|
16737
16787
|
});
|
|
16788
|
+
_classPrivateFieldGet(_client9, this).once('Inspector.workerScriptLoaded', () => {
|
|
16789
|
+
_classPrivateFieldGet(_workerLoaded, this).resolve();
|
|
16790
|
+
});
|
|
16738
16791
|
_classPrivateFieldGet(_world4, this).emitter.on('consoleapicalled', async event => {
|
|
16739
16792
|
try {
|
|
16740
16793
|
const values = event.args.map(arg => {
|
|
@@ -16746,7 +16799,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16746
16799
|
// eslint-disable-next-line max-len -- The comment is long.
|
|
16747
16800
|
// eslint-disable-next-line @puppeteer/use-using -- These are not owned by this function.
|
|
16748
16801
|
for (const value of values) {
|
|
16749
|
-
void value.dispose().catch(
|
|
16802
|
+
void value.dispose().catch(debugCatchError);
|
|
16750
16803
|
}
|
|
16751
16804
|
return;
|
|
16752
16805
|
}
|
|
@@ -16756,7 +16809,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16756
16809
|
this.emit(exports.WebWorkerEvent.Console, consoleMessages);
|
|
16757
16810
|
}
|
|
16758
16811
|
} catch (err) {
|
|
16759
|
-
debugError(err);
|
|
16812
|
+
debugError?.(err);
|
|
16760
16813
|
}
|
|
16761
16814
|
});
|
|
16762
16815
|
_classPrivateFieldGet(_client9, this).on('Runtime.exceptionThrown', exceptionThrown);
|
|
@@ -16764,8 +16817,8 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16764
16817
|
_classPrivateFieldGet(_world4, this).dispose();
|
|
16765
16818
|
});
|
|
16766
16819
|
// This might fail if the target is closed before we receive all execution contexts.
|
|
16767
|
-
networkManager?.addClient(_classPrivateFieldGet(_client9, this)).catch(
|
|
16768
|
-
_classPrivateFieldGet(_client9, this).send('Runtime.enable').catch(
|
|
16820
|
+
networkManager?.addClient(_classPrivateFieldGet(_client9, this)).catch(debugCatchError ?? (() => {}));
|
|
16821
|
+
_classPrivateFieldGet(_client9, this).send('Runtime.enable').catch(debugCatchError ?? (() => {}));
|
|
16769
16822
|
}
|
|
16770
16823
|
mainRealm() {
|
|
16771
16824
|
return _classPrivateFieldGet(_world4, this);
|
|
@@ -16800,6 +16853,14 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16800
16853
|
});
|
|
16801
16854
|
}
|
|
16802
16855
|
}
|
|
16856
|
+
async evaluate(func, ...args) {
|
|
16857
|
+
await _classPrivateFieldGet(_workerLoaded, this).valueOrThrow();
|
|
16858
|
+
return await super.evaluate(func, ...args);
|
|
16859
|
+
}
|
|
16860
|
+
async evaluateHandle(func, ...args) {
|
|
16861
|
+
await _classPrivateFieldGet(_workerLoaded, this).valueOrThrow();
|
|
16862
|
+
return await super.evaluateHandle(func, ...args);
|
|
16863
|
+
}
|
|
16803
16864
|
}
|
|
16804
16865
|
|
|
16805
16866
|
/**
|
|
@@ -17411,7 +17472,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
17411
17472
|
}
|
|
17412
17473
|
await Promise.all([_classPrivateFieldGet(_client0, this).send('Runtime.addBinding', {
|
|
17413
17474
|
name: CDP_BINDING_PREFIX + binding.name
|
|
17414
|
-
}), this.evaluate(binding.initSource).catch(
|
|
17475
|
+
}), this.evaluate(binding.initSource).catch(debugCatchError)]);
|
|
17415
17476
|
}
|
|
17416
17477
|
async removeExposedFunctionBinding(binding) {
|
|
17417
17478
|
// If a frame has not started loading, it might never start. Rely on
|
|
@@ -17425,7 +17486,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
17425
17486
|
// Removes the dangling Puppeteer binding wrapper.
|
|
17426
17487
|
// @ts-expect-error: In a different context.
|
|
17427
17488
|
globalThis[name] = undefined;
|
|
17428
|
-
}, binding.name).catch(
|
|
17489
|
+
}, binding.name).catch(debugCatchError)]);
|
|
17429
17490
|
}
|
|
17430
17491
|
async waitForDevicePrompt(options = {}) {
|
|
17431
17492
|
return await _assertClassBrand(_CdpFrame_brand, this, _deviceRequestPromptManager).call(this).waitForDevicePrompt(options);
|
|
@@ -17766,7 +17827,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
17766
17827
|
});
|
|
17767
17828
|
return result.postData;
|
|
17768
17829
|
} catch (err) {
|
|
17769
|
-
debugError(err);
|
|
17830
|
+
debugError?.(err);
|
|
17770
17831
|
return;
|
|
17771
17832
|
}
|
|
17772
17833
|
}
|
|
@@ -18283,6 +18344,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18283
18344
|
var _userAgent = /*#__PURE__*/new WeakMap();
|
|
18284
18345
|
var _userAgentMetadata = /*#__PURE__*/new WeakMap();
|
|
18285
18346
|
var _platform = /*#__PURE__*/new WeakMap();
|
|
18347
|
+
var _acceptLanguage = /*#__PURE__*/new WeakMap();
|
|
18286
18348
|
var _handlers3 = /*#__PURE__*/new WeakMap();
|
|
18287
18349
|
var _clients = /*#__PURE__*/new WeakMap();
|
|
18288
18350
|
var _networkEnabled = /*#__PURE__*/new WeakMap();
|
|
@@ -18303,9 +18365,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18303
18365
|
_classPrivateFieldInitSpec(this, _userAgent, void 0);
|
|
18304
18366
|
_classPrivateFieldInitSpec(this, _userAgentMetadata, void 0);
|
|
18305
18367
|
_classPrivateFieldInitSpec(this, _platform, void 0);
|
|
18368
|
+
_classPrivateFieldInitSpec(this, _acceptLanguage, void 0);
|
|
18306
18369
|
_classPrivateFieldInitSpec(this, _handlers3, [['Fetch.requestPaused', _assertClassBrand(_NetworkManager_brand, this, _onRequestPaused)], ['Fetch.authRequired', _assertClassBrand(_NetworkManager_brand, this, _onAuthRequired)], ['Network.requestWillBeSent', _assertClassBrand(_NetworkManager_brand, this, _onRequestWillBeSent)], ['Network.requestWillBeSentExtraInfo', _assertClassBrand(_NetworkManager_brand, this, _onRequestWillBeSentExtraInfo)], ['Network.requestServedFromCache', _assertClassBrand(_NetworkManager_brand, this, _onRequestServedFromCache)], ['Network.responseReceived', _assertClassBrand(_NetworkManager_brand, this, _onResponseReceived)], ['Network.loadingFinished', _assertClassBrand(_NetworkManager_brand, this, _onLoadingFinished)], ['Network.loadingFailed', _assertClassBrand(_NetworkManager_brand, this, _onLoadingFailed)], ['Network.responseReceivedExtraInfo', _assertClassBrand(_NetworkManager_brand, this, _onResponseReceivedExtraInfo)], [exports.CDPSessionEvent.Disconnected, _assertClassBrand(_NetworkManager_brand, this, _removeClient)]]);
|
|
18307
18370
|
_classPrivateFieldInitSpec(this, _clients, new Map());
|
|
18308
|
-
_classPrivateFieldInitSpec(this, _networkEnabled,
|
|
18371
|
+
_classPrivateFieldInitSpec(this, _networkEnabled, void 0);
|
|
18309
18372
|
_classPrivateFieldSet(_frameManager, this, frameManager);
|
|
18310
18373
|
_classPrivateFieldSet(_networkEnabled, this, networkEnabled ?? true);
|
|
18311
18374
|
}
|
|
@@ -18387,6 +18450,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18387
18450
|
_classPrivateFieldSet(_platform, this, platform);
|
|
18388
18451
|
await _assertClassBrand(_NetworkManager_brand, this, _applyToAllClients).call(this, _assertClassBrand(_NetworkManager_brand, this, _applyUserAgent).bind(this));
|
|
18389
18452
|
}
|
|
18453
|
+
async setAcceptLanguage(acceptLanguage) {
|
|
18454
|
+
_classPrivateFieldSet(_acceptLanguage, this, acceptLanguage);
|
|
18455
|
+
await _assertClassBrand(_NetworkManager_brand, this, _applyToAllClients).call(this, _assertClassBrand(_NetworkManager_brand, this, _applyUserAgent).bind(this));
|
|
18456
|
+
}
|
|
18390
18457
|
async setCacheEnabled(enabled) {
|
|
18391
18458
|
_classPrivateFieldSet(_userCacheDisabled, this, !enabled);
|
|
18392
18459
|
await _assertClassBrand(_NetworkManager_brand, this, _applyToAllClients).call(this, _assertClassBrand(_NetworkManager_brand, this, _applyProtocolCacheDisabled).bind(this));
|
|
@@ -18453,12 +18520,14 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18453
18520
|
}
|
|
18454
18521
|
}
|
|
18455
18522
|
async function _applyUserAgent(client) {
|
|
18456
|
-
|
|
18523
|
+
const userAgent = _classPrivateFieldGet(_userAgent, this) ?? (await _classPrivateFieldGet(_frameManager, this).page().browser().userAgent());
|
|
18524
|
+
if (userAgent === undefined) {
|
|
18457
18525
|
return;
|
|
18458
18526
|
}
|
|
18459
18527
|
try {
|
|
18460
18528
|
await client.send('Network.setUserAgentOverride', {
|
|
18461
|
-
userAgent
|
|
18529
|
+
userAgent,
|
|
18530
|
+
acceptLanguage: _classPrivateFieldGet(_acceptLanguage, this),
|
|
18462
18531
|
userAgentMetadata: _classPrivateFieldGet(_userAgentMetadata, this),
|
|
18463
18532
|
platform: _classPrivateFieldGet(_platform, this)
|
|
18464
18533
|
});
|
|
@@ -18547,14 +18616,14 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18547
18616
|
username: undefined,
|
|
18548
18617
|
password: undefined
|
|
18549
18618
|
};
|
|
18550
|
-
client.send('Fetch.continueWithAuth', {
|
|
18619
|
+
void client.send('Fetch.continueWithAuth', {
|
|
18551
18620
|
requestId: event.requestId,
|
|
18552
18621
|
authChallengeResponse: {
|
|
18553
18622
|
response,
|
|
18554
18623
|
username,
|
|
18555
18624
|
password
|
|
18556
18625
|
}
|
|
18557
|
-
}).catch(
|
|
18626
|
+
}).catch(debugCatchError);
|
|
18558
18627
|
}
|
|
18559
18628
|
/**
|
|
18560
18629
|
* CDP may send a Fetch.requestPaused without or before a
|
|
@@ -18565,9 +18634,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18565
18634
|
*/
|
|
18566
18635
|
function _onRequestPaused(client, event) {
|
|
18567
18636
|
if (!_classPrivateFieldGet(_userRequestInterceptionEnabled, this) && _classPrivateFieldGet(_protocolRequestInterceptionEnabled, this)) {
|
|
18568
|
-
client.send('Fetch.continueRequest', {
|
|
18637
|
+
void client.send('Fetch.continueRequest', {
|
|
18569
18638
|
requestId: event.requestId
|
|
18570
|
-
}).catch(
|
|
18639
|
+
}).catch(debugCatchError);
|
|
18571
18640
|
}
|
|
18572
18641
|
const {
|
|
18573
18642
|
networkId: networkRequestId,
|
|
@@ -18674,7 +18743,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18674
18743
|
request = _classPrivateFieldGet(_networkEventManager, this).getRequest(event.requestId);
|
|
18675
18744
|
}
|
|
18676
18745
|
if (!request) {
|
|
18677
|
-
debugError(new Error(`Request ${event.requestId} was served from cache but we could not find the corresponding request object`));
|
|
18746
|
+
debugError?.(new Error(`Request ${event.requestId} was served from cache but we could not find the corresponding request object`));
|
|
18678
18747
|
return;
|
|
18679
18748
|
}
|
|
18680
18749
|
this.emit(exports.NetworkManagerEvent.RequestServedFromCache, request);
|
|
@@ -18696,7 +18765,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18696
18765
|
}
|
|
18697
18766
|
const extraInfos = _classPrivateFieldGet(_networkEventManager, this).responseExtraInfo(responseReceived.requestId);
|
|
18698
18767
|
if (extraInfos.length) {
|
|
18699
|
-
debugError(new Error('Unexpected extraInfo events for request ' + responseReceived.requestId));
|
|
18768
|
+
debugError?.(new Error('Unexpected extraInfo events for request ' + responseReceived.requestId));
|
|
18700
18769
|
}
|
|
18701
18770
|
// Chromium sends wrong extraInfo events for responses served from cache.
|
|
18702
18771
|
// See https://github.com/puppeteer/puppeteer/issues/9965 and
|
|
@@ -18882,7 +18951,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18882
18951
|
_classPrivateFieldSet(_timeoutSettings3, this, timeoutSettings);
|
|
18883
18952
|
this.setupEventListeners(_classPrivateFieldGet(_client10, this));
|
|
18884
18953
|
client.once(exports.CDPSessionEvent.Disconnected, () => {
|
|
18885
|
-
_assertClassBrand(_FrameManager_brand, this, _onClientDisconnect).call(this).catch(
|
|
18954
|
+
void _assertClassBrand(_FrameManager_brand, this, _onClientDisconnect).call(this).catch(debugCatchError);
|
|
18886
18955
|
});
|
|
18887
18956
|
}
|
|
18888
18957
|
/**
|
|
@@ -18902,7 +18971,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18902
18971
|
}
|
|
18903
18972
|
this.setupEventListeners(client);
|
|
18904
18973
|
client.once(exports.CDPSessionEvent.Disconnected, () => {
|
|
18905
|
-
_assertClassBrand(_FrameManager_brand, this, _onClientDisconnect).call(this).catch(
|
|
18974
|
+
void _assertClassBrand(_FrameManager_brand, this, _onClientDisconnect).call(this).catch(debugCatchError);
|
|
18906
18975
|
});
|
|
18907
18976
|
await this.initialize(client, frame);
|
|
18908
18977
|
await _classPrivateFieldGet(_networkManager, this).addClient(client);
|
|
@@ -19036,7 +19105,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
19036
19105
|
}
|
|
19037
19106
|
return frame._client().send('Page.removeScriptToEvaluateOnNewDocument', {
|
|
19038
19107
|
identifier
|
|
19039
|
-
}).catch(
|
|
19108
|
+
}).catch(debugCatchError);
|
|
19040
19109
|
}));
|
|
19041
19110
|
}
|
|
19042
19111
|
onAttachedToTarget(target) {
|
|
@@ -19048,7 +19117,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
19048
19117
|
frame.updateClient(target._session());
|
|
19049
19118
|
}
|
|
19050
19119
|
this.setupEventListeners(target._session());
|
|
19051
|
-
void this.initialize(target._session(), frame).catch(
|
|
19120
|
+
void this.initialize(target._session(), frame).catch(debugCatchError);
|
|
19052
19121
|
}
|
|
19053
19122
|
_deviceRequestPromptManager(client) {
|
|
19054
19123
|
let manager = _classPrivateFieldGet(_deviceRequestPromptManagerMap, this).get(client);
|
|
@@ -19197,7 +19266,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
19197
19266
|
frameId: frame._id,
|
|
19198
19267
|
worldName: name,
|
|
19199
19268
|
grantUniveralAccess: true
|
|
19200
|
-
}).catch(
|
|
19269
|
+
}).catch(debugCatchError);
|
|
19201
19270
|
}));
|
|
19202
19271
|
_classPrivateFieldGet(_isolatedWorlds, this).add(key);
|
|
19203
19272
|
}
|
|
@@ -19264,7 +19333,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
19264
19333
|
} else if (_assertClassBrand(_FrameManager_brand, this, _isExtensionOrigin).call(this, origin)) {
|
|
19265
19334
|
const extId = _assertClassBrand(_FrameManager_brand, this, _extractExtensionId).call(this, origin);
|
|
19266
19335
|
if (!extId) {
|
|
19267
|
-
debugError('Error while parsing extension id');
|
|
19336
|
+
debugError?.('Error while parsing extension id');
|
|
19268
19337
|
return;
|
|
19269
19338
|
}
|
|
19270
19339
|
if (frame.extensionWorlds[extId]) {
|
|
@@ -21109,10 +21178,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21109
21178
|
/**
|
|
21110
21179
|
* @internal
|
|
21111
21180
|
*/
|
|
21112
|
-
function _get_state(
|
|
21181
|
+
function _get_state(_this14) {
|
|
21113
21182
|
return Object.assign({
|
|
21114
|
-
..._classPrivateFieldGet(_state2,
|
|
21115
|
-
}, ..._classPrivateFieldGet(_transactions,
|
|
21183
|
+
..._classPrivateFieldGet(_state2, _this14)
|
|
21184
|
+
}, ..._classPrivateFieldGet(_transactions, _this14));
|
|
21116
21185
|
}
|
|
21117
21186
|
function _createTransaction() {
|
|
21118
21187
|
const transaction = {};
|
|
@@ -21459,7 +21528,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21459
21528
|
this.input = JSON.parse(input);
|
|
21460
21529
|
} catch (error) {
|
|
21461
21530
|
this.input = {};
|
|
21462
|
-
debugError(error);
|
|
21531
|
+
debugError?.(error);
|
|
21463
21532
|
}
|
|
21464
21533
|
}
|
|
21465
21534
|
}
|
|
@@ -21491,7 +21560,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21491
21560
|
var _onToolsRemoved = /*#__PURE__*/new WeakMap();
|
|
21492
21561
|
var _onToolInvoked = /*#__PURE__*/new WeakMap();
|
|
21493
21562
|
var _onToolResponded = /*#__PURE__*/new WeakMap();
|
|
21494
|
-
var
|
|
21563
|
+
var _onContextDisposed2 = /*#__PURE__*/new WeakMap();
|
|
21495
21564
|
var _WebMCP_brand = /*#__PURE__*/new WeakSet();
|
|
21496
21565
|
class WebMCP extends EventEmitter {
|
|
21497
21566
|
/**
|
|
@@ -21514,6 +21583,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21514
21583
|
const frameTools = _classPrivateFieldGet(_tools, this).get(tool.frameId) ?? new Map();
|
|
21515
21584
|
if (!_classPrivateFieldGet(_tools, this).has(tool.frameId)) {
|
|
21516
21585
|
_classPrivateFieldGet(_tools, this).set(tool.frameId, frameTools);
|
|
21586
|
+
_assertClassBrand(_WebMCP_brand, this, _listenToContextDestroyed).call(this, frame);
|
|
21517
21587
|
}
|
|
21518
21588
|
const addedTool = new WebMCPTool(this, tool, frame);
|
|
21519
21589
|
frameTools.set(tool.name, addedTool);
|
|
@@ -21561,7 +21631,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21561
21631
|
};
|
|
21562
21632
|
this.emit('toolresponded', response);
|
|
21563
21633
|
});
|
|
21564
|
-
_classPrivateFieldInitSpec(this,
|
|
21634
|
+
_classPrivateFieldInitSpec(this, _onContextDisposed2, frame => {
|
|
21565
21635
|
_classPrivateFieldGet(_pendingCalls, this).clear();
|
|
21566
21636
|
const frameTools = _classPrivateFieldGet(_tools, this).get(frame._id);
|
|
21567
21637
|
if (!frameTools) {
|
|
@@ -21577,14 +21647,13 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21577
21647
|
});
|
|
21578
21648
|
_classPrivateFieldSet(_client16, this, client);
|
|
21579
21649
|
_classPrivateFieldSet(_frameManager2, this, frameManager);
|
|
21580
|
-
_classPrivateFieldGet(_frameManager2, this).on(exports.FrameManagerEvent.FrameNavigated, _classPrivateFieldGet(_onFrameNavigated2, this));
|
|
21581
21650
|
_assertClassBrand(_WebMCP_brand, this, _bindListeners).call(this);
|
|
21582
21651
|
}
|
|
21583
21652
|
/**
|
|
21584
21653
|
* @internal
|
|
21585
21654
|
*/
|
|
21586
21655
|
async initialize() {
|
|
21587
|
-
return await _classPrivateFieldGet(_client16, this).send('WebMCP.enable').catch(
|
|
21656
|
+
return await _classPrivateFieldGet(_client16, this).send('WebMCP.enable').catch(debugCatchError);
|
|
21588
21657
|
}
|
|
21589
21658
|
/**
|
|
21590
21659
|
* @internal
|
|
@@ -21622,6 +21691,11 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21622
21691
|
* Copyright 2017 Google Inc.
|
|
21623
21692
|
* SPDX-License-Identifier: Apache-2.0
|
|
21624
21693
|
*/
|
|
21694
|
+
function _listenToContextDestroyed(frame) {
|
|
21695
|
+
frame.mainRealm().context?.once('disposed', () => {
|
|
21696
|
+
_classPrivateFieldGet(_onContextDisposed2, this).call(this, frame);
|
|
21697
|
+
});
|
|
21698
|
+
}
|
|
21625
21699
|
function _bindListeners() {
|
|
21626
21700
|
_classPrivateFieldGet(_client16, this).on('WebMCP.toolsAdded', _classPrivateFieldGet(_onToolsAdded, this));
|
|
21627
21701
|
_classPrivateFieldGet(_client16, this).on('WebMCP.toolsRemoved', _classPrivateFieldGet(_onToolsRemoved, this));
|
|
@@ -21744,7 +21818,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21744
21818
|
await page.setViewport(defaultViewport);
|
|
21745
21819
|
} catch (err) {
|
|
21746
21820
|
if (isErrorLike(err) && isTargetClosedError(err)) {
|
|
21747
|
-
debugError(err);
|
|
21821
|
+
debugError?.(err);
|
|
21748
21822
|
} else {
|
|
21749
21823
|
throw err;
|
|
21750
21824
|
}
|
|
@@ -21800,7 +21874,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21800
21874
|
// eslint-disable-next-line max-len -- The comment is long.
|
|
21801
21875
|
// eslint-disable-next-line @puppeteer/use-using -- These are not owned by this function.
|
|
21802
21876
|
for (const arg of message.args()) {
|
|
21803
|
-
void arg.dispose().catch(
|
|
21877
|
+
void arg.dispose().catch(debugCatchError);
|
|
21804
21878
|
}
|
|
21805
21879
|
return;
|
|
21806
21880
|
}
|
|
@@ -21867,11 +21941,11 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21867
21941
|
_classPrivateFieldGet(_tabTargetClient, this).on(exports.CDPSessionEvent.Swapped, _assertClassBrand(_CdpPage_brand, this, _onActivation).bind(this));
|
|
21868
21942
|
_classPrivateFieldGet(_tabTargetClient, this).on(exports.CDPSessionEvent.Ready, _assertClassBrand(_CdpPage_brand, this, _onSecondaryTarget).bind(this));
|
|
21869
21943
|
_classPrivateFieldGet(_targetManager, this).on("targetGone" /* TargetManagerEvent.TargetGone */, _classPrivateFieldGet(_onDetachedFromTarget, this));
|
|
21870
|
-
_classPrivateFieldGet(_tabTarget, this)._isClosedDeferred.valueOrThrow().then(() => {
|
|
21944
|
+
void _classPrivateFieldGet(_tabTarget, this)._isClosedDeferred.valueOrThrow().then(() => {
|
|
21871
21945
|
_classPrivateFieldGet(_targetManager, this).off("targetGone" /* TargetManagerEvent.TargetGone */, _classPrivateFieldGet(_onDetachedFromTarget, this));
|
|
21872
21946
|
this.emit("close" /* PageEvent.Close */, undefined);
|
|
21873
21947
|
_classPrivateFieldSet(_closed2, this, true);
|
|
21874
|
-
}).catch(
|
|
21948
|
+
}).catch(debugCatchError);
|
|
21875
21949
|
_assertClassBrand(_CdpPage_brand, this, _setupPrimaryTargetListeners).call(this);
|
|
21876
21950
|
_assertClassBrand(_CdpPage_brand, this, _attachExistingTargets).call(this);
|
|
21877
21951
|
}
|
|
@@ -22221,6 +22295,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22221
22295
|
async emulateTimezone(timezoneId) {
|
|
22222
22296
|
return await _classPrivateFieldGet(_emulationManager, this).emulateTimezone(timezoneId);
|
|
22223
22297
|
}
|
|
22298
|
+
async emulateLocale(locale) {
|
|
22299
|
+
await _classPrivateFieldGet(_emulationManager, this).emulateLocale(locale);
|
|
22300
|
+
await _classPrivateFieldGet(_frameManager3, this).networkManager.setAcceptLanguage(locale);
|
|
22301
|
+
}
|
|
22224
22302
|
async emulateIdleState(overrides) {
|
|
22225
22303
|
return await _classPrivateFieldGet(_emulationManager, this).emulateIdleState(overrides);
|
|
22226
22304
|
}
|
|
@@ -22267,7 +22345,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22267
22345
|
if (omitBackground && (type === 'png' || type === 'webp')) {
|
|
22268
22346
|
await _classPrivateFieldGet(_emulationManager, this).setTransparentBackgroundColor();
|
|
22269
22347
|
stack.defer(async () => {
|
|
22270
|
-
await _classPrivateFieldGet(_emulationManager, this).resetDefaultBackgroundColor().catch(
|
|
22348
|
+
await _classPrivateFieldGet(_emulationManager, this).resetDefaultBackgroundColor().catch(debugCatchError);
|
|
22271
22349
|
});
|
|
22272
22350
|
}
|
|
22273
22351
|
let clip = userClip;
|
|
@@ -22484,8 +22562,8 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22484
22562
|
if (session.target()._subtype() !== 'prerender') {
|
|
22485
22563
|
return;
|
|
22486
22564
|
}
|
|
22487
|
-
_classPrivateFieldGet(_frameManager3, this).registerSpeculativeSession(session).catch(
|
|
22488
|
-
_classPrivateFieldGet(_emulationManager, this).registerSpeculativeSession(session).catch(
|
|
22565
|
+
void _classPrivateFieldGet(_frameManager3, this).registerSpeculativeSession(session).catch(debugCatchError);
|
|
22566
|
+
void _classPrivateFieldGet(_emulationManager, this).registerSpeculativeSession(session).catch(debugCatchError);
|
|
22489
22567
|
}
|
|
22490
22568
|
/**
|
|
22491
22569
|
* Sets up listeners for the primary target. The primary target can change
|
|
@@ -22515,7 +22593,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22515
22593
|
await Promise.all([_classPrivateFieldGet(_frameManager3, this).initialize(_classPrivateFieldGet(_primaryTargetClient, this)), _classPrivateFieldGet(_primaryTargetClient, this).send('Performance.enable'), _classPrivateFieldGet(_primaryTargetClient, this).send('Log.enable'), _classPrivateFieldGet(_webmcp2, this).initialize()]);
|
|
22516
22594
|
} catch (err) {
|
|
22517
22595
|
if (isErrorLike(err) && isTargetClosedError(err)) {
|
|
22518
|
-
debugError(err);
|
|
22596
|
+
debugError?.(err);
|
|
22519
22597
|
} else {
|
|
22520
22598
|
throw err;
|
|
22521
22599
|
}
|
|
@@ -22603,7 +22681,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22603
22681
|
// eslint-disable-next-line max-len -- The comment is long.
|
|
22604
22682
|
// eslint-disable-next-line @puppeteer/use-using -- These are not owned by this function.
|
|
22605
22683
|
for (const value of values) {
|
|
22606
|
-
void value.dispose().catch(
|
|
22684
|
+
void value.dispose().catch(debugCatchError);
|
|
22607
22685
|
}
|
|
22608
22686
|
}
|
|
22609
22687
|
return;
|
|
@@ -22906,22 +22984,20 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22906
22984
|
const targetUrl = target.url();
|
|
22907
22985
|
return target.type() === 'service_worker' && targetUrl.startsWith('chrome-extension://' + this.id);
|
|
22908
22986
|
});
|
|
22909
|
-
const workers =
|
|
22910
|
-
for (const target of extensionWorkers) {
|
|
22987
|
+
const workers = await Promise.all(extensionWorkers.map(async target => {
|
|
22911
22988
|
try {
|
|
22912
|
-
|
|
22913
|
-
if (worker) {
|
|
22914
|
-
workers.push(worker);
|
|
22915
|
-
}
|
|
22989
|
+
return await target.worker();
|
|
22916
22990
|
} catch (err) {
|
|
22917
22991
|
if (_assertClassBrand(_CdpExtension_brand, this, _canIgnoreError2).call(this, err)) {
|
|
22918
|
-
debugError(err);
|
|
22919
|
-
|
|
22992
|
+
debugError?.(err);
|
|
22993
|
+
return null;
|
|
22920
22994
|
}
|
|
22921
22995
|
throw err;
|
|
22922
22996
|
}
|
|
22923
|
-
}
|
|
22924
|
-
return workers
|
|
22997
|
+
}));
|
|
22998
|
+
return workers.filter(worker => {
|
|
22999
|
+
return worker !== null;
|
|
23000
|
+
});
|
|
22925
23001
|
}
|
|
22926
23002
|
async pages() {
|
|
22927
23003
|
const targets = _classPrivateFieldGet(_browser2, this).targets();
|
|
@@ -22934,7 +23010,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22934
23010
|
return await target.asPage();
|
|
22935
23011
|
} catch (err) {
|
|
22936
23012
|
if (_assertClassBrand(_CdpExtension_brand, this, _canIgnoreError2).call(this, err)) {
|
|
22937
|
-
debugError(err);
|
|
23013
|
+
debugError?.(err);
|
|
22938
23014
|
return null;
|
|
22939
23015
|
}
|
|
22940
23016
|
throw err;
|
|
@@ -23135,7 +23211,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
23135
23211
|
_classPrivateFieldSet(_defaultViewport, this, defaultViewport ?? undefined);
|
|
23136
23212
|
}
|
|
23137
23213
|
_initialize() {
|
|
23138
|
-
this._initializedDeferred.valueOrThrow().then(async result => {
|
|
23214
|
+
void this._initializedDeferred.valueOrThrow().then(async result => {
|
|
23139
23215
|
if (result === exports.InitializationStatus.ABORTED) {
|
|
23140
23216
|
return;
|
|
23141
23217
|
}
|
|
@@ -23153,7 +23229,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
23153
23229
|
const popupPage = await this.page();
|
|
23154
23230
|
openerPage.emit("popup" /* PageEvent.Popup */, popupPage);
|
|
23155
23231
|
return true;
|
|
23156
|
-
}).catch(
|
|
23232
|
+
}).catch(debugCatchError);
|
|
23157
23233
|
this._checkIfInitialized();
|
|
23158
23234
|
}
|
|
23159
23235
|
async page() {
|
|
@@ -24237,12 +24313,12 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
24237
24313
|
_classPrivateFieldInitSpec(this, _blocklist, []);
|
|
24238
24314
|
_classPrivateFieldInitSpec(this, _allowlist, []);
|
|
24239
24315
|
_classPrivateFieldInitSpec(this, _silentDetach, async (session, parentSession) => {
|
|
24240
|
-
await session.send('Runtime.runIfWaitingForDebugger').catch(
|
|
24316
|
+
await session.send('Runtime.runIfWaitingForDebugger').catch(debugCatchError);
|
|
24241
24317
|
// We don't use `session.detach()` because that dispatches all commands on
|
|
24242
24318
|
// the connection instead of the parent session.
|
|
24243
24319
|
await parentSession.send('Target.detachFromTarget', {
|
|
24244
24320
|
sessionId: session.id()
|
|
24245
|
-
}).catch(
|
|
24321
|
+
}).catch(debugCatchError);
|
|
24246
24322
|
});
|
|
24247
24323
|
_classPrivateFieldInitSpec(this, _getParentTarget, parentSession => {
|
|
24248
24324
|
return parentSession instanceof CdpCDPSession ? parentSession.target() : null;
|
|
@@ -24311,6 +24387,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
24311
24387
|
throw new Error(`Session ${event.sessionId} was not created.`);
|
|
24312
24388
|
}
|
|
24313
24389
|
if (!_classPrivateFieldGet(_connection4, this).isAutoAttached(targetInfo.targetId)) {
|
|
24390
|
+
await _classPrivateFieldGet(_maybeSetupNetworkConditions, this).call(this, session, targetInfo);
|
|
24314
24391
|
return;
|
|
24315
24392
|
}
|
|
24316
24393
|
// If we connect to a browser that is already open,
|
|
@@ -24327,6 +24404,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
24327
24404
|
// should determine if a target is auto-attached or not with the help of
|
|
24328
24405
|
// CDP.
|
|
24329
24406
|
if (targetInfo.type === 'service_worker') {
|
|
24407
|
+
if (!this.isUrlAllowed(targetInfo.url)) {
|
|
24408
|
+
await Promise.all([_classPrivateFieldGet(_maybeSetupNetworkConditions, this).call(this, session, targetInfo), session.send('Runtime.runIfWaitingForDebugger')]).catch(debugCatchError);
|
|
24409
|
+
return;
|
|
24410
|
+
}
|
|
24330
24411
|
await _classPrivateFieldGet(_silentDetach, this).call(this, session, parentSession);
|
|
24331
24412
|
if (_classPrivateFieldGet(_attachedTargetsByTargetId, this).has(targetInfo.targetId) || _classPrivateFieldGet(_ignoredTargets, this).has(targetInfo.targetId) || !_classPrivateFieldGet(_discoveredTargetsByTargetId, this).has(targetInfo.targetId)) {
|
|
24332
24413
|
return;
|
|
@@ -24371,14 +24452,14 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
24371
24452
|
if (parentTarget?.type() === 'tab') {
|
|
24372
24453
|
_assertClassBrand(_TargetManager_brand, this, _finishInitializationIfReady).call(this, parentTarget._targetId);
|
|
24373
24454
|
}
|
|
24374
|
-
//
|
|
24375
|
-
//
|
|
24455
|
+
// The browser might be shutting down here, so we
|
|
24456
|
+
// ignore potential errors.
|
|
24376
24457
|
await Promise.all([session.send('Target.setAutoAttach', {
|
|
24377
24458
|
waitForDebuggerOnStart: true,
|
|
24378
24459
|
flatten: true,
|
|
24379
24460
|
autoAttach: true,
|
|
24380
24461
|
filter: _classPrivateFieldGet(_discoveryFilter, this)
|
|
24381
|
-
}), _classPrivateFieldGet(_maybeSetupNetworkConditions, this).call(this, session), session.send('Runtime.runIfWaitingForDebugger')]).catch(
|
|
24462
|
+
}), _classPrivateFieldGet(_maybeSetupNetworkConditions, this).call(this, session, targetInfo), session.send('Runtime.runIfWaitingForDebugger')]).catch(debugCatchError);
|
|
24382
24463
|
});
|
|
24383
24464
|
_classPrivateFieldInitSpec(this, _onDetachedFromTarget2, (parentSession, event) => {
|
|
24384
24465
|
const target = _classPrivateFieldGet(_attachedTargetsBySessionId, this).get(event.sessionId);
|
|
@@ -24418,7 +24499,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
24418
24499
|
}
|
|
24419
24500
|
return true;
|
|
24420
24501
|
});
|
|
24421
|
-
_classPrivateFieldInitSpec(this, _maybeSetupNetworkConditions, async session => {
|
|
24502
|
+
_classPrivateFieldInitSpec(this, _maybeSetupNetworkConditions, async (session, targetInfo) => {
|
|
24422
24503
|
if (_classPrivateFieldGet(_blocklist, this).length === 0 && _classPrivateFieldGet(_allowlist, this).length === 0) {
|
|
24423
24504
|
return;
|
|
24424
24505
|
}
|
|
@@ -24450,10 +24531,16 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
24450
24531
|
uploadThroughput: -1
|
|
24451
24532
|
});
|
|
24452
24533
|
}
|
|
24453
|
-
|
|
24534
|
+
const needsNetwork = targetInfo.type === 'worker' || targetInfo.type === 'service_worker' || targetInfo.type === 'shared_worker';
|
|
24535
|
+
const promises = [];
|
|
24536
|
+
if (needsNetwork) {
|
|
24537
|
+
promises.push(session.send('Network.enable'));
|
|
24538
|
+
}
|
|
24539
|
+
promises.push(session.send('Network.emulateNetworkConditionsByRule', {
|
|
24454
24540
|
offline: _classPrivateFieldGet(_blocklist, this).length > 0 ? true : undefined,
|
|
24455
24541
|
matchedNetworkConditions
|
|
24456
|
-
});
|
|
24542
|
+
}));
|
|
24543
|
+
await Promise.all(promises).catch(debugCatchError);
|
|
24457
24544
|
});
|
|
24458
24545
|
if (blocklist && allowlist) {
|
|
24459
24546
|
throw new Error('Cannot specify both blockList and allowList');
|
|
@@ -24585,6 +24672,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
24585
24672
|
var _targetManager3 = /*#__PURE__*/new WeakMap();
|
|
24586
24673
|
var _handleDevToolsAsPage = /*#__PURE__*/new WeakMap();
|
|
24587
24674
|
var _extensions = /*#__PURE__*/new WeakMap();
|
|
24675
|
+
var _version2 = /*#__PURE__*/new WeakMap();
|
|
24588
24676
|
var _emitDisconnected = /*#__PURE__*/new WeakMap();
|
|
24589
24677
|
var _CdpBrowser_brand = /*#__PURE__*/new WeakSet();
|
|
24590
24678
|
var _createTarget = /*#__PURE__*/new WeakMap();
|
|
@@ -24627,6 +24715,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
24627
24715
|
_classPrivateFieldInitSpec(this, _targetManager3, void 0);
|
|
24628
24716
|
_classPrivateFieldInitSpec(this, _handleDevToolsAsPage, false);
|
|
24629
24717
|
_classPrivateFieldInitSpec(this, _extensions, new Map());
|
|
24718
|
+
_classPrivateFieldInitSpec(this, _version2, void 0);
|
|
24630
24719
|
_classPrivateFieldInitSpec(this, _emitDisconnected, () => {
|
|
24631
24720
|
this.emit("disconnected" /* BrowserEvent.Disconnected */, undefined);
|
|
24632
24721
|
});
|
|
@@ -24974,8 +25063,16 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
24974
25063
|
return target.type() === 'page' || target.type() === 'background_page' || target.type() === 'webview' || _classPrivateFieldGet(_handleDevToolsAsPage, this) && target.type() === 'other' && isDevToolsPageTarget(target.url());
|
|
24975
25064
|
}));
|
|
24976
25065
|
}
|
|
24977
|
-
function _getVersion() {
|
|
24978
|
-
|
|
25066
|
+
async function _getVersion() {
|
|
25067
|
+
if (!_classPrivateFieldGet(_version2, this)) {
|
|
25068
|
+
_classPrivateFieldSet(_version2, this, Deferred.create());
|
|
25069
|
+
try {
|
|
25070
|
+
_classPrivateFieldGet(_version2, this).resolve(await _classPrivateFieldGet(_connection5, this).send('Browser.getVersion'));
|
|
25071
|
+
} catch (error) {
|
|
25072
|
+
_classPrivateFieldGet(_version2, this).reject(error);
|
|
25073
|
+
}
|
|
25074
|
+
}
|
|
25075
|
+
return await _classPrivateFieldGet(_version2, this).valueOrThrow();
|
|
24979
25076
|
}
|
|
24980
25077
|
async function _connectToCdpBrowser(connectionTransport, url, options) {
|
|
24981
25078
|
const {
|
|
@@ -24998,7 +25095,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
24998
25095
|
browserContextIds
|
|
24999
25096
|
} = await connection.send('Target.getBrowserContexts');
|
|
25000
25097
|
const browser = await CdpBrowser._create(connection, browserContextIds, acceptInsecureCerts, defaultViewport, downloadBehavior, undefined, () => {
|
|
25001
|
-
return connection.send('Browser.close').catch(
|
|
25098
|
+
return connection.send('Browser.close').catch(debugCatchError);
|
|
25002
25099
|
}, targetFilter, isPageTarget, undefined, networkEnabled, issuesEnabled, handleDevToolsAsPage, blocklist, allowlist);
|
|
25003
25100
|
return browser;
|
|
25004
25101
|
}
|
|
@@ -25287,7 +25384,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
25287
25384
|
}
|
|
25288
25385
|
});
|
|
25289
25386
|
// Silently log all errors - we don't know what to do with them.
|
|
25290
|
-
_classPrivateFieldGet(_ws, this).addEventListener('error',
|
|
25387
|
+
_classPrivateFieldGet(_ws, this).addEventListener('error', debugCatchError);
|
|
25291
25388
|
}
|
|
25292
25389
|
send(message) {
|
|
25293
25390
|
_classPrivateFieldGet(_ws, this).send(message);
|
|
@@ -26835,7 +26932,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
26835
26932
|
return {
|
|
26836
26933
|
bidiConnection: pureBidiConnection,
|
|
26837
26934
|
closeCallback: async () => {
|
|
26838
|
-
await pureBidiConnection.send('browser.close', {}).catch(
|
|
26935
|
+
await pureBidiConnection.send('browser.close', {}).catch(debugCatchError);
|
|
26839
26936
|
}
|
|
26840
26937
|
};
|
|
26841
26938
|
}
|
|
@@ -26859,7 +26956,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
26859
26956
|
bidiConnection: bidiOverCdpConnection,
|
|
26860
26957
|
closeCallback: async () => {
|
|
26861
26958
|
// In case of BiDi over CDP, we need to close browser via CDP.
|
|
26862
|
-
await cdpConnection.send('Browser.close').catch(
|
|
26959
|
+
await cdpConnection.send('Browser.close').catch(debugCatchError);
|
|
26863
26960
|
}
|
|
26864
26961
|
};
|
|
26865
26962
|
}
|
|
@@ -26887,6 +26984,16 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
26887
26984
|
if (options.protocol === 'webDriverBiDi' && (options.blocklist || options.allowlist)) {
|
|
26888
26985
|
throw new Error('blocklist and allowlist are only supported with the CDP protocol');
|
|
26889
26986
|
}
|
|
26987
|
+
if (options.blocklist) {
|
|
26988
|
+
for (const rule of options.blocklist) {
|
|
26989
|
+
new Y(rule);
|
|
26990
|
+
}
|
|
26991
|
+
}
|
|
26992
|
+
if (options.allowlist) {
|
|
26993
|
+
for (const rule of options.allowlist) {
|
|
26994
|
+
new Y(rule);
|
|
26995
|
+
}
|
|
26996
|
+
}
|
|
26890
26997
|
}
|
|
26891
26998
|
async function _connectToBrowser(options) {
|
|
26892
26999
|
assertSupportedUrlRestrictions(options);
|
|
@@ -27132,9 +27239,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
27132
27239
|
* @internal
|
|
27133
27240
|
*/
|
|
27134
27241
|
const PUPPETEER_REVISIONS = Object.freeze({
|
|
27135
|
-
chrome: '
|
|
27136
|
-
'chrome-headless-shell': '
|
|
27137
|
-
firefox: '
|
|
27242
|
+
chrome: '150.0.7871.24',
|
|
27243
|
+
'chrome-headless-shell': '150.0.7871.24',
|
|
27244
|
+
firefox: 'stable_152.0.2'
|
|
27138
27245
|
});
|
|
27139
27246
|
|
|
27140
27247
|
/**
|
|
@@ -27293,6 +27400,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
27293
27400
|
exports.createProtocolErrorMessage = createProtocolErrorMessage;
|
|
27294
27401
|
exports.customQueryHandlers = customQueryHandlers;
|
|
27295
27402
|
exports.debug = debug;
|
|
27403
|
+
exports.debugCatchError = debugCatchError;
|
|
27296
27404
|
exports.debugError = debugError;
|
|
27297
27405
|
exports.default = puppeteer;
|
|
27298
27406
|
exports.disposeSymbol = disposeSymbol;
|
|
@@ -27308,7 +27416,6 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
27308
27416
|
exports.getSourceUrlComment = getSourceUrlComment;
|
|
27309
27417
|
exports.handleError = handleError;
|
|
27310
27418
|
exports.headersArray = headersArray;
|
|
27311
|
-
exports.importDebug = importDebug;
|
|
27312
27419
|
exports.isDate = isDate;
|
|
27313
27420
|
exports.isErrnoException = isErrnoException;
|
|
27314
27421
|
exports.isErrorLike = isErrorLike;
|