chrome-devtools-frontend 1.0.1615539 → 1.0.1616061
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/front_end/generated/InspectorBackendCommands.ts +2 -1
- package/front_end/generated/SupportedCSSProperties.js +4 -0
- package/front_end/generated/protocol-mapping.d.ts +7 -0
- package/front_end/generated/protocol-proxy-api.d.ts +5 -0
- package/front_end/generated/protocol.ts +11 -0
- package/front_end/models/ai_assistance/agents/AiAgent.ts +5 -4
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +3 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +85 -47
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +32 -0
- package/front_end/models/bindings/SymbolizedError.ts +20 -0
- package/front_end/models/bindings/bindings.ts +2 -0
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +28 -23
- package/front_end/panels/ai_assistance/components/chatMessage.css +1 -1
- package/front_end/panels/elements/PropertiesWidget.ts +8 -8
- 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 +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +12 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Extension.d.ts +74 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Extension.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Extension.js +68 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Extension.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts +8 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Issue.d.ts +22 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Issue.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Issue.js +8 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Issue.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +35 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Realm.d.ts +106 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Realm.js +29 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/WebWorker.d.ts +24 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/WebWorker.js +15 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +8 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.js +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js +6 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +9 -47
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.js +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +8 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +14 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Realm.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Realm.js +21 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Target.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Target.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Target.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.js +18 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.d.ts +28 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.js +67 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +9 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +56 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpIssue.d.ts +17 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpIssue.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpIssue.js +27 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpIssue.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Extension.d.ts +16 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Extension.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Extension.js +79 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Extension.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts +10 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.js +26 -15
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.js +38 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/IsolatedWorld.d.ts +9 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/IsolatedWorld.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/IsolatedWorld.js +31 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/IsolatedWorld.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +6 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +49 -35
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Target.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Target.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Target.js +16 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Target.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js +9 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebMCP.d.ts +218 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebMCP.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebMCP.js +288 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebMCP.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.d.ts +4 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js +28 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.d.ts +9 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.js +36 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/utils.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/types.d.ts +0 -11
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/types.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +7851 -6616
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +1017 -305
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +12 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Extension.d.ts +74 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Extension.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Extension.js +64 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Extension.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts +8 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Issue.d.ts +22 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Issue.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Issue.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Issue.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +35 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Realm.d.ts +106 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Realm.js +29 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/WebWorker.d.ts +24 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/WebWorker.js +14 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +8 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.js +2 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js +6 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +8 -46
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.js +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +8 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +14 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Realm.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Realm.js +22 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Target.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Target.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Target.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Realm.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Realm.js +18 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.d.ts +28 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.js +62 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +9 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +56 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpIssue.d.ts +17 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpIssue.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpIssue.js +23 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpIssue.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Extension.d.ts +16 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Extension.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Extension.js +75 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Extension.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts +10 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.js +26 -15
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.js +38 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/IsolatedWorld.d.ts +9 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/IsolatedWorld.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/IsolatedWorld.js +31 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/IsolatedWorld.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +6 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +49 -35
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Target.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Target.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Target.js +16 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Target.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js +9 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebMCP.d.ts +218 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebMCP.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebMCP.js +282 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebMCP.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.d.ts +4 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js +29 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.d.ts +9 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.js +34 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/utils.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/types.d.ts +0 -11
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/types.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/injected.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/puppeteer-core-browser.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/puppeteer-core-browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/Mutex.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/Mutex.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +7851 -6616
- package/front_end/third_party/puppeteer/package/package.json +5 -6
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +13 -0
- package/front_end/third_party/puppeteer/package/src/api/Extension.ts +98 -0
- package/front_end/third_party/puppeteer/package/src/api/Frame.ts +9 -0
- package/front_end/third_party/puppeteer/package/src/api/Issue.ts +24 -0
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +38 -0
- package/front_end/third_party/puppeteer/package/src/api/Realm.ts +111 -12
- package/front_end/third_party/puppeteer/package/src/api/WebWorker.ts +26 -4
- package/front_end/third_party/puppeteer/package/src/api/api.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +12 -0
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserConnector.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +7 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +13 -67
- package/front_end/third_party/puppeteer/package/src/bidi/Input.ts +0 -1
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +21 -2
- package/front_end/third_party/puppeteer/package/src/bidi/Realm.ts +39 -1
- package/front_end/third_party/puppeteer/package/src/bidi/Target.ts +2 -5
- package/front_end/third_party/puppeteer/package/src/bidi/core/Realm.ts +23 -0
- package/front_end/third_party/puppeteer/package/src/bidi/util.ts +94 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +75 -2
- package/front_end/third_party/puppeteer/package/src/cdp/BrowserConnector.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/cdp/CdpIssue.ts +30 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Extension.ts +101 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +32 -22
- package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +44 -3
- package/front_end/third_party/puppeteer/package/src/cdp/IsolatedWorld.ts +40 -2
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +61 -47
- package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +17 -7
- package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +14 -1
- package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +441 -0
- package/front_end/third_party/puppeteer/package/src/cdp/WebWorker.ts +38 -12
- package/front_end/third_party/puppeteer/package/src/cdp/cdp.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/cdp/utils.ts +52 -0
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +7 -0
- package/front_end/third_party/puppeteer/package/src/common/types.ts +0 -14
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +7 -0
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +0 -1
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/Mutex.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +5 -0
- package/front_end/ui/legacy/Treeoutline.ts +13 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +1 -1
|
@@ -3049,7 +3049,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
3049
3049
|
*/
|
|
3050
3050
|
// If moved update release-please config
|
|
3051
3051
|
// x-release-please-start-version
|
|
3052
|
-
const packageVersion = '24.
|
|
3052
|
+
const packageVersion = '24.41.0';
|
|
3053
3053
|
// x-release-please-end
|
|
3054
3054
|
|
|
3055
3055
|
/**
|
|
@@ -4063,7 +4063,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
4063
4063
|
async acquire(onRelease) {
|
|
4064
4064
|
if (!_classPrivateFieldGet(_locked, this)) {
|
|
4065
4065
|
_classPrivateFieldSet(_locked, this, true);
|
|
4066
|
-
return new Mutex.Guard(this);
|
|
4066
|
+
return new Mutex.Guard(this, onRelease);
|
|
4067
4067
|
}
|
|
4068
4068
|
const deferred = Deferred.create();
|
|
4069
4069
|
_classPrivateFieldGet(_acquirers, this).push(deferred.resolve.bind(deferred));
|
|
@@ -8728,6 +8728,73 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
8728
8728
|
box.y = Math.max(box.y, 0);
|
|
8729
8729
|
}
|
|
8730
8730
|
|
|
8731
|
+
/**
|
|
8732
|
+
* @license
|
|
8733
|
+
* Copyright 2026 Google Inc.
|
|
8734
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
8735
|
+
*/
|
|
8736
|
+
/**
|
|
8737
|
+
* {@link Extension} represents a browser extension installed in the browser.
|
|
8738
|
+
* It provides access to the extension's ID, name, and version, as well as
|
|
8739
|
+
* methods for interacting with the extension's background workers and pages.
|
|
8740
|
+
*
|
|
8741
|
+
* @example
|
|
8742
|
+
* To get all extensions installed in the browser:
|
|
8743
|
+
*
|
|
8744
|
+
* ```ts
|
|
8745
|
+
* const extensions = await browser.extensions();
|
|
8746
|
+
* for (const [id, extension] of extensions) {
|
|
8747
|
+
* console.log(extension.name, id);
|
|
8748
|
+
* }
|
|
8749
|
+
* ```
|
|
8750
|
+
*
|
|
8751
|
+
* @experimental
|
|
8752
|
+
* @public
|
|
8753
|
+
*/
|
|
8754
|
+
var _id2 = /*#__PURE__*/new WeakMap();
|
|
8755
|
+
var _version = /*#__PURE__*/new WeakMap();
|
|
8756
|
+
var _name = /*#__PURE__*/new WeakMap();
|
|
8757
|
+
class Extension {
|
|
8758
|
+
/**
|
|
8759
|
+
* @internal
|
|
8760
|
+
*/
|
|
8761
|
+
constructor(id, version, name) {
|
|
8762
|
+
_classPrivateFieldInitSpec(this, _id2, void 0);
|
|
8763
|
+
_classPrivateFieldInitSpec(this, _version, void 0);
|
|
8764
|
+
_classPrivateFieldInitSpec(this, _name, void 0);
|
|
8765
|
+
if (!id || !version) {
|
|
8766
|
+
throw new Error('Extension ID and version are required');
|
|
8767
|
+
}
|
|
8768
|
+
_classPrivateFieldSet(_id2, this, id);
|
|
8769
|
+
_classPrivateFieldSet(_version, this, version);
|
|
8770
|
+
_classPrivateFieldSet(_name, this, name);
|
|
8771
|
+
}
|
|
8772
|
+
/**
|
|
8773
|
+
* The version of the extension as specified in its manifest.
|
|
8774
|
+
*
|
|
8775
|
+
* @public
|
|
8776
|
+
*/
|
|
8777
|
+
get version() {
|
|
8778
|
+
return _classPrivateFieldGet(_version, this);
|
|
8779
|
+
}
|
|
8780
|
+
/**
|
|
8781
|
+
* The name of the extension as specified in its manifest.
|
|
8782
|
+
*
|
|
8783
|
+
* @public
|
|
8784
|
+
*/
|
|
8785
|
+
get name() {
|
|
8786
|
+
return _classPrivateFieldGet(_name, this);
|
|
8787
|
+
}
|
|
8788
|
+
/**
|
|
8789
|
+
* The unique identifier of the extension.
|
|
8790
|
+
*
|
|
8791
|
+
* @public
|
|
8792
|
+
*/
|
|
8793
|
+
get id() {
|
|
8794
|
+
return _classPrivateFieldGet(_id2, this);
|
|
8795
|
+
}
|
|
8796
|
+
}
|
|
8797
|
+
|
|
8731
8798
|
/**
|
|
8732
8799
|
* @license
|
|
8733
8800
|
* Copyright 2023 Google Inc.
|
|
@@ -12429,16 +12496,43 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
12429
12496
|
* SPDX-License-Identifier: Apache-2.0
|
|
12430
12497
|
*/
|
|
12431
12498
|
/**
|
|
12432
|
-
* @
|
|
12499
|
+
* @public
|
|
12433
12500
|
*/
|
|
12434
12501
|
var _disposed3 = /*#__PURE__*/new WeakMap();
|
|
12435
12502
|
class Realm {
|
|
12503
|
+
/** @internal */
|
|
12436
12504
|
constructor(timeoutSettings) {
|
|
12505
|
+
/** @internal */
|
|
12437
12506
|
_defineProperty(this, "timeoutSettings", void 0);
|
|
12507
|
+
/** @internal */
|
|
12438
12508
|
_defineProperty(this, "taskManager", new TaskManager());
|
|
12439
12509
|
_classPrivateFieldInitSpec(this, _disposed3, false);
|
|
12440
12510
|
this.timeoutSettings = timeoutSettings;
|
|
12441
12511
|
}
|
|
12512
|
+
/**
|
|
12513
|
+
* Waits for a function to return a truthy value when evaluated in
|
|
12514
|
+
* the realm's context.
|
|
12515
|
+
*
|
|
12516
|
+
* Arguments can be passed from Node.js to `pageFunction`.
|
|
12517
|
+
*
|
|
12518
|
+
* @example
|
|
12519
|
+
*
|
|
12520
|
+
* ```ts
|
|
12521
|
+
* const selector = '.foo';
|
|
12522
|
+
* await realm.waitForFunction(
|
|
12523
|
+
* selector => !!document.querySelector(selector),
|
|
12524
|
+
* {},
|
|
12525
|
+
* selector,
|
|
12526
|
+
* );
|
|
12527
|
+
* ```
|
|
12528
|
+
*
|
|
12529
|
+
* @param pageFunction - A function to evaluate in the realm.
|
|
12530
|
+
* @param options - Options for polling and timeouts.
|
|
12531
|
+
* @param args - Arguments to pass to the function.
|
|
12532
|
+
* @returns A promise that resolves when the function returns a truthy
|
|
12533
|
+
* value.
|
|
12534
|
+
* @public
|
|
12535
|
+
*/
|
|
12442
12536
|
async waitForFunction(pageFunction, options = {}, ...args) {
|
|
12443
12537
|
const {
|
|
12444
12538
|
polling = 'raf',
|
|
@@ -12457,6 +12551,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
12457
12551
|
}, pageFunction, ...args);
|
|
12458
12552
|
return await waitTask.result;
|
|
12459
12553
|
}
|
|
12554
|
+
/** @internal */
|
|
12460
12555
|
get disposed() {
|
|
12461
12556
|
return _classPrivateFieldGet(_disposed3, this);
|
|
12462
12557
|
}
|
|
@@ -12525,6 +12620,20 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
12525
12620
|
* Copyright 2018 Google Inc.
|
|
12526
12621
|
* SPDX-License-Identifier: Apache-2.0
|
|
12527
12622
|
*/
|
|
12623
|
+
/**
|
|
12624
|
+
* @public
|
|
12625
|
+
*/
|
|
12626
|
+
exports.WebWorkerEvent = void 0;
|
|
12627
|
+
(function (WebWorkerEvent) {
|
|
12628
|
+
/**
|
|
12629
|
+
* Emitted when the worker calls a console API.
|
|
12630
|
+
*/
|
|
12631
|
+
WebWorkerEvent["Console"] = "console";
|
|
12632
|
+
/**
|
|
12633
|
+
* Emitted when the worker throws an exception.
|
|
12634
|
+
*/
|
|
12635
|
+
WebWorkerEvent["Error"] = "error";
|
|
12636
|
+
})(exports.WebWorkerEvent || (exports.WebWorkerEvent = {}));
|
|
12528
12637
|
/**
|
|
12529
12638
|
* This class represents a
|
|
12530
12639
|
* {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API | WebWorker}.
|
|
@@ -12887,7 +12996,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
12887
12996
|
var _modal = /*#__PURE__*/new WeakMap();
|
|
12888
12997
|
var _hasErrormessage = /*#__PURE__*/new WeakMap();
|
|
12889
12998
|
var _hasDetails = /*#__PURE__*/new WeakMap();
|
|
12890
|
-
var
|
|
12999
|
+
var _name2 = /*#__PURE__*/new WeakMap();
|
|
12891
13000
|
var _role = /*#__PURE__*/new WeakMap();
|
|
12892
13001
|
var _description = /*#__PURE__*/new WeakMap();
|
|
12893
13002
|
var _roledescription = /*#__PURE__*/new WeakMap();
|
|
@@ -12910,7 +13019,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
12910
13019
|
_classPrivateFieldInitSpec(this, _modal, false);
|
|
12911
13020
|
_classPrivateFieldInitSpec(this, _hasErrormessage, false);
|
|
12912
13021
|
_classPrivateFieldInitSpec(this, _hasDetails, false);
|
|
12913
|
-
_classPrivateFieldInitSpec(this,
|
|
13022
|
+
_classPrivateFieldInitSpec(this, _name2, void 0);
|
|
12914
13023
|
_classPrivateFieldInitSpec(this, _role, void 0);
|
|
12915
13024
|
_classPrivateFieldInitSpec(this, _description, void 0);
|
|
12916
13025
|
_classPrivateFieldInitSpec(this, _roledescription, void 0);
|
|
@@ -12921,7 +13030,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
12921
13030
|
this.payload = payload;
|
|
12922
13031
|
_classPrivateFieldSet(_role, this, this.payload.role ? this.payload.role.value : 'Unknown');
|
|
12923
13032
|
_classPrivateFieldSet(_ignored, this, this.payload.ignored);
|
|
12924
|
-
_classPrivateFieldSet(
|
|
13033
|
+
_classPrivateFieldSet(_name2, this, this.payload.name ? this.payload.name.value : '');
|
|
12925
13034
|
_classPrivateFieldSet(_description, this, this.payload.description ? this.payload.description.value : undefined);
|
|
12926
13035
|
_classPrivateFieldSet(_realm2, this, realm);
|
|
12927
13036
|
for (const property of this.payload.properties || []) {
|
|
@@ -12997,7 +13106,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
12997
13106
|
if (_assertClassBrand(_AXNode_brand, this, _hasFocusableChild).call(this)) {
|
|
12998
13107
|
return false;
|
|
12999
13108
|
}
|
|
13000
|
-
if (_classPrivateFieldGet(_role, this) === 'heading' && _classPrivateFieldGet(
|
|
13109
|
+
if (_classPrivateFieldGet(_role, this) === 'heading' && _classPrivateFieldGet(_name2, this)) {
|
|
13001
13110
|
return true;
|
|
13002
13111
|
}
|
|
13003
13112
|
return false;
|
|
@@ -13064,7 +13173,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
13064
13173
|
if (insideControl) {
|
|
13065
13174
|
return false;
|
|
13066
13175
|
}
|
|
13067
|
-
return this.isLeafNode() && (!!_classPrivateFieldGet(
|
|
13176
|
+
return this.isLeafNode() && (!!_classPrivateFieldGet(_name2, this) || !!_classPrivateFieldGet(_description, this));
|
|
13068
13177
|
}
|
|
13069
13178
|
serialize() {
|
|
13070
13179
|
const properties = new Map();
|
|
@@ -13276,20 +13385,20 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
13276
13385
|
/**
|
|
13277
13386
|
* @internal
|
|
13278
13387
|
*/
|
|
13279
|
-
var
|
|
13388
|
+
var _name3 = /*#__PURE__*/new WeakMap();
|
|
13280
13389
|
var _fn2 = /*#__PURE__*/new WeakMap();
|
|
13281
13390
|
var _initSource = /*#__PURE__*/new WeakMap();
|
|
13282
13391
|
class Binding {
|
|
13283
13392
|
constructor(name, fn, initSource) {
|
|
13284
|
-
_classPrivateFieldInitSpec(this,
|
|
13393
|
+
_classPrivateFieldInitSpec(this, _name3, void 0);
|
|
13285
13394
|
_classPrivateFieldInitSpec(this, _fn2, void 0);
|
|
13286
13395
|
_classPrivateFieldInitSpec(this, _initSource, void 0);
|
|
13287
|
-
_classPrivateFieldSet(
|
|
13396
|
+
_classPrivateFieldSet(_name3, this, name);
|
|
13288
13397
|
_classPrivateFieldSet(_fn2, this, fn);
|
|
13289
13398
|
_classPrivateFieldSet(_initSource, this, initSource);
|
|
13290
13399
|
}
|
|
13291
13400
|
get name() {
|
|
13292
|
-
return _classPrivateFieldGet(
|
|
13401
|
+
return _classPrivateFieldGet(_name3, this);
|
|
13293
13402
|
}
|
|
13294
13403
|
get initSource() {
|
|
13295
13404
|
return _classPrivateFieldGet(_initSource, this);
|
|
@@ -13315,7 +13424,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
13315
13424
|
const handles = __addDisposableResource$3(env_1, await context.evaluateHandle((name, seq) => {
|
|
13316
13425
|
// @ts-expect-error Code is evaluated in a different context.
|
|
13317
13426
|
return globalThis[name].args.get(seq);
|
|
13318
|
-
}, _classPrivateFieldGet(
|
|
13427
|
+
}, _classPrivateFieldGet(_name3, this), id), false);
|
|
13319
13428
|
const properties = await handles.getProperties();
|
|
13320
13429
|
for (const [index, handle] of properties) {
|
|
13321
13430
|
// This is not straight-forward since some arguments can stringify, but
|
|
@@ -13344,7 +13453,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
13344
13453
|
const callbacks = globalThis[name].callbacks;
|
|
13345
13454
|
callbacks.get(seq).resolve(result);
|
|
13346
13455
|
callbacks.delete(seq);
|
|
13347
|
-
}, _classPrivateFieldGet(
|
|
13456
|
+
}, _classPrivateFieldGet(_name3, this), id, await _classPrivateFieldGet(_fn2, this).call(this, ...args));
|
|
13348
13457
|
for (const arg of args) {
|
|
13349
13458
|
if (arg instanceof JSHandle) {
|
|
13350
13459
|
stack.use(arg);
|
|
@@ -13359,14 +13468,14 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
13359
13468
|
const callbacks = globalThis[name].callbacks;
|
|
13360
13469
|
callbacks.get(seq).reject(error);
|
|
13361
13470
|
callbacks.delete(seq);
|
|
13362
|
-
}, _classPrivateFieldGet(
|
|
13471
|
+
}, _classPrivateFieldGet(_name3, this), id, error.message, error.stack).catch(debugError);
|
|
13363
13472
|
} else {
|
|
13364
13473
|
await context.evaluate((name, seq, error) => {
|
|
13365
13474
|
// @ts-expect-error Code is evaluated in a different context.
|
|
13366
13475
|
const callbacks = globalThis[name].callbacks;
|
|
13367
13476
|
callbacks.get(seq).reject(error);
|
|
13368
13477
|
callbacks.delete(seq);
|
|
13369
|
-
}, _classPrivateFieldGet(
|
|
13478
|
+
}, _classPrivateFieldGet(_name3, this), id, error).catch(debugError);
|
|
13370
13479
|
}
|
|
13371
13480
|
}
|
|
13372
13481
|
}
|
|
@@ -13677,19 +13786,19 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
13677
13786
|
/**
|
|
13678
13787
|
* @internal
|
|
13679
13788
|
*/
|
|
13680
|
-
var
|
|
13789
|
+
var _id3 = /*#__PURE__*/new WeakMap();
|
|
13681
13790
|
var _error2 = /*#__PURE__*/new WeakMap();
|
|
13682
13791
|
var _deferred = /*#__PURE__*/new WeakMap();
|
|
13683
13792
|
var _timer = /*#__PURE__*/new WeakMap();
|
|
13684
13793
|
var _label = /*#__PURE__*/new WeakMap();
|
|
13685
13794
|
class Callback {
|
|
13686
13795
|
constructor(id, label, timeout) {
|
|
13687
|
-
_classPrivateFieldInitSpec(this,
|
|
13796
|
+
_classPrivateFieldInitSpec(this, _id3, void 0);
|
|
13688
13797
|
_classPrivateFieldInitSpec(this, _error2, new ProtocolError());
|
|
13689
13798
|
_classPrivateFieldInitSpec(this, _deferred, Deferred.create());
|
|
13690
13799
|
_classPrivateFieldInitSpec(this, _timer, void 0);
|
|
13691
13800
|
_classPrivateFieldInitSpec(this, _label, void 0);
|
|
13692
|
-
_classPrivateFieldSet(
|
|
13801
|
+
_classPrivateFieldSet(_id3, this, id);
|
|
13693
13802
|
_classPrivateFieldSet(_label, this, label);
|
|
13694
13803
|
if (timeout) {
|
|
13695
13804
|
_classPrivateFieldSet(_timer, this, setTimeout(() => {
|
|
@@ -13706,7 +13815,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
13706
13815
|
_classPrivateFieldGet(_deferred, this).reject(error);
|
|
13707
13816
|
}
|
|
13708
13817
|
get id() {
|
|
13709
|
-
return _classPrivateFieldGet(
|
|
13818
|
+
return _classPrivateFieldGet(_id3, this);
|
|
13710
13819
|
}
|
|
13711
13820
|
get promise() {
|
|
13712
13821
|
return _classPrivateFieldGet(_deferred, this).valueOrThrow();
|
|
@@ -15129,6 +15238,31 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
15129
15238
|
}
|
|
15130
15239
|
})();
|
|
15131
15240
|
|
|
15241
|
+
/**
|
|
15242
|
+
* @license
|
|
15243
|
+
* Copyright 2026 Google Inc.
|
|
15244
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
15245
|
+
*/
|
|
15246
|
+
/**
|
|
15247
|
+
* @internal
|
|
15248
|
+
*/
|
|
15249
|
+
var _code2 = /*#__PURE__*/new WeakMap();
|
|
15250
|
+
var _details = /*#__PURE__*/new WeakMap();
|
|
15251
|
+
class CdpIssue {
|
|
15252
|
+
constructor(issue) {
|
|
15253
|
+
_classPrivateFieldInitSpec(this, _code2, void 0);
|
|
15254
|
+
_classPrivateFieldInitSpec(this, _details, void 0);
|
|
15255
|
+
_classPrivateFieldSet(_code2, this, issue.code);
|
|
15256
|
+
_classPrivateFieldSet(_details, this, issue.details);
|
|
15257
|
+
}
|
|
15258
|
+
get code() {
|
|
15259
|
+
return _classPrivateFieldGet(_code2, this);
|
|
15260
|
+
}
|
|
15261
|
+
get details() {
|
|
15262
|
+
return _classPrivateFieldGet(_details, this);
|
|
15263
|
+
}
|
|
15264
|
+
}
|
|
15265
|
+
|
|
15132
15266
|
/**
|
|
15133
15267
|
* @license
|
|
15134
15268
|
* Copyright 2024 Google Inc.
|
|
@@ -15137,7 +15271,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
15137
15271
|
/**
|
|
15138
15272
|
* @internal
|
|
15139
15273
|
*/
|
|
15140
|
-
var
|
|
15274
|
+
var _id4 = /*#__PURE__*/new WeakMap();
|
|
15141
15275
|
var _source = /*#__PURE__*/new WeakMap();
|
|
15142
15276
|
var _frameToId = /*#__PURE__*/new WeakMap();
|
|
15143
15277
|
class CdpPreloadScript {
|
|
@@ -15150,15 +15284,15 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
15150
15284
|
* addScriptToEvaluateOnNewDocument is called for each subframe. But
|
|
15151
15285
|
* users only see this ID and subframe IDs are internal to Puppeteer.
|
|
15152
15286
|
*/
|
|
15153
|
-
_classPrivateFieldInitSpec(this,
|
|
15287
|
+
_classPrivateFieldInitSpec(this, _id4, void 0);
|
|
15154
15288
|
_classPrivateFieldInitSpec(this, _source, void 0);
|
|
15155
15289
|
_classPrivateFieldInitSpec(this, _frameToId, new WeakMap());
|
|
15156
|
-
_classPrivateFieldSet(
|
|
15290
|
+
_classPrivateFieldSet(_id4, this, id);
|
|
15157
15291
|
_classPrivateFieldSet(_source, this, source);
|
|
15158
15292
|
_classPrivateFieldGet(_frameToId, this).set(mainFrame, id);
|
|
15159
15293
|
}
|
|
15160
15294
|
get id() {
|
|
15161
|
-
return _classPrivateFieldGet(
|
|
15295
|
+
return _classPrivateFieldGet(_id4, this);
|
|
15162
15296
|
}
|
|
15163
15297
|
get source() {
|
|
15164
15298
|
return _classPrivateFieldGet(_source, this);
|
|
@@ -15181,7 +15315,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
15181
15315
|
*/
|
|
15182
15316
|
var _client6 = /*#__PURE__*/new WeakMap();
|
|
15183
15317
|
var _timeoutSettings = /*#__PURE__*/new WeakMap();
|
|
15184
|
-
var
|
|
15318
|
+
var _id5 = /*#__PURE__*/new WeakMap();
|
|
15185
15319
|
var _handled2 = /*#__PURE__*/new WeakMap();
|
|
15186
15320
|
var _updateDevicesHandle = /*#__PURE__*/new WeakMap();
|
|
15187
15321
|
var _waitForDevicePromises = /*#__PURE__*/new WeakMap();
|
|
@@ -15192,13 +15326,13 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
15192
15326
|
_classPrivateMethodInitSpec(this, _CdpDeviceRequestPrompt_brand);
|
|
15193
15327
|
_classPrivateFieldInitSpec(this, _client6, void 0);
|
|
15194
15328
|
_classPrivateFieldInitSpec(this, _timeoutSettings, void 0);
|
|
15195
|
-
_classPrivateFieldInitSpec(this,
|
|
15329
|
+
_classPrivateFieldInitSpec(this, _id5, void 0);
|
|
15196
15330
|
_classPrivateFieldInitSpec(this, _handled2, false);
|
|
15197
15331
|
_classPrivateFieldInitSpec(this, _updateDevicesHandle, _assertClassBrand(_CdpDeviceRequestPrompt_brand, this, _updateDevices).bind(this));
|
|
15198
15332
|
_classPrivateFieldInitSpec(this, _waitForDevicePromises, new Set());
|
|
15199
15333
|
_classPrivateFieldSet(_client6, this, client);
|
|
15200
15334
|
_classPrivateFieldSet(_timeoutSettings, this, timeoutSettings);
|
|
15201
|
-
_classPrivateFieldSet(
|
|
15335
|
+
_classPrivateFieldSet(_id5, this, firstEvent.id);
|
|
15202
15336
|
_classPrivateFieldGet(_client6, this).on('DeviceAccess.deviceRequestPrompted', _classPrivateFieldGet(_updateDevicesHandle, this));
|
|
15203
15337
|
_classPrivateFieldGet(_client6, this).on('Target.detachedFromTarget', () => {
|
|
15204
15338
|
_classPrivateFieldSet(_client6, this, null);
|
|
@@ -15243,7 +15377,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
15243
15377
|
_classPrivateFieldGet(_client6, this).off('DeviceAccess.deviceRequestPrompted', _classPrivateFieldGet(_updateDevicesHandle, this));
|
|
15244
15378
|
_classPrivateFieldSet(_handled2, this, true);
|
|
15245
15379
|
return await _classPrivateFieldGet(_client6, this).send('DeviceAccess.selectPrompt', {
|
|
15246
|
-
id: _classPrivateFieldGet(
|
|
15380
|
+
id: _classPrivateFieldGet(_id5, this),
|
|
15247
15381
|
deviceId: device.id
|
|
15248
15382
|
});
|
|
15249
15383
|
}
|
|
@@ -15253,7 +15387,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
15253
15387
|
_classPrivateFieldGet(_client6, this).off('DeviceAccess.deviceRequestPrompted', _classPrivateFieldGet(_updateDevicesHandle, this));
|
|
15254
15388
|
_classPrivateFieldSet(_handled2, this, true);
|
|
15255
15389
|
return await _classPrivateFieldGet(_client6, this).send('DeviceAccess.cancelPrompt', {
|
|
15256
|
-
id: _classPrivateFieldGet(
|
|
15390
|
+
id: _classPrivateFieldGet(_id5, this)
|
|
15257
15391
|
});
|
|
15258
15392
|
}
|
|
15259
15393
|
}
|
|
@@ -15261,7 +15395,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
15261
15395
|
* @internal
|
|
15262
15396
|
*/
|
|
15263
15397
|
function _updateDevices(event) {
|
|
15264
|
-
if (event.id !== _classPrivateFieldGet(
|
|
15398
|
+
if (event.id !== _classPrivateFieldGet(_id5, this)) {
|
|
15265
15399
|
return;
|
|
15266
15400
|
}
|
|
15267
15401
|
for (const rawDevice of event.devices) {
|
|
@@ -15351,6 +15485,28 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
15351
15485
|
}
|
|
15352
15486
|
_classPrivateFieldGet(_deviceRequestPromptDeferreds, this).clear();
|
|
15353
15487
|
}
|
|
15488
|
+
function createConsoleMessage(event, values, targetId) {
|
|
15489
|
+
const textTokens = [];
|
|
15490
|
+
// eslint-disable-next-line max-len -- The comment is long.
|
|
15491
|
+
// eslint-disable-next-line @puppeteer/use-using -- These are not owned by this function.
|
|
15492
|
+
for (const arg of values) {
|
|
15493
|
+
textTokens.push(valueFromJSHandle(arg));
|
|
15494
|
+
}
|
|
15495
|
+
const stackTraceLocations = [];
|
|
15496
|
+
if (event.stackTrace) {
|
|
15497
|
+
for (const callFrame of event.stackTrace.callFrames) {
|
|
15498
|
+
stackTraceLocations.push({
|
|
15499
|
+
url: callFrame.url,
|
|
15500
|
+
lineNumber: callFrame.lineNumber,
|
|
15501
|
+
columnNumber: callFrame.columnNumber
|
|
15502
|
+
});
|
|
15503
|
+
}
|
|
15504
|
+
}
|
|
15505
|
+
return new ConsoleMessage(convertConsoleMessageLevel(event.type), textTokens.join(' '), values, stackTraceLocations, undefined, event.stackTrace, targetId);
|
|
15506
|
+
}
|
|
15507
|
+
/**
|
|
15508
|
+
* @internal
|
|
15509
|
+
*/
|
|
15354
15510
|
function createEvaluationError(details) {
|
|
15355
15511
|
let name;
|
|
15356
15512
|
let message;
|
|
@@ -15547,6 +15703,17 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
15547
15703
|
function pageBindingInitString(type, name) {
|
|
15548
15704
|
return evaluationString(addPageBinding, type, name, CDP_BINDING_PREFIX);
|
|
15549
15705
|
}
|
|
15706
|
+
/**
|
|
15707
|
+
* @internal
|
|
15708
|
+
*/
|
|
15709
|
+
function convertConsoleMessageLevel(method) {
|
|
15710
|
+
switch (method) {
|
|
15711
|
+
case 'warning':
|
|
15712
|
+
return 'warn';
|
|
15713
|
+
default:
|
|
15714
|
+
return method;
|
|
15715
|
+
}
|
|
15716
|
+
}
|
|
15550
15717
|
|
|
15551
15718
|
/**
|
|
15552
15719
|
* @license
|
|
@@ -15993,8 +16160,8 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
15993
16160
|
*/
|
|
15994
16161
|
var _client8 = /*#__PURE__*/new WeakMap();
|
|
15995
16162
|
var _world3 = /*#__PURE__*/new WeakMap();
|
|
15996
|
-
var
|
|
15997
|
-
var
|
|
16163
|
+
var _id6 = /*#__PURE__*/new WeakMap();
|
|
16164
|
+
var _name4 = /*#__PURE__*/new WeakMap();
|
|
15998
16165
|
var _disposables = /*#__PURE__*/new WeakMap();
|
|
15999
16166
|
var _bindings = /*#__PURE__*/new WeakMap();
|
|
16000
16167
|
var _mutex = /*#__PURE__*/new WeakMap();
|
|
@@ -16007,8 +16174,8 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16007
16174
|
_classPrivateMethodInitSpec(this, _ExecutionContext_brand);
|
|
16008
16175
|
_classPrivateFieldInitSpec(this, _client8, void 0);
|
|
16009
16176
|
_classPrivateFieldInitSpec(this, _world3, void 0);
|
|
16010
|
-
_classPrivateFieldInitSpec(this,
|
|
16011
|
-
_classPrivateFieldInitSpec(this,
|
|
16177
|
+
_classPrivateFieldInitSpec(this, _id6, void 0);
|
|
16178
|
+
_classPrivateFieldInitSpec(this, _name4, void 0);
|
|
16012
16179
|
_classPrivateFieldInitSpec(this, _disposables, new DisposableStack());
|
|
16013
16180
|
// Contains mapping from functions that should be bound to Puppeteer functions.
|
|
16014
16181
|
_classPrivateFieldInitSpec(this, _bindings, new Map());
|
|
@@ -16019,14 +16186,14 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16019
16186
|
_classPrivateFieldInitSpec(this, _puppeteerUtil, void 0);
|
|
16020
16187
|
_classPrivateFieldSet(_client8, this, client);
|
|
16021
16188
|
_classPrivateFieldSet(_world3, this, world);
|
|
16022
|
-
_classPrivateFieldSet(
|
|
16189
|
+
_classPrivateFieldSet(_id6, this, contextPayload.id);
|
|
16023
16190
|
if (contextPayload.name) {
|
|
16024
|
-
_classPrivateFieldSet(
|
|
16191
|
+
_classPrivateFieldSet(_name4, this, contextPayload.name);
|
|
16025
16192
|
}
|
|
16026
16193
|
const clientEmitter = _classPrivateFieldGet(_disposables, this).use(new EventEmitter(_classPrivateFieldGet(_client8, this)));
|
|
16027
16194
|
clientEmitter.on('Runtime.bindingCalled', _assertClassBrand(_ExecutionContext_brand, this, _onBindingCalled).bind(this));
|
|
16028
16195
|
clientEmitter.on('Runtime.executionContextDestroyed', async event => {
|
|
16029
|
-
if (event.executionContextId === _classPrivateFieldGet(
|
|
16196
|
+
if (event.executionContextId === _classPrivateFieldGet(_id6, this)) {
|
|
16030
16197
|
this[disposeSymbol]();
|
|
16031
16198
|
}
|
|
16032
16199
|
});
|
|
@@ -16039,7 +16206,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16039
16206
|
});
|
|
16040
16207
|
}
|
|
16041
16208
|
get id() {
|
|
16042
|
-
return _classPrivateFieldGet(
|
|
16209
|
+
return _classPrivateFieldGet(_id6, this);
|
|
16043
16210
|
}
|
|
16044
16211
|
get puppeteerUtil() {
|
|
16045
16212
|
let promise = Promise.resolve();
|
|
@@ -16171,12 +16338,12 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16171
16338
|
}
|
|
16172
16339
|
const _ = __addDisposableResource$2(env_1, await _classPrivateFieldGet(_mutex, this).acquire(), false);
|
|
16173
16340
|
try {
|
|
16174
|
-
await _classPrivateFieldGet(_client8, this).send('Runtime.addBinding', _classPrivateFieldGet(
|
|
16341
|
+
await _classPrivateFieldGet(_client8, this).send('Runtime.addBinding', _classPrivateFieldGet(_name4, this) ? {
|
|
16175
16342
|
name: CDP_BINDING_PREFIX + binding.name,
|
|
16176
|
-
executionContextName: _classPrivateFieldGet(
|
|
16343
|
+
executionContextName: _classPrivateFieldGet(_name4, this)
|
|
16177
16344
|
} : {
|
|
16178
16345
|
name: CDP_BINDING_PREFIX + binding.name,
|
|
16179
|
-
executionContextId: _classPrivateFieldGet(
|
|
16346
|
+
executionContextId: _classPrivateFieldGet(_id6, this)
|
|
16180
16347
|
});
|
|
16181
16348
|
await this.evaluate(addPageBinding, 'internal', binding.name, CDP_BINDING_PREFIX);
|
|
16182
16349
|
_classPrivateFieldGet(_bindings, this).set(binding.name, binding);
|
|
@@ -16204,7 +16371,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16204
16371
|
}
|
|
16205
16372
|
}
|
|
16206
16373
|
async function _onBindingCalled(event) {
|
|
16207
|
-
if (event.executionContextId !== _classPrivateFieldGet(
|
|
16374
|
+
if (event.executionContextId !== _classPrivateFieldGet(_id6, this)) {
|
|
16208
16375
|
return;
|
|
16209
16376
|
}
|
|
16210
16377
|
let payload;
|
|
@@ -16238,7 +16405,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16238
16405
|
}
|
|
16239
16406
|
}
|
|
16240
16407
|
function _onConsoleAPI(event) {
|
|
16241
|
-
if (event.executionContextId !== _classPrivateFieldGet(
|
|
16408
|
+
if (event.executionContextId !== _classPrivateFieldGet(_id6, this)) {
|
|
16242
16409
|
return;
|
|
16243
16410
|
}
|
|
16244
16411
|
this.emit('consoleapicalled', event);
|
|
@@ -16255,7 +16422,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16255
16422
|
async function _evaluate(returnByValue, pageFunction, ...args) {
|
|
16256
16423
|
const sourceUrlComment = getSourceUrlComment(getSourcePuppeteerURLIfAvailable(pageFunction)?.toString() ?? PuppeteerURL.INTERNAL_URL);
|
|
16257
16424
|
if (isString(pageFunction)) {
|
|
16258
|
-
const contextId = _classPrivateFieldGet(
|
|
16425
|
+
const contextId = _classPrivateFieldGet(_id6, this);
|
|
16259
16426
|
const expression = pageFunction;
|
|
16260
16427
|
const expressionWithSourceUrl = SOURCE_URL_REGEX.test(expression) ? expression : `${expression}\n${sourceUrlComment}\n`;
|
|
16261
16428
|
const {
|
|
@@ -16282,7 +16449,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16282
16449
|
try {
|
|
16283
16450
|
callFunctionOnPromise = _classPrivateFieldGet(_client8, this).send('Runtime.callFunctionOn', {
|
|
16284
16451
|
functionDeclaration: functionDeclarationWithSourceUrl,
|
|
16285
|
-
executionContextId: _classPrivateFieldGet(
|
|
16452
|
+
executionContextId: _classPrivateFieldGet(_id6, this),
|
|
16286
16453
|
// LazyArgs are used only internally and should not affect the order
|
|
16287
16454
|
// evaluate calls for the public APIs.
|
|
16288
16455
|
arguments: args.some(arg => {
|
|
@@ -16417,6 +16584,120 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16417
16584
|
FrameManagerEvent.BindingCalled = Symbol('FrameManager.BindingCalled');
|
|
16418
16585
|
})(exports.FrameManagerEvent || (exports.FrameManagerEvent = {}));
|
|
16419
16586
|
|
|
16587
|
+
/**
|
|
16588
|
+
* @license
|
|
16589
|
+
* Copyright 2022 Google Inc.
|
|
16590
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
16591
|
+
*/
|
|
16592
|
+
/**
|
|
16593
|
+
* A unique key for {@link IsolatedWorldChart} to denote the default world.
|
|
16594
|
+
* Execution contexts are automatically created in the default world.
|
|
16595
|
+
*
|
|
16596
|
+
* @internal
|
|
16597
|
+
*/
|
|
16598
|
+
const MAIN_WORLD = Symbol('mainWorld');
|
|
16599
|
+
/**
|
|
16600
|
+
* A unique key for {@link IsolatedWorldChart} to denote the puppeteer world.
|
|
16601
|
+
* This world contains all puppeteer-internal bindings/code.
|
|
16602
|
+
*
|
|
16603
|
+
* @internal
|
|
16604
|
+
*/
|
|
16605
|
+
const PUPPETEER_WORLD = Symbol('puppeteerWorld');
|
|
16606
|
+
|
|
16607
|
+
/**
|
|
16608
|
+
* @internal
|
|
16609
|
+
*/
|
|
16610
|
+
var _world4 = /*#__PURE__*/new WeakMap();
|
|
16611
|
+
var _client9 = /*#__PURE__*/new WeakMap();
|
|
16612
|
+
var _id7 = /*#__PURE__*/new WeakMap();
|
|
16613
|
+
var _targetType2 = /*#__PURE__*/new WeakMap();
|
|
16614
|
+
var _emitter2 = /*#__PURE__*/new WeakMap();
|
|
16615
|
+
class CdpWebWorker extends WebWorker {
|
|
16616
|
+
get internalEmitter() {
|
|
16617
|
+
return _classPrivateFieldGet(_emitter2, this);
|
|
16618
|
+
}
|
|
16619
|
+
constructor(client, url, targetId, targetType, exceptionThrown, networkManager) {
|
|
16620
|
+
super(url);
|
|
16621
|
+
_classPrivateFieldInitSpec(this, _world4, void 0);
|
|
16622
|
+
_classPrivateFieldInitSpec(this, _client9, void 0);
|
|
16623
|
+
_classPrivateFieldInitSpec(this, _id7, void 0);
|
|
16624
|
+
_classPrivateFieldInitSpec(this, _targetType2, void 0);
|
|
16625
|
+
_classPrivateFieldInitSpec(this, _emitter2, void 0);
|
|
16626
|
+
_classPrivateFieldSet(_id7, this, targetId);
|
|
16627
|
+
_classPrivateFieldSet(_client9, this, client);
|
|
16628
|
+
_classPrivateFieldSet(_targetType2, this, targetType);
|
|
16629
|
+
_classPrivateFieldSet(_world4, this, new IsolatedWorld(this, new TimeoutSettings(), MAIN_WORLD));
|
|
16630
|
+
_classPrivateFieldSet(_emitter2, this, new EventEmitter());
|
|
16631
|
+
_classPrivateFieldGet(_client9, this).once('Runtime.executionContextCreated', async event => {
|
|
16632
|
+
_classPrivateFieldGet(_world4, this).setContext(new ExecutionContext(client, event.context, _classPrivateFieldGet(_world4, this)));
|
|
16633
|
+
});
|
|
16634
|
+
_classPrivateFieldGet(_world4, this).emitter.on('consoleapicalled', async event => {
|
|
16635
|
+
try {
|
|
16636
|
+
const values = event.args.map(arg => {
|
|
16637
|
+
return _classPrivateFieldGet(_world4, this).createCdpHandle(arg);
|
|
16638
|
+
});
|
|
16639
|
+
const noInternalListeners = _classPrivateFieldGet(_emitter2, this).listenerCount(exports.WebWorkerEvent.Console) === 0;
|
|
16640
|
+
const noWorkerListeners = this.listenerCount(exports.WebWorkerEvent.Console) === 0;
|
|
16641
|
+
if (noInternalListeners && noWorkerListeners) {
|
|
16642
|
+
// eslint-disable-next-line max-len -- The comment is long.
|
|
16643
|
+
// eslint-disable-next-line @puppeteer/use-using -- These are not owned by this function.
|
|
16644
|
+
for (const value of values) {
|
|
16645
|
+
void value.dispose().catch(debugError);
|
|
16646
|
+
}
|
|
16647
|
+
return;
|
|
16648
|
+
}
|
|
16649
|
+
const consoleMessages = createConsoleMessage(event, values, _classPrivateFieldGet(_id7, this));
|
|
16650
|
+
_classPrivateFieldGet(_emitter2, this).emit(exports.WebWorkerEvent.Console, consoleMessages);
|
|
16651
|
+
if (!noWorkerListeners) {
|
|
16652
|
+
this.emit(exports.WebWorkerEvent.Console, consoleMessages);
|
|
16653
|
+
}
|
|
16654
|
+
} catch (err) {
|
|
16655
|
+
debugError(err);
|
|
16656
|
+
}
|
|
16657
|
+
});
|
|
16658
|
+
_classPrivateFieldGet(_client9, this).on('Runtime.exceptionThrown', exceptionThrown);
|
|
16659
|
+
_classPrivateFieldGet(_client9, this).once(exports.CDPSessionEvent.Disconnected, () => {
|
|
16660
|
+
_classPrivateFieldGet(_world4, this).dispose();
|
|
16661
|
+
});
|
|
16662
|
+
// This might fail if the target is closed before we receive all execution contexts.
|
|
16663
|
+
networkManager?.addClient(_classPrivateFieldGet(_client9, this)).catch(debugError);
|
|
16664
|
+
_classPrivateFieldGet(_client9, this).send('Runtime.enable').catch(debugError);
|
|
16665
|
+
}
|
|
16666
|
+
mainRealm() {
|
|
16667
|
+
return _classPrivateFieldGet(_world4, this);
|
|
16668
|
+
}
|
|
16669
|
+
get client() {
|
|
16670
|
+
return _classPrivateFieldGet(_client9, this);
|
|
16671
|
+
}
|
|
16672
|
+
async close() {
|
|
16673
|
+
switch (_classPrivateFieldGet(_targetType2, this)) {
|
|
16674
|
+
case exports.TargetType.SERVICE_WORKER:
|
|
16675
|
+
{
|
|
16676
|
+
// For service workers we need to close the target and detach to allow
|
|
16677
|
+
// the worker to stop.
|
|
16678
|
+
await this.client.connection()?.send('Target.closeTarget', {
|
|
16679
|
+
targetId: _classPrivateFieldGet(_id7, this)
|
|
16680
|
+
});
|
|
16681
|
+
await this.client.connection()?.send('Target.detachFromTarget', {
|
|
16682
|
+
sessionId: this.client.id()
|
|
16683
|
+
});
|
|
16684
|
+
break;
|
|
16685
|
+
}
|
|
16686
|
+
case exports.TargetType.SHARED_WORKER:
|
|
16687
|
+
{
|
|
16688
|
+
await this.client.connection()?.send('Target.closeTarget', {
|
|
16689
|
+
targetId: _classPrivateFieldGet(_id7, this)
|
|
16690
|
+
});
|
|
16691
|
+
break;
|
|
16692
|
+
}
|
|
16693
|
+
default:
|
|
16694
|
+
await this.evaluate(() => {
|
|
16695
|
+
self.close();
|
|
16696
|
+
});
|
|
16697
|
+
}
|
|
16698
|
+
}
|
|
16699
|
+
}
|
|
16700
|
+
|
|
16420
16701
|
/**
|
|
16421
16702
|
* @license
|
|
16422
16703
|
* Copyright 2019 Google Inc.
|
|
@@ -16426,17 +16707,22 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16426
16707
|
* @internal
|
|
16427
16708
|
*/
|
|
16428
16709
|
var _context = /*#__PURE__*/new WeakMap();
|
|
16429
|
-
var
|
|
16710
|
+
var _emitter3 = /*#__PURE__*/new WeakMap();
|
|
16711
|
+
var _worldId = /*#__PURE__*/new WeakMap();
|
|
16712
|
+
var _origin = /*#__PURE__*/new WeakMap();
|
|
16430
16713
|
var _frameOrWorker = /*#__PURE__*/new WeakMap();
|
|
16431
16714
|
var _IsolatedWorld_brand = /*#__PURE__*/new WeakSet();
|
|
16432
16715
|
class IsolatedWorld extends Realm {
|
|
16433
|
-
constructor(frameOrWorker, timeoutSettings) {
|
|
16716
|
+
constructor(frameOrWorker, timeoutSettings, worldId) {
|
|
16434
16717
|
super(timeoutSettings);
|
|
16435
16718
|
_classPrivateMethodInitSpec(this, _IsolatedWorld_brand);
|
|
16436
16719
|
_classPrivateFieldInitSpec(this, _context, void 0);
|
|
16437
|
-
_classPrivateFieldInitSpec(this,
|
|
16720
|
+
_classPrivateFieldInitSpec(this, _emitter3, new EventEmitter());
|
|
16721
|
+
_classPrivateFieldInitSpec(this, _worldId, void 0);
|
|
16722
|
+
_classPrivateFieldInitSpec(this, _origin, void 0);
|
|
16438
16723
|
_classPrivateFieldInitSpec(this, _frameOrWorker, void 0);
|
|
16439
16724
|
_classPrivateFieldSet(_frameOrWorker, this, frameOrWorker);
|
|
16725
|
+
_classPrivateFieldSet(_worldId, this, worldId);
|
|
16440
16726
|
}
|
|
16441
16727
|
get environment() {
|
|
16442
16728
|
return _classPrivateFieldGet(_frameOrWorker, this);
|
|
@@ -16445,7 +16731,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16445
16731
|
return _classPrivateFieldGet(_frameOrWorker, this).client;
|
|
16446
16732
|
}
|
|
16447
16733
|
get emitter() {
|
|
16448
|
-
return _classPrivateFieldGet(
|
|
16734
|
+
return _classPrivateFieldGet(_emitter3, this);
|
|
16449
16735
|
}
|
|
16450
16736
|
setContext(context) {
|
|
16451
16737
|
_classPrivateFieldGet(_context, this)?.[disposeSymbol]();
|
|
@@ -16453,7 +16739,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16453
16739
|
context.on('consoleapicalled', _assertClassBrand(_IsolatedWorld_brand, this, _onContextConsoleApiCalled).bind(this));
|
|
16454
16740
|
context.on('bindingcalled', _assertClassBrand(_IsolatedWorld_brand, this, _onContextBindingCalled).bind(this));
|
|
16455
16741
|
_classPrivateFieldSet(_context, this, context);
|
|
16456
|
-
_classPrivateFieldGet(
|
|
16742
|
+
_classPrivateFieldGet(_emitter3, this).emit('context', context);
|
|
16457
16743
|
void this.taskManager.rerunAll();
|
|
16458
16744
|
}
|
|
16459
16745
|
hasContext() {
|
|
@@ -16539,23 +16825,39 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16539
16825
|
}
|
|
16540
16826
|
[disposeSymbol]() {
|
|
16541
16827
|
_classPrivateFieldGet(_context, this)?.[disposeSymbol]();
|
|
16542
|
-
_classPrivateFieldGet(
|
|
16828
|
+
_classPrivateFieldGet(_emitter3, this).emit('disposed', undefined);
|
|
16543
16829
|
super[disposeSymbol]();
|
|
16544
|
-
_classPrivateFieldGet(
|
|
16830
|
+
_classPrivateFieldGet(_emitter3, this).removeAllListeners();
|
|
16831
|
+
}
|
|
16832
|
+
get origin() {
|
|
16833
|
+
return _classPrivateFieldGet(_origin, this);
|
|
16834
|
+
}
|
|
16835
|
+
set origin(origin) {
|
|
16836
|
+
_classPrivateFieldSet(_origin, this, origin);
|
|
16837
|
+
}
|
|
16838
|
+
setWorldId(worldId) {
|
|
16839
|
+
_classPrivateFieldSet(_worldId, this, worldId);
|
|
16840
|
+
}
|
|
16841
|
+
async extension() {
|
|
16842
|
+
if (_classPrivateFieldGet(_frameOrWorker, this) instanceof CdpWebWorker) {
|
|
16843
|
+
throw new Error('Unable to get extension from Realm');
|
|
16844
|
+
}
|
|
16845
|
+
if (_classPrivateFieldGet(_worldId, this) === MAIN_WORLD) {
|
|
16846
|
+
return null;
|
|
16847
|
+
}
|
|
16848
|
+
if (typeof _classPrivateFieldGet(_worldId, this) === 'string') {
|
|
16849
|
+
const extensions = await _classPrivateFieldGet(_frameOrWorker, this)._frameManager.page().browser().extensions();
|
|
16850
|
+
return extensions.get(_classPrivateFieldGet(_worldId, this)) ?? null;
|
|
16851
|
+
}
|
|
16852
|
+
return null;
|
|
16545
16853
|
}
|
|
16546
16854
|
}
|
|
16547
16855
|
|
|
16548
16856
|
/**
|
|
16549
16857
|
* @license
|
|
16550
|
-
* Copyright
|
|
16858
|
+
* Copyright 2019 Google Inc.
|
|
16551
16859
|
* SPDX-License-Identifier: Apache-2.0
|
|
16552
16860
|
*/
|
|
16553
|
-
/**
|
|
16554
|
-
* A unique key for {@link IsolatedWorldChart} to denote the default world.
|
|
16555
|
-
* Execution contexts are automatically created in the default world.
|
|
16556
|
-
*
|
|
16557
|
-
* @internal
|
|
16558
|
-
*/
|
|
16559
16861
|
function _onContextDisposed() {
|
|
16560
16862
|
_classPrivateFieldSet(_context, this, undefined);
|
|
16561
16863
|
if ('clearDocumentHandle' in _classPrivateFieldGet(_frameOrWorker, this)) {
|
|
@@ -16563,10 +16865,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16563
16865
|
}
|
|
16564
16866
|
}
|
|
16565
16867
|
function _onContextConsoleApiCalled(event) {
|
|
16566
|
-
_classPrivateFieldGet(
|
|
16868
|
+
_classPrivateFieldGet(_emitter3, this).emit('consoleapicalled', event);
|
|
16567
16869
|
}
|
|
16568
16870
|
function _onContextBindingCalled(event) {
|
|
16569
|
-
_classPrivateFieldGet(
|
|
16871
|
+
_classPrivateFieldGet(_emitter3, this).emit('bindingcalled', event);
|
|
16570
16872
|
}
|
|
16571
16873
|
function _executionContext() {
|
|
16572
16874
|
if (this.disposed) {
|
|
@@ -16579,27 +16881,13 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16579
16881
|
*/
|
|
16580
16882
|
async function _waitForExecutionContext() {
|
|
16581
16883
|
const error = new Error('Execution context was destroyed');
|
|
16582
|
-
const result = await firstValueFrom(fromEmitterEvent(_classPrivateFieldGet(
|
|
16884
|
+
const result = await firstValueFrom(fromEmitterEvent(_classPrivateFieldGet(_emitter3, this), 'context').pipe(raceWith(fromEmitterEvent(_classPrivateFieldGet(_emitter3, this), 'disposed').pipe(map(() => {
|
|
16583
16885
|
// The message has to match the CDP message expected by the WaitTask class.
|
|
16584
16886
|
throw error;
|
|
16585
16887
|
})), timeout(this.timeoutSettings.timeout()))));
|
|
16586
16888
|
return result;
|
|
16587
16889
|
}
|
|
16588
|
-
const
|
|
16589
|
-
/**
|
|
16590
|
-
* A unique key for {@link IsolatedWorldChart} to denote the puppeteer world.
|
|
16591
|
-
* This world contains all puppeteer-internal bindings/code.
|
|
16592
|
-
*
|
|
16593
|
-
* @internal
|
|
16594
|
-
*/
|
|
16595
|
-
const PUPPETEER_WORLD = Symbol('puppeteerWorld');
|
|
16596
|
-
|
|
16597
|
-
/**
|
|
16598
|
-
* @license
|
|
16599
|
-
* Copyright 2019 Google Inc.
|
|
16600
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
16601
|
-
*/
|
|
16602
|
-
const puppeteerToProtocolLifecycle = new Map([['load', 'load'], ['domcontentloaded', 'DOMContentLoaded'], ['networkidle0', 'networkIdle'], ['networkidle2', 'networkAlmostIdle']]);
|
|
16890
|
+
const puppeteerToProtocolLifecycle = new Map([['load', 'load'], ['domcontentloaded', 'DOMContentLoaded'], ['networkidle0', 'networkIdle'], ['networkidle2', 'networkAlmostIdle']]);
|
|
16603
16891
|
/**
|
|
16604
16892
|
* @internal
|
|
16605
16893
|
*/
|
|
@@ -16821,7 +17109,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16821
17109
|
/**
|
|
16822
17110
|
* @internal
|
|
16823
17111
|
*/
|
|
16824
|
-
let CdpFrame = ((_ref3, _CdpFrame, _url3, _detached2,
|
|
17112
|
+
let CdpFrame = ((_ref3, _CdpFrame, _url3, _detached2, _client0, _CdpFrame_brand) => {
|
|
16825
17113
|
let _classSuper = Frame;
|
|
16826
17114
|
let _instanceExtraInitializers = [];
|
|
16827
17115
|
let _goto_decorators;
|
|
@@ -16831,13 +17119,13 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16831
17119
|
let _addExposedFunctionBinding_decorators;
|
|
16832
17120
|
let _removeExposedFunctionBinding_decorators;
|
|
16833
17121
|
let _waitForDevicePrompt_decorators;
|
|
16834
|
-
return _url3 = /*#__PURE__*/new WeakMap(), _detached2 = /*#__PURE__*/new WeakMap(),
|
|
17122
|
+
return _url3 = /*#__PURE__*/new WeakMap(), _detached2 = /*#__PURE__*/new WeakMap(), _client0 = /*#__PURE__*/new WeakMap(), _CdpFrame_brand = /*#__PURE__*/new WeakSet(), _ref3 = (_goto_decorators = [throwIfDetached], _waitForNavigation_decorators = [throwIfDetached], _setContent_decorators = [throwIfDetached], _addPreloadScript_decorators = [throwIfDetached], _addExposedFunctionBinding_decorators = [throwIfDetached], _removeExposedFunctionBinding_decorators = [throwIfDetached], _waitForDevicePrompt_decorators = [throwIfDetached], disposeSymbol), _CdpFrame = class CdpFrame extends _classSuper {
|
|
16835
17123
|
constructor(frameManager, frameId, parentFrameId, client) {
|
|
16836
17124
|
super();
|
|
16837
17125
|
_classPrivateMethodInitSpec(this, _CdpFrame_brand);
|
|
16838
17126
|
_classPrivateFieldInitSpec(this, _url3, (__runInitializers(this, _instanceExtraInitializers), ''));
|
|
16839
17127
|
_classPrivateFieldInitSpec(this, _detached2, false);
|
|
16840
|
-
_classPrivateFieldInitSpec(this,
|
|
17128
|
+
_classPrivateFieldInitSpec(this, _client0, void 0);
|
|
16841
17129
|
_defineProperty(this, "_frameManager", void 0);
|
|
16842
17130
|
_defineProperty(this, "_loaderId", '');
|
|
16843
17131
|
_defineProperty(this, "_lifecycleEvents", new Set());
|
|
@@ -16845,16 +17133,17 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16845
17133
|
_defineProperty(this, "_parentId", void 0);
|
|
16846
17134
|
_defineProperty(this, "accessibility", void 0);
|
|
16847
17135
|
_defineProperty(this, "worlds", void 0);
|
|
17136
|
+
_defineProperty(this, "extensionWorlds", {});
|
|
16848
17137
|
this._frameManager = frameManager;
|
|
16849
17138
|
_classPrivateFieldSet(_url3, this, '');
|
|
16850
17139
|
this._id = frameId;
|
|
16851
17140
|
this._parentId = parentFrameId;
|
|
16852
17141
|
_classPrivateFieldSet(_detached2, this, false);
|
|
16853
|
-
_classPrivateFieldSet(
|
|
17142
|
+
_classPrivateFieldSet(_client0, this, client);
|
|
16854
17143
|
this._loaderId = '';
|
|
16855
17144
|
this.worlds = {
|
|
16856
|
-
[MAIN_WORLD]: new IsolatedWorld(this, this._frameManager.timeoutSettings),
|
|
16857
|
-
[PUPPETEER_WORLD]: new IsolatedWorld(this, this._frameManager.timeoutSettings)
|
|
17145
|
+
[MAIN_WORLD]: new IsolatedWorld(this, this._frameManager.timeoutSettings, MAIN_WORLD),
|
|
17146
|
+
[PUPPETEER_WORLD]: new IsolatedWorld(this, this._frameManager.timeoutSettings, PUPPETEER_WORLD)
|
|
16858
17147
|
};
|
|
16859
17148
|
this.accessibility = new Accessibility(this.worlds[MAIN_WORLD], frameId);
|
|
16860
17149
|
this.on(exports.FrameEvent.FrameSwappedByActivation, () => {
|
|
@@ -16862,8 +17151,18 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16862
17151
|
this._onLoadingStarted();
|
|
16863
17152
|
this._onLoadingStopped();
|
|
16864
17153
|
});
|
|
16865
|
-
this.worlds[MAIN_WORLD]
|
|
16866
|
-
|
|
17154
|
+
this.registerWorldListeners(this.worlds[MAIN_WORLD]);
|
|
17155
|
+
}
|
|
17156
|
+
/**
|
|
17157
|
+
* @internal
|
|
17158
|
+
*/
|
|
17159
|
+
registerWorldListeners(world) {
|
|
17160
|
+
world.emitter.on('consoleapicalled', event => {
|
|
17161
|
+
this._frameManager.emit(exports.FrameManagerEvent.ConsoleApiCalled, [world, event]);
|
|
17162
|
+
});
|
|
17163
|
+
world.emitter.on('bindingcalled', event => {
|
|
17164
|
+
this._frameManager.emit(exports.FrameManagerEvent.BindingCalled, [world, event]);
|
|
17165
|
+
});
|
|
16867
17166
|
}
|
|
16868
17167
|
/**
|
|
16869
17168
|
* This is used internally in DevTools.
|
|
@@ -16871,7 +17170,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16871
17170
|
* @internal
|
|
16872
17171
|
*/
|
|
16873
17172
|
_client() {
|
|
16874
|
-
return _classPrivateFieldGet(
|
|
17173
|
+
return _classPrivateFieldGet(_client0, this);
|
|
16875
17174
|
}
|
|
16876
17175
|
/**
|
|
16877
17176
|
* Updates the frame ID with the new ID. This happens when the main frame is
|
|
@@ -16881,7 +17180,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16881
17180
|
this._id = id;
|
|
16882
17181
|
}
|
|
16883
17182
|
updateClient(client) {
|
|
16884
|
-
_classPrivateFieldSet(
|
|
17183
|
+
_classPrivateFieldSet(_client0, this, client);
|
|
16885
17184
|
}
|
|
16886
17185
|
page() {
|
|
16887
17186
|
return this._frameManager.page();
|
|
@@ -16895,7 +17194,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16895
17194
|
} = options;
|
|
16896
17195
|
let ensureNewDocumentNavigation = false;
|
|
16897
17196
|
const watcher = new LifecycleWatcher(this._frameManager.networkManager, this, waitUntil, timeout);
|
|
16898
|
-
let error = await Deferred.race([navigate(_classPrivateFieldGet(
|
|
17197
|
+
let error = await Deferred.race([navigate(_classPrivateFieldGet(_client0, this), url, referer, referrerPolicy ? referrerPolicyToProtocol(referrerPolicy) : undefined, this._id), watcher.terminationPromise()]);
|
|
16899
17198
|
if (!error) {
|
|
16900
17199
|
error = await Deferred.race([watcher.terminationPromise(), ensureNewDocumentNavigation ? watcher.newDocumentNavigationPromise() : watcher.sameDocumentNavigationPromise()]);
|
|
16901
17200
|
}
|
|
@@ -16950,7 +17249,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16950
17249
|
}
|
|
16951
17250
|
}
|
|
16952
17251
|
get client() {
|
|
16953
|
-
return _classPrivateFieldGet(
|
|
17252
|
+
return _classPrivateFieldGet(_client0, this);
|
|
16954
17253
|
}
|
|
16955
17254
|
mainRealm() {
|
|
16956
17255
|
return this.worlds[MAIN_WORLD];
|
|
@@ -16984,7 +17283,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16984
17283
|
}
|
|
16985
17284
|
async addPreloadScript(preloadScript) {
|
|
16986
17285
|
const parentFrame = this.parentFrame();
|
|
16987
|
-
if (parentFrame && _classPrivateFieldGet(
|
|
17286
|
+
if (parentFrame && _classPrivateFieldGet(_client0, this) === parentFrame.client) {
|
|
16988
17287
|
return;
|
|
16989
17288
|
}
|
|
16990
17289
|
if (preloadScript.getIdForFrame(this)) {
|
|
@@ -16992,7 +17291,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
16992
17291
|
}
|
|
16993
17292
|
const {
|
|
16994
17293
|
identifier
|
|
16995
|
-
} = await _classPrivateFieldGet(
|
|
17294
|
+
} = await _classPrivateFieldGet(_client0, this).send('Page.addScriptToEvaluateOnNewDocument', {
|
|
16996
17295
|
source: preloadScript.source
|
|
16997
17296
|
});
|
|
16998
17297
|
preloadScript.setIdForFrame(this, identifier);
|
|
@@ -17003,7 +17302,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
17003
17302
|
if (this !== this._frameManager.mainFrame() && !this._hasStartedLoading) {
|
|
17004
17303
|
return;
|
|
17005
17304
|
}
|
|
17006
|
-
await Promise.all([_classPrivateFieldGet(
|
|
17305
|
+
await Promise.all([_classPrivateFieldGet(_client0, this).send('Runtime.addBinding', {
|
|
17007
17306
|
name: CDP_BINDING_PREFIX + binding.name
|
|
17008
17307
|
}), this.evaluate(binding.initSource).catch(debugError)]);
|
|
17009
17308
|
}
|
|
@@ -17013,7 +17312,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
17013
17312
|
if (this !== this._frameManager.mainFrame() && !this._hasStartedLoading) {
|
|
17014
17313
|
return;
|
|
17015
17314
|
}
|
|
17016
|
-
await Promise.all([_classPrivateFieldGet(
|
|
17315
|
+
await Promise.all([_classPrivateFieldGet(_client0, this).send('Runtime.removeBinding', {
|
|
17017
17316
|
name: CDP_BINDING_PREFIX + binding.name
|
|
17018
17317
|
}), this.evaluate(name => {
|
|
17019
17318
|
// Removes the dangling Puppeteer binding wrapper.
|
|
@@ -17055,6 +17354,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
17055
17354
|
_classPrivateFieldSet(_detached2, this, true);
|
|
17056
17355
|
this.worlds[MAIN_WORLD][disposeSymbol]();
|
|
17057
17356
|
this.worlds[PUPPETEER_WORLD][disposeSymbol]();
|
|
17357
|
+
for (const extensionWorld of Object.values(this.extensionWorlds)) {
|
|
17358
|
+
extensionWorld[disposeSymbol]();
|
|
17359
|
+
}
|
|
17058
17360
|
}
|
|
17059
17361
|
exposeFunction() {
|
|
17060
17362
|
throw new UnsupportedOperation();
|
|
@@ -17071,6 +17373,12 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
17071
17373
|
});
|
|
17072
17374
|
return await parent.mainRealm().adoptBackendNode(backendNodeId);
|
|
17073
17375
|
}
|
|
17376
|
+
/**
|
|
17377
|
+
* @public
|
|
17378
|
+
*/
|
|
17379
|
+
extensionRealms() {
|
|
17380
|
+
return Object.values(this.extensionWorlds);
|
|
17381
|
+
}
|
|
17074
17382
|
}, (() => {
|
|
17075
17383
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
17076
17384
|
__esDecorate(_CdpFrame, null, _goto_decorators, {
|
|
@@ -17157,14 +17465,8 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
17157
17465
|
value: _metadata
|
|
17158
17466
|
});
|
|
17159
17467
|
})(), _CdpFrame;
|
|
17160
|
-
function _onMainWorldConsoleApiCalled(event) {
|
|
17161
|
-
this._frameManager.emit(exports.FrameManagerEvent.ConsoleApiCalled, [this.worlds[MAIN_WORLD], event]);
|
|
17162
|
-
}
|
|
17163
|
-
function _onMainWorldBindingCalled(event) {
|
|
17164
|
-
this._frameManager.emit(exports.FrameManagerEvent.BindingCalled, [this.worlds[MAIN_WORLD], event]);
|
|
17165
|
-
}
|
|
17166
17468
|
function _deviceRequestPromptManager() {
|
|
17167
|
-
return this._frameManager._deviceRequestPromptManager(_classPrivateFieldGet(
|
|
17469
|
+
return this._frameManager._deviceRequestPromptManager(_classPrivateFieldGet(_client0, this));
|
|
17168
17470
|
}
|
|
17169
17471
|
})();
|
|
17170
17472
|
/**
|
|
@@ -17276,7 +17578,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
17276
17578
|
/**
|
|
17277
17579
|
* @internal
|
|
17278
17580
|
*/
|
|
17279
|
-
var
|
|
17581
|
+
var _client1 = /*#__PURE__*/new WeakMap();
|
|
17280
17582
|
var _isNavigationRequest = /*#__PURE__*/new WeakMap();
|
|
17281
17583
|
var _url4 = /*#__PURE__*/new WeakMap();
|
|
17282
17584
|
var _resourceType = /*#__PURE__*/new WeakMap();
|
|
@@ -17288,15 +17590,15 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
17288
17590
|
var _initiator = /*#__PURE__*/new WeakMap();
|
|
17289
17591
|
class CdpHTTPRequest extends HTTPRequest {
|
|
17290
17592
|
get client() {
|
|
17291
|
-
return _classPrivateFieldGet(
|
|
17593
|
+
return _classPrivateFieldGet(_client1, this);
|
|
17292
17594
|
}
|
|
17293
17595
|
set client(newClient) {
|
|
17294
|
-
_classPrivateFieldSet(
|
|
17596
|
+
_classPrivateFieldSet(_client1, this, newClient);
|
|
17295
17597
|
}
|
|
17296
17598
|
constructor(client, frame, interceptionId, allowInterception, data, redirectChain) {
|
|
17297
17599
|
super();
|
|
17298
17600
|
_defineProperty(this, "id", void 0);
|
|
17299
|
-
_classPrivateFieldInitSpec(this,
|
|
17601
|
+
_classPrivateFieldInitSpec(this, _client1, void 0);
|
|
17300
17602
|
_classPrivateFieldInitSpec(this, _isNavigationRequest, void 0);
|
|
17301
17603
|
_classPrivateFieldInitSpec(this, _url4, void 0);
|
|
17302
17604
|
_classPrivateFieldInitSpec(this, _resourceType, void 0);
|
|
@@ -17306,7 +17608,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
17306
17608
|
_classPrivateFieldInitSpec(this, _headers, {});
|
|
17307
17609
|
_classPrivateFieldInitSpec(this, _frame4, void 0);
|
|
17308
17610
|
_classPrivateFieldInitSpec(this, _initiator, void 0);
|
|
17309
|
-
_classPrivateFieldSet(
|
|
17611
|
+
_classPrivateFieldSet(_client1, this, client);
|
|
17310
17612
|
this.id = data.requestId;
|
|
17311
17613
|
_classPrivateFieldSet(_isNavigationRequest, this, data.requestId === data.loaderId && data.type === 'Document');
|
|
17312
17614
|
this._interceptionId = interceptionId;
|
|
@@ -17351,7 +17653,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
17351
17653
|
}
|
|
17352
17654
|
async fetchPostData() {
|
|
17353
17655
|
try {
|
|
17354
|
-
const result = await _classPrivateFieldGet(
|
|
17656
|
+
const result = await _classPrivateFieldGet(_client1, this).send('Network.getRequestPostData', {
|
|
17355
17657
|
requestId: this.id
|
|
17356
17658
|
});
|
|
17357
17659
|
return result.postData;
|
|
@@ -17405,7 +17707,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
17405
17707
|
if (this._interceptionId === undefined) {
|
|
17406
17708
|
throw new Error('HTTPRequest is missing _interceptionId needed for Fetch.continueRequest');
|
|
17407
17709
|
}
|
|
17408
|
-
await _classPrivateFieldGet(
|
|
17710
|
+
await _classPrivateFieldGet(_client1, this).send('Fetch.continueRequest', {
|
|
17409
17711
|
requestId: this._interceptionId,
|
|
17410
17712
|
url,
|
|
17411
17713
|
method,
|
|
@@ -17441,7 +17743,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
17441
17743
|
if (this._interceptionId === undefined) {
|
|
17442
17744
|
throw new Error('HTTPRequest is missing _interceptionId needed for Fetch.fulfillRequest');
|
|
17443
17745
|
}
|
|
17444
|
-
await _classPrivateFieldGet(
|
|
17746
|
+
await _classPrivateFieldGet(_client1, this).send('Fetch.fulfillRequest', {
|
|
17445
17747
|
requestId: this._interceptionId,
|
|
17446
17748
|
responseCode: status,
|
|
17447
17749
|
responsePhrase: STATUS_TEXTS[status],
|
|
@@ -17457,7 +17759,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
17457
17759
|
if (this._interceptionId === undefined) {
|
|
17458
17760
|
throw new Error('HTTPRequest is missing _interceptionId needed for Fetch.failRequest');
|
|
17459
17761
|
}
|
|
17460
|
-
await _classPrivateFieldGet(
|
|
17762
|
+
await _classPrivateFieldGet(_client1, this).send('Fetch.failRequest', {
|
|
17461
17763
|
requestId: this._interceptionId,
|
|
17462
17764
|
errorReason: errorReason || 'Failed'
|
|
17463
17765
|
}).catch(handleError);
|
|
@@ -18395,6 +18697,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18395
18697
|
}
|
|
18396
18698
|
}
|
|
18397
18699
|
const TIME_FOR_WAITING_FOR_SWAP = 100; // ms.
|
|
18700
|
+
const CHROME_EXTENSION_PREFIX = 'chrome-extension://';
|
|
18398
18701
|
/**
|
|
18399
18702
|
* A frame manager manages the frames for a given {@link Page | page}.
|
|
18400
18703
|
*
|
|
@@ -18404,7 +18707,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18404
18707
|
var _networkManager = /*#__PURE__*/new WeakMap();
|
|
18405
18708
|
var _timeoutSettings3 = /*#__PURE__*/new WeakMap();
|
|
18406
18709
|
var _isolatedWorlds = /*#__PURE__*/new WeakMap();
|
|
18407
|
-
var
|
|
18710
|
+
var _client10 = /*#__PURE__*/new WeakMap();
|
|
18408
18711
|
var _scriptsToEvaluateOnNewDocument = /*#__PURE__*/new WeakMap();
|
|
18409
18712
|
var _bindings2 = /*#__PURE__*/new WeakMap();
|
|
18410
18713
|
var _frameNavigatedReceived = /*#__PURE__*/new WeakMap();
|
|
@@ -18419,7 +18722,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18419
18722
|
return _classPrivateFieldGet(_networkManager, this);
|
|
18420
18723
|
}
|
|
18421
18724
|
get client() {
|
|
18422
|
-
return _classPrivateFieldGet(
|
|
18725
|
+
return _classPrivateFieldGet(_client10, this);
|
|
18423
18726
|
}
|
|
18424
18727
|
constructor(client, page, timeoutSettings) {
|
|
18425
18728
|
super();
|
|
@@ -18433,7 +18736,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18433
18736
|
_classPrivateFieldInitSpec(this, _networkManager, void 0);
|
|
18434
18737
|
_classPrivateFieldInitSpec(this, _timeoutSettings3, void 0);
|
|
18435
18738
|
_classPrivateFieldInitSpec(this, _isolatedWorlds, new Set());
|
|
18436
|
-
_classPrivateFieldInitSpec(this,
|
|
18739
|
+
_classPrivateFieldInitSpec(this, _client10, void 0);
|
|
18437
18740
|
_classPrivateFieldInitSpec(this, _scriptsToEvaluateOnNewDocument, new Map());
|
|
18438
18741
|
_classPrivateFieldInitSpec(this, _bindings2, new Set());
|
|
18439
18742
|
_defineProperty(this, "_frameTree", new FrameTree());
|
|
@@ -18445,11 +18748,11 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18445
18748
|
_classPrivateFieldInitSpec(this, _frameNavigatedReceived, new Set());
|
|
18446
18749
|
_classPrivateFieldInitSpec(this, _deviceRequestPromptManagerMap, new WeakMap());
|
|
18447
18750
|
_classPrivateFieldInitSpec(this, _frameTreeHandled, void 0);
|
|
18448
|
-
_classPrivateFieldSet(
|
|
18751
|
+
_classPrivateFieldSet(_client10, this, client);
|
|
18449
18752
|
_classPrivateFieldSet(_page, this, page);
|
|
18450
18753
|
_classPrivateFieldSet(_networkManager, this, new NetworkManager(this, page.browser().isNetworkEnabled()));
|
|
18451
18754
|
_classPrivateFieldSet(_timeoutSettings3, this, timeoutSettings);
|
|
18452
|
-
this.setupEventListeners(_classPrivateFieldGet(
|
|
18755
|
+
this.setupEventListeners(_classPrivateFieldGet(_client10, this));
|
|
18453
18756
|
client.once(exports.CDPSessionEvent.Disconnected, () => {
|
|
18454
18757
|
_assertClassBrand(_FrameManager_brand, this, _onClientDisconnect).call(this).catch(debugError);
|
|
18455
18758
|
});
|
|
@@ -18460,12 +18763,12 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18460
18763
|
* its frame tree and ID.
|
|
18461
18764
|
*/
|
|
18462
18765
|
async swapFrameTree(client) {
|
|
18463
|
-
_classPrivateFieldSet(
|
|
18766
|
+
_classPrivateFieldSet(_client10, this, client);
|
|
18464
18767
|
const frame = this._frameTree.getMainFrame();
|
|
18465
18768
|
if (frame) {
|
|
18466
|
-
_classPrivateFieldGet(_frameNavigatedReceived, this).add(_classPrivateFieldGet(
|
|
18769
|
+
_classPrivateFieldGet(_frameNavigatedReceived, this).add(_classPrivateFieldGet(_client10, this).target()._targetId);
|
|
18467
18770
|
this._frameTree.removeFrame(frame);
|
|
18468
|
-
frame.updateId(_classPrivateFieldGet(
|
|
18771
|
+
frame.updateId(_classPrivateFieldGet(_client10, this).target()._targetId);
|
|
18469
18772
|
this._frameTree.addFrame(frame);
|
|
18470
18773
|
frame.updateClient(client);
|
|
18471
18774
|
}
|
|
@@ -18516,6 +18819,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18516
18819
|
await _classPrivateFieldGet(_frameTreeHandled, this)?.valueOrThrow();
|
|
18517
18820
|
_assertClassBrand(_FrameManager_brand, this, _onLifecycleEvent).call(this, event);
|
|
18518
18821
|
});
|
|
18822
|
+
session.on('Audits.issueAdded', event => {
|
|
18823
|
+
_classPrivateFieldGet(_page, this).emit("issue" /* PageEvent.Issue */, new CdpIssue(event.issue));
|
|
18824
|
+
});
|
|
18519
18825
|
}
|
|
18520
18826
|
async initialize(client, frame) {
|
|
18521
18827
|
try {
|
|
@@ -18538,7 +18844,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18538
18844
|
return frame?.addPreloadScript(script);
|
|
18539
18845
|
}), ...(frame ? Array.from(_classPrivateFieldGet(_bindings2, this).values()) : []).map(binding => {
|
|
18540
18846
|
return frame?.addExposedFunctionBinding(binding);
|
|
18541
|
-
})]);
|
|
18847
|
+
}), _classPrivateFieldGet(_page, this).browser().isIssuesEnabled() && client.send('Audits.enable')]);
|
|
18542
18848
|
} catch (error) {
|
|
18543
18849
|
_classPrivateFieldGet(_frameTreeHandled, this)?.resolve();
|
|
18544
18850
|
// The target might have been closed before the initialization finished.
|
|
@@ -18736,7 +19042,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18736
19042
|
frame._id = frameId;
|
|
18737
19043
|
} else {
|
|
18738
19044
|
// Initial main frame navigation.
|
|
18739
|
-
frame = new CdpFrame(this, frameId, undefined, _classPrivateFieldGet(
|
|
19045
|
+
frame = new CdpFrame(this, frameId, undefined, _classPrivateFieldGet(_client10, this));
|
|
18740
19046
|
}
|
|
18741
19047
|
this._frameTree.addFrame(frame);
|
|
18742
19048
|
}
|
|
@@ -18796,8 +19102,22 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18796
19102
|
break;
|
|
18797
19103
|
}
|
|
18798
19104
|
}
|
|
19105
|
+
function _isExtensionOrigin(origin) {
|
|
19106
|
+
return origin.startsWith(CHROME_EXTENSION_PREFIX);
|
|
19107
|
+
}
|
|
19108
|
+
function _extractExtensionId(origin) {
|
|
19109
|
+
if (!origin || !_assertClassBrand(_FrameManager_brand, this, _isExtensionOrigin).call(this, origin)) {
|
|
19110
|
+
return null;
|
|
19111
|
+
}
|
|
19112
|
+
const pathPart = origin.substring(CHROME_EXTENSION_PREFIX.length);
|
|
19113
|
+
const slashIndex = pathPart.indexOf('/');
|
|
19114
|
+
// if there's no / it means that pathPart is now the extensionId, otherwise
|
|
19115
|
+
// we take everything until the first /
|
|
19116
|
+
return slashIndex === -1 ? pathPart : pathPart.substring(0, slashIndex);
|
|
19117
|
+
}
|
|
18799
19118
|
function _onExecutionContextCreated(contextPayload, session) {
|
|
18800
19119
|
const auxData = contextPayload.auxData;
|
|
19120
|
+
const origin = contextPayload.origin;
|
|
18801
19121
|
const frameId = auxData && auxData.frameId;
|
|
18802
19122
|
const frame = typeof frameId === 'string' ? this.frame(frameId) : undefined;
|
|
18803
19123
|
let world;
|
|
@@ -18813,13 +19133,28 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
18813
19133
|
// connections so we might end up creating multiple isolated worlds.
|
|
18814
19134
|
// We can use either.
|
|
18815
19135
|
world = frame.worlds[PUPPETEER_WORLD];
|
|
19136
|
+
} else if (_assertClassBrand(_FrameManager_brand, this, _isExtensionOrigin).call(this, origin)) {
|
|
19137
|
+
const extId = _assertClassBrand(_FrameManager_brand, this, _extractExtensionId).call(this, origin);
|
|
19138
|
+
if (!extId) {
|
|
19139
|
+
debugError('Error while parsing extension id');
|
|
19140
|
+
return;
|
|
19141
|
+
}
|
|
19142
|
+
if (frame.extensionWorlds[extId]) {
|
|
19143
|
+
world = frame.extensionWorlds[extId];
|
|
19144
|
+
} else {
|
|
19145
|
+
world = new IsolatedWorld(frame, this.timeoutSettings, extId);
|
|
19146
|
+
frame.extensionWorlds[extId] = world;
|
|
19147
|
+
frame.registerWorldListeners(world);
|
|
19148
|
+
world.origin = origin;
|
|
19149
|
+
world.setWorldId(extId);
|
|
19150
|
+
}
|
|
18816
19151
|
}
|
|
18817
19152
|
}
|
|
18818
19153
|
// If there is no world, the context is not meant to be handled by us.
|
|
18819
19154
|
if (!world) {
|
|
18820
19155
|
return;
|
|
18821
19156
|
}
|
|
18822
|
-
const context = new ExecutionContext(frame?.client || _classPrivateFieldGet(
|
|
19157
|
+
const context = new ExecutionContext(frame?.client || _classPrivateFieldGet(_client10, this), contextPayload, world);
|
|
18823
19158
|
world.setContext(context);
|
|
18824
19159
|
}
|
|
18825
19160
|
function _removeFramesRecursively(frame) {
|
|
@@ -20219,20 +20554,20 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20219
20554
|
/**
|
|
20220
20555
|
* @internal
|
|
20221
20556
|
*/
|
|
20222
|
-
var
|
|
20557
|
+
var _client11 = /*#__PURE__*/new WeakMap();
|
|
20223
20558
|
var _pressedKeys = /*#__PURE__*/new WeakMap();
|
|
20224
20559
|
var _CdpKeyboard_brand = /*#__PURE__*/new WeakSet();
|
|
20225
20560
|
class CdpKeyboard extends Keyboard {
|
|
20226
20561
|
constructor(client) {
|
|
20227
20562
|
super();
|
|
20228
20563
|
_classPrivateMethodInitSpec(this, _CdpKeyboard_brand);
|
|
20229
|
-
_classPrivateFieldInitSpec(this,
|
|
20564
|
+
_classPrivateFieldInitSpec(this, _client11, void 0);
|
|
20230
20565
|
_classPrivateFieldInitSpec(this, _pressedKeys, new Set());
|
|
20231
20566
|
_defineProperty(this, "_modifiers", 0);
|
|
20232
|
-
_classPrivateFieldSet(
|
|
20567
|
+
_classPrivateFieldSet(_client11, this, client);
|
|
20233
20568
|
}
|
|
20234
20569
|
updateClient(client) {
|
|
20235
|
-
_classPrivateFieldSet(
|
|
20570
|
+
_classPrivateFieldSet(_client11, this, client);
|
|
20236
20571
|
}
|
|
20237
20572
|
async down(key, options = {
|
|
20238
20573
|
text: undefined,
|
|
@@ -20243,7 +20578,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20243
20578
|
_classPrivateFieldGet(_pressedKeys, this).add(description.code);
|
|
20244
20579
|
this._modifiers |= _assertClassBrand(_CdpKeyboard_brand, this, _modifierBit).call(this, description.key);
|
|
20245
20580
|
const text = options.text === undefined ? description.text : options.text;
|
|
20246
|
-
await _classPrivateFieldGet(
|
|
20581
|
+
await _classPrivateFieldGet(_client11, this).send('Input.dispatchKeyEvent', {
|
|
20247
20582
|
type: text ? 'keyDown' : 'rawKeyDown',
|
|
20248
20583
|
modifiers: this._modifiers,
|
|
20249
20584
|
windowsVirtualKeyCode: description.keyCode,
|
|
@@ -20261,7 +20596,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20261
20596
|
const description = _assertClassBrand(_CdpKeyboard_brand, this, _keyDescriptionForString).call(this, key);
|
|
20262
20597
|
this._modifiers &= ~_assertClassBrand(_CdpKeyboard_brand, this, _modifierBit).call(this, description.key);
|
|
20263
20598
|
_classPrivateFieldGet(_pressedKeys, this).delete(description.code);
|
|
20264
|
-
await _classPrivateFieldGet(
|
|
20599
|
+
await _classPrivateFieldGet(_client11, this).send('Input.dispatchKeyEvent', {
|
|
20265
20600
|
type: 'keyUp',
|
|
20266
20601
|
modifiers: this._modifiers,
|
|
20267
20602
|
key: description.key,
|
|
@@ -20271,7 +20606,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20271
20606
|
});
|
|
20272
20607
|
}
|
|
20273
20608
|
async sendCharacter(char) {
|
|
20274
|
-
await _classPrivateFieldGet(
|
|
20609
|
+
await _classPrivateFieldGet(_client11, this).send('Input.insertText', {
|
|
20275
20610
|
text: char
|
|
20276
20611
|
});
|
|
20277
20612
|
}
|
|
@@ -20402,7 +20737,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20402
20737
|
/**
|
|
20403
20738
|
* @internal
|
|
20404
20739
|
*/
|
|
20405
|
-
var
|
|
20740
|
+
var _client12 = /*#__PURE__*/new WeakMap();
|
|
20406
20741
|
var _keyboard = /*#__PURE__*/new WeakMap();
|
|
20407
20742
|
var _state2 = /*#__PURE__*/new WeakMap();
|
|
20408
20743
|
var _CdpMouse_brand = /*#__PURE__*/new WeakSet();
|
|
@@ -20411,7 +20746,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20411
20746
|
constructor(client, keyboard) {
|
|
20412
20747
|
super();
|
|
20413
20748
|
_classPrivateMethodInitSpec(this, _CdpMouse_brand);
|
|
20414
|
-
_classPrivateFieldInitSpec(this,
|
|
20749
|
+
_classPrivateFieldInitSpec(this, _client12, void 0);
|
|
20415
20750
|
_classPrivateFieldInitSpec(this, _keyboard, void 0);
|
|
20416
20751
|
_classPrivateFieldInitSpec(this, _state2, {
|
|
20417
20752
|
position: {
|
|
@@ -20422,11 +20757,11 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20422
20757
|
});
|
|
20423
20758
|
// Transactions can run in parallel, so we store each of thme in this array.
|
|
20424
20759
|
_classPrivateFieldInitSpec(this, _transactions, []);
|
|
20425
|
-
_classPrivateFieldSet(
|
|
20760
|
+
_classPrivateFieldSet(_client12, this, client);
|
|
20426
20761
|
_classPrivateFieldSet(_keyboard, this, keyboard);
|
|
20427
20762
|
}
|
|
20428
20763
|
updateClient(client) {
|
|
20429
|
-
_classPrivateFieldSet(
|
|
20764
|
+
_classPrivateFieldSet(_client12, this, client);
|
|
20430
20765
|
}
|
|
20431
20766
|
async reset() {
|
|
20432
20767
|
const actions = [];
|
|
@@ -20463,7 +20798,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20463
20798
|
buttons,
|
|
20464
20799
|
position
|
|
20465
20800
|
} = _classPrivateGetter(_CdpMouse_brand, this, _get_state);
|
|
20466
|
-
return _classPrivateFieldGet(
|
|
20801
|
+
return _classPrivateFieldGet(_client12, this).send('Input.dispatchMouseEvent', {
|
|
20467
20802
|
type: 'mouseMoved',
|
|
20468
20803
|
modifiers: _classPrivateFieldGet(_keyboard, this)._modifiers,
|
|
20469
20804
|
buttons,
|
|
@@ -20493,7 +20828,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20493
20828
|
buttons,
|
|
20494
20829
|
position
|
|
20495
20830
|
} = _classPrivateGetter(_CdpMouse_brand, this, _get_state);
|
|
20496
|
-
return _classPrivateFieldGet(
|
|
20831
|
+
return _classPrivateFieldGet(_client12, this).send('Input.dispatchMouseEvent', {
|
|
20497
20832
|
type: 'mousePressed',
|
|
20498
20833
|
modifiers: _classPrivateFieldGet(_keyboard, this)._modifiers,
|
|
20499
20834
|
clickCount,
|
|
@@ -20523,7 +20858,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20523
20858
|
buttons,
|
|
20524
20859
|
position
|
|
20525
20860
|
} = _classPrivateGetter(_CdpMouse_brand, this, _get_state);
|
|
20526
|
-
return _classPrivateFieldGet(
|
|
20861
|
+
return _classPrivateFieldGet(_client12, this).send('Input.dispatchMouseEvent', {
|
|
20527
20862
|
type: 'mouseReleased',
|
|
20528
20863
|
modifiers: _classPrivateFieldGet(_keyboard, this)._modifiers,
|
|
20529
20864
|
clickCount,
|
|
@@ -20580,7 +20915,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20580
20915
|
position,
|
|
20581
20916
|
buttons
|
|
20582
20917
|
} = _classPrivateGetter(_CdpMouse_brand, this, _get_state);
|
|
20583
|
-
await _classPrivateFieldGet(
|
|
20918
|
+
await _classPrivateFieldGet(_client12, this).send('Input.dispatchMouseEvent', {
|
|
20584
20919
|
type: 'mouseWheel',
|
|
20585
20920
|
pointerType: 'mouse',
|
|
20586
20921
|
modifiers: _classPrivateFieldGet(_keyboard, this)._modifiers,
|
|
@@ -20592,7 +20927,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20592
20927
|
}
|
|
20593
20928
|
async drag(start, target) {
|
|
20594
20929
|
const promise = new Promise(resolve => {
|
|
20595
|
-
_classPrivateFieldGet(
|
|
20930
|
+
_classPrivateFieldGet(_client12, this).once('Input.dragIntercepted', event => {
|
|
20596
20931
|
return resolve(event.data);
|
|
20597
20932
|
});
|
|
20598
20933
|
});
|
|
@@ -20602,7 +20937,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20602
20937
|
return await promise;
|
|
20603
20938
|
}
|
|
20604
20939
|
async dragEnter(target, data) {
|
|
20605
|
-
await _classPrivateFieldGet(
|
|
20940
|
+
await _classPrivateFieldGet(_client12, this).send('Input.dispatchDragEvent', {
|
|
20606
20941
|
type: 'dragEnter',
|
|
20607
20942
|
x: target.x,
|
|
20608
20943
|
y: target.y,
|
|
@@ -20611,7 +20946,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20611
20946
|
});
|
|
20612
20947
|
}
|
|
20613
20948
|
async dragOver(target, data) {
|
|
20614
|
-
await _classPrivateFieldGet(
|
|
20949
|
+
await _classPrivateFieldGet(_client12, this).send('Input.dispatchDragEvent', {
|
|
20615
20950
|
type: 'dragOver',
|
|
20616
20951
|
x: target.x,
|
|
20617
20952
|
y: target.y,
|
|
@@ -20620,7 +20955,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20620
20955
|
});
|
|
20621
20956
|
}
|
|
20622
20957
|
async drop(target, data) {
|
|
20623
|
-
await _classPrivateFieldGet(
|
|
20958
|
+
await _classPrivateFieldGet(_client12, this).send('Input.dispatchDragEvent', {
|
|
20624
20959
|
type: 'drop',
|
|
20625
20960
|
x: target.x,
|
|
20626
20961
|
y: target.y,
|
|
@@ -20693,28 +21028,28 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20693
21028
|
var _started = /*#__PURE__*/new WeakMap();
|
|
20694
21029
|
var _touchScreen = /*#__PURE__*/new WeakMap();
|
|
20695
21030
|
var _touchPoint = /*#__PURE__*/new WeakMap();
|
|
20696
|
-
var
|
|
21031
|
+
var _client13 = /*#__PURE__*/new WeakMap();
|
|
20697
21032
|
var _keyboard2 = /*#__PURE__*/new WeakMap();
|
|
20698
21033
|
class CdpTouchHandle {
|
|
20699
21034
|
constructor(client, touchScreen, keyboard, touchPoint) {
|
|
20700
21035
|
_classPrivateFieldInitSpec(this, _started, false);
|
|
20701
21036
|
_classPrivateFieldInitSpec(this, _touchScreen, void 0);
|
|
20702
21037
|
_classPrivateFieldInitSpec(this, _touchPoint, void 0);
|
|
20703
|
-
_classPrivateFieldInitSpec(this,
|
|
21038
|
+
_classPrivateFieldInitSpec(this, _client13, void 0);
|
|
20704
21039
|
_classPrivateFieldInitSpec(this, _keyboard2, void 0);
|
|
20705
|
-
_classPrivateFieldSet(
|
|
21040
|
+
_classPrivateFieldSet(_client13, this, client);
|
|
20706
21041
|
_classPrivateFieldSet(_touchScreen, this, touchScreen);
|
|
20707
21042
|
_classPrivateFieldSet(_keyboard2, this, keyboard);
|
|
20708
21043
|
_classPrivateFieldSet(_touchPoint, this, touchPoint);
|
|
20709
21044
|
}
|
|
20710
21045
|
updateClient(client) {
|
|
20711
|
-
_classPrivateFieldSet(
|
|
21046
|
+
_classPrivateFieldSet(_client13, this, client);
|
|
20712
21047
|
}
|
|
20713
21048
|
async start() {
|
|
20714
21049
|
if (_classPrivateFieldGet(_started, this)) {
|
|
20715
21050
|
throw new TouchError('Touch has already started');
|
|
20716
21051
|
}
|
|
20717
|
-
await _classPrivateFieldGet(
|
|
21052
|
+
await _classPrivateFieldGet(_client13, this).send('Input.dispatchTouchEvent', {
|
|
20718
21053
|
type: 'touchStart',
|
|
20719
21054
|
touchPoints: [_classPrivateFieldGet(_touchPoint, this)],
|
|
20720
21055
|
modifiers: _classPrivateFieldGet(_keyboard2, this)._modifiers
|
|
@@ -20724,14 +21059,14 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20724
21059
|
move(x, y) {
|
|
20725
21060
|
_classPrivateFieldGet(_touchPoint, this).x = Math.round(x);
|
|
20726
21061
|
_classPrivateFieldGet(_touchPoint, this).y = Math.round(y);
|
|
20727
|
-
return _classPrivateFieldGet(
|
|
21062
|
+
return _classPrivateFieldGet(_client13, this).send('Input.dispatchTouchEvent', {
|
|
20728
21063
|
type: 'touchMove',
|
|
20729
21064
|
touchPoints: [_classPrivateFieldGet(_touchPoint, this)],
|
|
20730
21065
|
modifiers: _classPrivateFieldGet(_keyboard2, this)._modifiers
|
|
20731
21066
|
});
|
|
20732
21067
|
}
|
|
20733
21068
|
async end() {
|
|
20734
|
-
await _classPrivateFieldGet(
|
|
21069
|
+
await _classPrivateFieldGet(_client13, this).send('Input.dispatchTouchEvent', {
|
|
20735
21070
|
type: 'touchEnd',
|
|
20736
21071
|
touchPoints: [_classPrivateFieldGet(_touchPoint, this)],
|
|
20737
21072
|
modifiers: _classPrivateFieldGet(_keyboard2, this)._modifiers
|
|
@@ -20742,18 +21077,18 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20742
21077
|
/**
|
|
20743
21078
|
* @internal
|
|
20744
21079
|
*/
|
|
20745
|
-
var
|
|
21080
|
+
var _client14 = /*#__PURE__*/new WeakMap();
|
|
20746
21081
|
var _keyboard3 = /*#__PURE__*/new WeakMap();
|
|
20747
21082
|
class CdpTouchscreen extends Touchscreen {
|
|
20748
21083
|
constructor(client, keyboard) {
|
|
20749
21084
|
super();
|
|
20750
|
-
_classPrivateFieldInitSpec(this,
|
|
21085
|
+
_classPrivateFieldInitSpec(this, _client14, void 0);
|
|
20751
21086
|
_classPrivateFieldInitSpec(this, _keyboard3, void 0);
|
|
20752
|
-
_classPrivateFieldSet(
|
|
21087
|
+
_classPrivateFieldSet(_client14, this, client);
|
|
20753
21088
|
_classPrivateFieldSet(_keyboard3, this, keyboard);
|
|
20754
21089
|
}
|
|
20755
21090
|
updateClient(client) {
|
|
20756
|
-
_classPrivateFieldSet(
|
|
21091
|
+
_classPrivateFieldSet(_client14, this, client);
|
|
20757
21092
|
this.touches.forEach(t => {
|
|
20758
21093
|
t.updateClient(client);
|
|
20759
21094
|
});
|
|
@@ -20768,7 +21103,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20768
21103
|
force: 0.5,
|
|
20769
21104
|
id
|
|
20770
21105
|
};
|
|
20771
|
-
const touch = new CdpTouchHandle(_classPrivateFieldGet(
|
|
21106
|
+
const touch = new CdpTouchHandle(_classPrivateFieldGet(_client14, this), this, _classPrivateFieldGet(_keyboard3, this), touchPoint);
|
|
20772
21107
|
await touch.start();
|
|
20773
21108
|
this.touches.push(touch);
|
|
20774
21109
|
return touch;
|
|
@@ -20791,7 +21126,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20791
21126
|
*
|
|
20792
21127
|
* @public
|
|
20793
21128
|
*/
|
|
20794
|
-
var
|
|
21129
|
+
var _client15 = /*#__PURE__*/new WeakMap();
|
|
20795
21130
|
var _recording = /*#__PURE__*/new WeakMap();
|
|
20796
21131
|
var _path = /*#__PURE__*/new WeakMap();
|
|
20797
21132
|
class Tracing {
|
|
@@ -20799,16 +21134,16 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20799
21134
|
* @internal
|
|
20800
21135
|
*/
|
|
20801
21136
|
constructor(client) {
|
|
20802
|
-
_classPrivateFieldInitSpec(this,
|
|
21137
|
+
_classPrivateFieldInitSpec(this, _client15, void 0);
|
|
20803
21138
|
_classPrivateFieldInitSpec(this, _recording, false);
|
|
20804
21139
|
_classPrivateFieldInitSpec(this, _path, void 0);
|
|
20805
|
-
_classPrivateFieldSet(
|
|
21140
|
+
_classPrivateFieldSet(_client15, this, client);
|
|
20806
21141
|
}
|
|
20807
21142
|
/**
|
|
20808
21143
|
* @internal
|
|
20809
21144
|
*/
|
|
20810
21145
|
updateClient(client) {
|
|
20811
|
-
_classPrivateFieldSet(
|
|
21146
|
+
_classPrivateFieldSet(_client15, this, client);
|
|
20812
21147
|
}
|
|
20813
21148
|
/**
|
|
20814
21149
|
* Starts a trace for the current page.
|
|
@@ -20838,7 +21173,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20838
21173
|
});
|
|
20839
21174
|
_classPrivateFieldSet(_path, this, path);
|
|
20840
21175
|
_classPrivateFieldSet(_recording, this, true);
|
|
20841
|
-
await _classPrivateFieldGet(
|
|
21176
|
+
await _classPrivateFieldGet(_client15, this).send('Tracing.start', {
|
|
20842
21177
|
transferMode: 'ReturnAsStream',
|
|
20843
21178
|
traceConfig: {
|
|
20844
21179
|
excludedCategories,
|
|
@@ -20852,10 +21187,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20852
21187
|
*/
|
|
20853
21188
|
async stop() {
|
|
20854
21189
|
const contentDeferred = Deferred.create();
|
|
20855
|
-
_classPrivateFieldGet(
|
|
21190
|
+
_classPrivateFieldGet(_client15, this).once('Tracing.tracingComplete', async event => {
|
|
20856
21191
|
try {
|
|
20857
21192
|
assert(event.stream, 'Missing "stream"');
|
|
20858
|
-
const readable = await getReadableFromProtocolStream(_classPrivateFieldGet(
|
|
21193
|
+
const readable = await getReadableFromProtocolStream(_classPrivateFieldGet(_client15, this), event.stream);
|
|
20859
21194
|
const typedArray = await getReadableAsTypedArray(readable, _classPrivateFieldGet(_path, this));
|
|
20860
21195
|
contentDeferred.resolve(typedArray ?? undefined);
|
|
20861
21196
|
} catch (error) {
|
|
@@ -20866,80 +21201,298 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20866
21201
|
}
|
|
20867
21202
|
}
|
|
20868
21203
|
});
|
|
20869
|
-
await _classPrivateFieldGet(
|
|
21204
|
+
await _classPrivateFieldGet(_client15, this).send('Tracing.end');
|
|
20870
21205
|
_classPrivateFieldSet(_recording, this, false);
|
|
20871
21206
|
return await contentDeferred.valueOrThrow();
|
|
20872
21207
|
}
|
|
20873
21208
|
}
|
|
20874
21209
|
|
|
20875
21210
|
/**
|
|
20876
|
-
* @
|
|
21211
|
+
* @license
|
|
21212
|
+
* Copyright 2026 Google Inc.
|
|
21213
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
20877
21214
|
*/
|
|
20878
|
-
|
|
20879
|
-
|
|
20880
|
-
|
|
20881
|
-
|
|
20882
|
-
|
|
20883
|
-
|
|
20884
|
-
|
|
20885
|
-
|
|
20886
|
-
|
|
20887
|
-
|
|
20888
|
-
|
|
20889
|
-
|
|
20890
|
-
|
|
20891
|
-
|
|
20892
|
-
|
|
20893
|
-
|
|
20894
|
-
|
|
20895
|
-
|
|
20896
|
-
|
|
20897
|
-
|
|
20898
|
-
|
|
20899
|
-
|
|
20900
|
-
|
|
21215
|
+
/**
|
|
21216
|
+
* Represents a registered WebMCP tool available on the page.
|
|
21217
|
+
*
|
|
21218
|
+
* @public
|
|
21219
|
+
*/
|
|
21220
|
+
var _webmcp = /*#__PURE__*/new WeakMap();
|
|
21221
|
+
var _backendNodeId2 = /*#__PURE__*/new WeakMap();
|
|
21222
|
+
var _formElement = /*#__PURE__*/new WeakMap();
|
|
21223
|
+
class WebMCPTool extends EventEmitter {
|
|
21224
|
+
/**
|
|
21225
|
+
* @internal
|
|
21226
|
+
*/
|
|
21227
|
+
constructor(webmcp, tool, frame) {
|
|
21228
|
+
super();
|
|
21229
|
+
_classPrivateFieldInitSpec(this, _webmcp, void 0);
|
|
21230
|
+
_classPrivateFieldInitSpec(this, _backendNodeId2, void 0);
|
|
21231
|
+
_classPrivateFieldInitSpec(this, _formElement, void 0);
|
|
21232
|
+
/**
|
|
21233
|
+
* Tool name.
|
|
21234
|
+
*/
|
|
21235
|
+
_defineProperty(this, "name", void 0);
|
|
21236
|
+
/**
|
|
21237
|
+
* Tool description.
|
|
21238
|
+
*/
|
|
21239
|
+
_defineProperty(this, "description", void 0);
|
|
21240
|
+
/**
|
|
21241
|
+
* Schema for the tool's input parameters.
|
|
21242
|
+
*/
|
|
21243
|
+
_defineProperty(this, "inputSchema", void 0);
|
|
21244
|
+
/**
|
|
21245
|
+
* Optional annotations for the tool.
|
|
21246
|
+
*/
|
|
21247
|
+
_defineProperty(this, "annotations", void 0);
|
|
21248
|
+
/**
|
|
21249
|
+
* Frame the tool was defined for.
|
|
21250
|
+
*/
|
|
21251
|
+
_defineProperty(this, "frame", void 0);
|
|
21252
|
+
/**
|
|
21253
|
+
* Source location that defined the tool (if available).
|
|
21254
|
+
*/
|
|
21255
|
+
_defineProperty(this, "location", void 0);
|
|
21256
|
+
/**
|
|
21257
|
+
* @internal
|
|
21258
|
+
*/
|
|
21259
|
+
_defineProperty(this, "rawStackTrace", void 0);
|
|
21260
|
+
_classPrivateFieldSet(_webmcp, this, webmcp);
|
|
21261
|
+
this.name = tool.name;
|
|
21262
|
+
this.description = tool.description;
|
|
21263
|
+
this.inputSchema = tool.inputSchema;
|
|
21264
|
+
this.annotations = tool.annotations;
|
|
21265
|
+
this.frame = frame;
|
|
21266
|
+
_classPrivateFieldSet(_backendNodeId2, this, tool.backendNodeId);
|
|
21267
|
+
if (tool.stackTrace?.callFrames.length) {
|
|
21268
|
+
this.location = {
|
|
21269
|
+
url: tool.stackTrace.callFrames[0].url,
|
|
21270
|
+
lineNumber: tool.stackTrace.callFrames[0].lineNumber,
|
|
21271
|
+
columnNumber: tool.stackTrace.callFrames[0].columnNumber
|
|
21272
|
+
};
|
|
21273
|
+
}
|
|
21274
|
+
this.rawStackTrace = tool.stackTrace;
|
|
21275
|
+
}
|
|
21276
|
+
/**
|
|
21277
|
+
* The corresponding ElementHandle when tool was registered via a form.
|
|
21278
|
+
*/
|
|
21279
|
+
get formElement() {
|
|
21280
|
+
return (async () => {
|
|
21281
|
+
if (_classPrivateFieldGet(_formElement, this) && !_classPrivateFieldGet(_formElement, this).disposed) {
|
|
21282
|
+
return _classPrivateFieldGet(_formElement, this);
|
|
20901
21283
|
}
|
|
20902
|
-
|
|
20903
|
-
|
|
20904
|
-
|
|
20905
|
-
|
|
20906
|
-
|
|
20907
|
-
|
|
20908
|
-
networkManager?.addClient(_classPrivateFieldGet(_client15, this)).catch(debugError);
|
|
20909
|
-
_classPrivateFieldGet(_client15, this).send('Runtime.enable').catch(debugError);
|
|
21284
|
+
if (!_classPrivateFieldGet(_backendNodeId2, this)) {
|
|
21285
|
+
return undefined;
|
|
21286
|
+
}
|
|
21287
|
+
_classPrivateFieldSet(_formElement, this, await this.frame.worlds[MAIN_WORLD].adoptBackendNode(_classPrivateFieldGet(_backendNodeId2, this)));
|
|
21288
|
+
return _classPrivateFieldGet(_formElement, this);
|
|
21289
|
+
})();
|
|
20910
21290
|
}
|
|
20911
|
-
|
|
20912
|
-
|
|
21291
|
+
/**
|
|
21292
|
+
* Executes tool with input parameters, matching tool's `inputSchema`.
|
|
21293
|
+
*/
|
|
21294
|
+
async execute(input = {}) {
|
|
21295
|
+
const {
|
|
21296
|
+
invocationId
|
|
21297
|
+
} = await _classPrivateFieldGet(_webmcp, this).invokeTool(this, input);
|
|
21298
|
+
return await new Promise(resolve => {
|
|
21299
|
+
const handler = event => {
|
|
21300
|
+
if (event.id === invocationId) {
|
|
21301
|
+
_classPrivateFieldGet(_webmcp, this).off('toolresponded', handler);
|
|
21302
|
+
resolve(event);
|
|
21303
|
+
}
|
|
21304
|
+
};
|
|
21305
|
+
_classPrivateFieldGet(_webmcp, this).on('toolresponded', handler);
|
|
21306
|
+
});
|
|
20913
21307
|
}
|
|
20914
|
-
|
|
20915
|
-
|
|
21308
|
+
}
|
|
21309
|
+
/**
|
|
21310
|
+
* @public
|
|
21311
|
+
*/
|
|
21312
|
+
class WebMCPToolCall {
|
|
21313
|
+
/**
|
|
21314
|
+
* @internal
|
|
21315
|
+
*/
|
|
21316
|
+
constructor(invocationId, tool, input) {
|
|
21317
|
+
/**
|
|
21318
|
+
* Tool invocation identifier.
|
|
21319
|
+
*/
|
|
21320
|
+
_defineProperty(this, "id", void 0);
|
|
21321
|
+
/**
|
|
21322
|
+
* Tool that was called.
|
|
21323
|
+
*/
|
|
21324
|
+
_defineProperty(this, "tool", void 0);
|
|
21325
|
+
/**
|
|
21326
|
+
* The input parameters used for the call.
|
|
21327
|
+
*/
|
|
21328
|
+
_defineProperty(this, "input", void 0);
|
|
21329
|
+
this.id = invocationId;
|
|
21330
|
+
this.tool = tool;
|
|
21331
|
+
try {
|
|
21332
|
+
this.input = JSON.parse(input);
|
|
21333
|
+
} catch (error) {
|
|
21334
|
+
this.input = {};
|
|
21335
|
+
debugError(error);
|
|
21336
|
+
}
|
|
20916
21337
|
}
|
|
20917
|
-
|
|
20918
|
-
|
|
20919
|
-
|
|
20920
|
-
|
|
20921
|
-
|
|
20922
|
-
|
|
20923
|
-
|
|
20924
|
-
|
|
20925
|
-
|
|
20926
|
-
|
|
20927
|
-
|
|
20928
|
-
|
|
20929
|
-
|
|
21338
|
+
}
|
|
21339
|
+
/**
|
|
21340
|
+
* The experimental WebMCP class provides an API for the WebMCP API.
|
|
21341
|
+
*
|
|
21342
|
+
* See the
|
|
21343
|
+
* {@link https://pptr.dev/guides/webmcp|WebMCP guide}
|
|
21344
|
+
* for more details.
|
|
21345
|
+
*
|
|
21346
|
+
* @example
|
|
21347
|
+
*
|
|
21348
|
+
* ```ts
|
|
21349
|
+
* await page.goto('https://www.example.com');
|
|
21350
|
+
* const tools = page.webmcp.tools();
|
|
21351
|
+
* for (const tool of tools) {
|
|
21352
|
+
* console.log(`Tool found: ${tool.name} - ${tool.description}`);
|
|
21353
|
+
* }
|
|
21354
|
+
* ```
|
|
21355
|
+
*
|
|
21356
|
+
* @experimental
|
|
21357
|
+
* @public
|
|
21358
|
+
*/
|
|
21359
|
+
var _client16 = /*#__PURE__*/new WeakMap();
|
|
21360
|
+
var _frameManager2 = /*#__PURE__*/new WeakMap();
|
|
21361
|
+
var _tools = /*#__PURE__*/new WeakMap();
|
|
21362
|
+
var _pendingCalls = /*#__PURE__*/new WeakMap();
|
|
21363
|
+
var _onToolsAdded = /*#__PURE__*/new WeakMap();
|
|
21364
|
+
var _onToolsRemoved = /*#__PURE__*/new WeakMap();
|
|
21365
|
+
var _onToolInvoked = /*#__PURE__*/new WeakMap();
|
|
21366
|
+
var _onToolResponded = /*#__PURE__*/new WeakMap();
|
|
21367
|
+
var _onFrameNavigated2 = /*#__PURE__*/new WeakMap();
|
|
21368
|
+
var _WebMCP_brand = /*#__PURE__*/new WeakSet();
|
|
21369
|
+
class WebMCP extends EventEmitter {
|
|
21370
|
+
/**
|
|
21371
|
+
* @internal
|
|
21372
|
+
*/
|
|
21373
|
+
constructor(client, frameManager) {
|
|
21374
|
+
super();
|
|
21375
|
+
_classPrivateMethodInitSpec(this, _WebMCP_brand);
|
|
21376
|
+
_classPrivateFieldInitSpec(this, _client16, void 0);
|
|
21377
|
+
_classPrivateFieldInitSpec(this, _frameManager2, void 0);
|
|
21378
|
+
_classPrivateFieldInitSpec(this, _tools, new Map());
|
|
21379
|
+
_classPrivateFieldInitSpec(this, _pendingCalls, new Map());
|
|
21380
|
+
_classPrivateFieldInitSpec(this, _onToolsAdded, event => {
|
|
21381
|
+
const tools = [];
|
|
21382
|
+
for (const tool of event.tools) {
|
|
21383
|
+
const frame = _classPrivateFieldGet(_frameManager2, this).frame(tool.frameId);
|
|
21384
|
+
if (!frame) {
|
|
21385
|
+
continue;
|
|
20930
21386
|
}
|
|
20931
|
-
|
|
20932
|
-
{
|
|
20933
|
-
|
|
20934
|
-
targetId: _classPrivateFieldGet(_id6, this)
|
|
20935
|
-
});
|
|
20936
|
-
break;
|
|
21387
|
+
const frameTools = _classPrivateFieldGet(_tools, this).get(tool.frameId) ?? new Map();
|
|
21388
|
+
if (!_classPrivateFieldGet(_tools, this).has(tool.frameId)) {
|
|
21389
|
+
_classPrivateFieldGet(_tools, this).set(tool.frameId, frameTools);
|
|
20937
21390
|
}
|
|
20938
|
-
|
|
20939
|
-
|
|
20940
|
-
|
|
21391
|
+
const addedTool = new WebMCPTool(this, tool, frame);
|
|
21392
|
+
frameTools.set(tool.name, addedTool);
|
|
21393
|
+
tools.push(addedTool);
|
|
21394
|
+
}
|
|
21395
|
+
this.emit('toolsadded', {
|
|
21396
|
+
tools
|
|
21397
|
+
});
|
|
21398
|
+
});
|
|
21399
|
+
_classPrivateFieldInitSpec(this, _onToolsRemoved, event => {
|
|
21400
|
+
const tools = [];
|
|
21401
|
+
event.tools.forEach(tool => {
|
|
21402
|
+
const removedTool = _classPrivateFieldGet(_tools, this).get(tool.frameId)?.get(tool.name);
|
|
21403
|
+
if (removedTool) {
|
|
21404
|
+
tools.push(removedTool);
|
|
21405
|
+
}
|
|
21406
|
+
_classPrivateFieldGet(_tools, this).get(tool.frameId)?.delete(tool.name);
|
|
21407
|
+
});
|
|
21408
|
+
this.emit('toolsremoved', {
|
|
21409
|
+
tools
|
|
21410
|
+
});
|
|
21411
|
+
});
|
|
21412
|
+
_classPrivateFieldInitSpec(this, _onToolInvoked, event => {
|
|
21413
|
+
const tool = _classPrivateFieldGet(_tools, this).get(event.frameId)?.get(event.toolName);
|
|
21414
|
+
if (!tool) {
|
|
21415
|
+
return;
|
|
21416
|
+
}
|
|
21417
|
+
const call = new WebMCPToolCall(event.invocationId, tool, event.input);
|
|
21418
|
+
_classPrivateFieldGet(_pendingCalls, this).set(call.id, call);
|
|
21419
|
+
tool.emit('toolinvoked', call);
|
|
21420
|
+
this.emit('toolinvoked', call);
|
|
21421
|
+
});
|
|
21422
|
+
_classPrivateFieldInitSpec(this, _onToolResponded, event => {
|
|
21423
|
+
const call = _classPrivateFieldGet(_pendingCalls, this).get(event.invocationId);
|
|
21424
|
+
if (call) {
|
|
21425
|
+
_classPrivateFieldGet(_pendingCalls, this).delete(event.invocationId);
|
|
21426
|
+
}
|
|
21427
|
+
const response = {
|
|
21428
|
+
id: event.invocationId,
|
|
21429
|
+
call: call,
|
|
21430
|
+
status: event.status,
|
|
21431
|
+
output: event.output,
|
|
21432
|
+
errorText: event.errorText,
|
|
21433
|
+
exception: event.exception
|
|
21434
|
+
};
|
|
21435
|
+
this.emit('toolresponded', response);
|
|
21436
|
+
});
|
|
21437
|
+
_classPrivateFieldInitSpec(this, _onFrameNavigated2, frame => {
|
|
21438
|
+
_classPrivateFieldGet(_pendingCalls, this).clear();
|
|
21439
|
+
const frameTools = _classPrivateFieldGet(_tools, this).get(frame._id);
|
|
21440
|
+
if (!frameTools) {
|
|
21441
|
+
return;
|
|
21442
|
+
}
|
|
21443
|
+
const tools = Array.from(frameTools.values());
|
|
21444
|
+
_classPrivateFieldGet(_tools, this).delete(frame._id);
|
|
21445
|
+
if (tools.length) {
|
|
21446
|
+
this.emit('toolsremoved', {
|
|
21447
|
+
tools
|
|
20941
21448
|
});
|
|
20942
|
-
|
|
21449
|
+
}
|
|
21450
|
+
});
|
|
21451
|
+
_classPrivateFieldSet(_client16, this, client);
|
|
21452
|
+
_classPrivateFieldSet(_frameManager2, this, frameManager);
|
|
21453
|
+
_classPrivateFieldGet(_frameManager2, this).on(exports.FrameManagerEvent.FrameNavigated, _classPrivateFieldGet(_onFrameNavigated2, this));
|
|
21454
|
+
_assertClassBrand(_WebMCP_brand, this, _bindListeners).call(this);
|
|
21455
|
+
}
|
|
21456
|
+
/**
|
|
21457
|
+
* @internal
|
|
21458
|
+
*/
|
|
21459
|
+
async initialize() {
|
|
21460
|
+
// @ts-expect-error WebMCP is not yet in the Protocol types.
|
|
21461
|
+
return await _classPrivateFieldGet(_client16, this).send('WebMCP.enable').catch(debugError);
|
|
21462
|
+
}
|
|
21463
|
+
/**
|
|
21464
|
+
* @internal
|
|
21465
|
+
*/
|
|
21466
|
+
async invokeTool(tool, input) {
|
|
21467
|
+
// @ts-expect-error WebMCP is not yet in the Protocol types.
|
|
21468
|
+
return await _classPrivateFieldGet(_client16, this).send('WebMCP.invokeTool', {
|
|
21469
|
+
frameId: tool.frame._id,
|
|
21470
|
+
toolName: tool.name,
|
|
21471
|
+
input
|
|
21472
|
+
});
|
|
21473
|
+
}
|
|
21474
|
+
/**
|
|
21475
|
+
* Gets all WebMCP tools defined by the page.
|
|
21476
|
+
*/
|
|
21477
|
+
tools() {
|
|
21478
|
+
return Array.from(_classPrivateFieldGet(_tools, this).values()).flatMap(toolMap => {
|
|
21479
|
+
return Array.from(toolMap.values());
|
|
21480
|
+
});
|
|
21481
|
+
}
|
|
21482
|
+
/**
|
|
21483
|
+
* @internal
|
|
21484
|
+
*/
|
|
21485
|
+
updateClient(client) {
|
|
21486
|
+
// @ts-expect-error WebMCP is not yet in the Protocol types.
|
|
21487
|
+
_classPrivateFieldGet(_client16, this).off('WebMCP.toolsAdded', _classPrivateFieldGet(_onToolsAdded, this));
|
|
21488
|
+
// @ts-expect-error WebMCP is not yet in the Protocol types.
|
|
21489
|
+
_classPrivateFieldGet(_client16, this).off('WebMCP.toolsRemoved', _classPrivateFieldGet(_onToolsRemoved, this));
|
|
21490
|
+
// @ts-expect-error WebMCP is not yet in the Protocol types.
|
|
21491
|
+
_classPrivateFieldGet(_client16, this).off('WebMCP.toolInvoked', _classPrivateFieldGet(_onToolInvoked, this));
|
|
21492
|
+
// @ts-expect-error WebMCP is not yet in the Protocol types.
|
|
21493
|
+
_classPrivateFieldGet(_client16, this).off('WebMCP.toolResponded', _classPrivateFieldGet(_onToolResponded, this));
|
|
21494
|
+
_classPrivateFieldSet(_client16, this, client);
|
|
21495
|
+
_assertClassBrand(_WebMCP_brand, this, _bindListeners).call(this);
|
|
20943
21496
|
}
|
|
20944
21497
|
}
|
|
20945
21498
|
|
|
@@ -20948,6 +21501,16 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
20948
21501
|
* Copyright 2017 Google Inc.
|
|
20949
21502
|
* SPDX-License-Identifier: Apache-2.0
|
|
20950
21503
|
*/
|
|
21504
|
+
function _bindListeners() {
|
|
21505
|
+
// @ts-expect-error WebMCP is not yet in the Protocol types.
|
|
21506
|
+
_classPrivateFieldGet(_client16, this).on('WebMCP.toolsAdded', _classPrivateFieldGet(_onToolsAdded, this));
|
|
21507
|
+
// @ts-expect-error WebMCP is not yet in the Protocol types.
|
|
21508
|
+
_classPrivateFieldGet(_client16, this).on('WebMCP.toolsRemoved', _classPrivateFieldGet(_onToolsRemoved, this));
|
|
21509
|
+
// @ts-expect-error WebMCP is not yet in the Protocol types.
|
|
21510
|
+
_classPrivateFieldGet(_client16, this).on('WebMCP.toolInvoked', _classPrivateFieldGet(_onToolInvoked, this));
|
|
21511
|
+
// @ts-expect-error WebMCP is not yet in the Protocol types.
|
|
21512
|
+
_classPrivateFieldGet(_client16, this).on('WebMCP.toolResponded', _classPrivateFieldGet(_onToolResponded, this));
|
|
21513
|
+
}
|
|
20951
21514
|
var __addDisposableResource$1 = undefined && undefined.__addDisposableResource || function (env, value, async) {
|
|
20952
21515
|
if (value !== null && value !== void 0) {
|
|
20953
21516
|
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
@@ -21013,14 +21576,6 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21013
21576
|
var e = new Error(message);
|
|
21014
21577
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
21015
21578
|
});
|
|
21016
|
-
function convertConsoleMessageLevel(method) {
|
|
21017
|
-
switch (method) {
|
|
21018
|
-
case 'warning':
|
|
21019
|
-
return 'warn';
|
|
21020
|
-
default:
|
|
21021
|
-
return method;
|
|
21022
|
-
}
|
|
21023
|
-
}
|
|
21024
21579
|
/**
|
|
21025
21580
|
* @internal
|
|
21026
21581
|
*/
|
|
@@ -21047,9 +21602,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21047
21602
|
var _keyboard4 = /*#__PURE__*/new WeakMap();
|
|
21048
21603
|
var _mouse = /*#__PURE__*/new WeakMap();
|
|
21049
21604
|
var _touchscreen = /*#__PURE__*/new WeakMap();
|
|
21050
|
-
var
|
|
21605
|
+
var _frameManager3 = /*#__PURE__*/new WeakMap();
|
|
21051
21606
|
var _emulationManager = /*#__PURE__*/new WeakMap();
|
|
21052
21607
|
var _tracing = /*#__PURE__*/new WeakMap();
|
|
21608
|
+
var _webmcp2 = /*#__PURE__*/new WeakMap();
|
|
21053
21609
|
var _bindings3 = /*#__PURE__*/new WeakMap();
|
|
21054
21610
|
var _exposedFunctions = /*#__PURE__*/new WeakMap();
|
|
21055
21611
|
var _coverage = /*#__PURE__*/new WeakMap();
|
|
@@ -21092,9 +21648,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21092
21648
|
_classPrivateFieldInitSpec(this, _keyboard4, void 0);
|
|
21093
21649
|
_classPrivateFieldInitSpec(this, _mouse, void 0);
|
|
21094
21650
|
_classPrivateFieldInitSpec(this, _touchscreen, void 0);
|
|
21095
|
-
_classPrivateFieldInitSpec(this,
|
|
21651
|
+
_classPrivateFieldInitSpec(this, _frameManager3, void 0);
|
|
21096
21652
|
_classPrivateFieldInitSpec(this, _emulationManager, void 0);
|
|
21097
21653
|
_classPrivateFieldInitSpec(this, _tracing, void 0);
|
|
21654
|
+
_classPrivateFieldInitSpec(this, _webmcp2, void 0);
|
|
21098
21655
|
_classPrivateFieldInitSpec(this, _bindings3, new Map());
|
|
21099
21656
|
_classPrivateFieldInitSpec(this, _exposedFunctions, new Map());
|
|
21100
21657
|
_classPrivateFieldInitSpec(this, _coverage, void 0);
|
|
@@ -21115,10 +21672,25 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21115
21672
|
});
|
|
21116
21673
|
_classPrivateFieldInitSpec(this, _onAttachedToTarget, session => {
|
|
21117
21674
|
assert(session instanceof CdpCDPSession);
|
|
21118
|
-
_classPrivateFieldGet(
|
|
21675
|
+
_classPrivateFieldGet(_frameManager3, this).onAttachedToTarget(session.target());
|
|
21119
21676
|
if (session.target()._getTargetInfo().type === 'worker') {
|
|
21120
|
-
const worker = new CdpWebWorker(session, session.target().url(), session.target()._targetId, session.target().type(), _assertClassBrand(_CdpPage_brand, this,
|
|
21677
|
+
const worker = new CdpWebWorker(session, session.target().url(), session.target()._targetId, session.target().type(), _assertClassBrand(_CdpPage_brand, this, _handleException).bind(this), _classPrivateFieldGet(_frameManager3, this).networkManager);
|
|
21121
21678
|
_classPrivateFieldGet(_workers, this).set(session.id(), worker);
|
|
21679
|
+
worker.internalEmitter.on(exports.WebWorkerEvent.Console, message => {
|
|
21680
|
+
const noListenersForConsoleOnPage = this.listenerCount("console" /* PageEvent.Console */) === 0;
|
|
21681
|
+
const noListenersForConsoleOnWorker = worker.listenerCount(exports.WebWorkerEvent.Console) === 0;
|
|
21682
|
+
if (noListenersForConsoleOnPage && noListenersForConsoleOnWorker) {
|
|
21683
|
+
// eslint-disable-next-line max-len -- The comment is long.
|
|
21684
|
+
// eslint-disable-next-line @puppeteer/use-using -- These are not owned by this function.
|
|
21685
|
+
for (const arg of message.args()) {
|
|
21686
|
+
void arg.dispose().catch(debugError);
|
|
21687
|
+
}
|
|
21688
|
+
return;
|
|
21689
|
+
}
|
|
21690
|
+
if (!noListenersForConsoleOnPage) {
|
|
21691
|
+
this.emit("console" /* PageEvent.Console */, message);
|
|
21692
|
+
}
|
|
21693
|
+
});
|
|
21122
21694
|
this.emit("workercreated" /* PageEvent.WorkerCreated */, worker);
|
|
21123
21695
|
}
|
|
21124
21696
|
session.on(exports.CDPSessionEvent.Ready, _classPrivateFieldGet(_onAttachedToTarget, this));
|
|
@@ -21134,15 +21706,16 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21134
21706
|
_classPrivateFieldSet(_keyboard4, this, new CdpKeyboard(client));
|
|
21135
21707
|
_classPrivateFieldSet(_mouse, this, new CdpMouse(client, _classPrivateFieldGet(_keyboard4, this)));
|
|
21136
21708
|
_classPrivateFieldSet(_touchscreen, this, new CdpTouchscreen(client, _classPrivateFieldGet(_keyboard4, this)));
|
|
21137
|
-
_classPrivateFieldSet(
|
|
21709
|
+
_classPrivateFieldSet(_frameManager3, this, new FrameManager(client, this, this._timeoutSettings));
|
|
21138
21710
|
_classPrivateFieldSet(_emulationManager, this, new EmulationManager(client));
|
|
21139
21711
|
_classPrivateFieldSet(_tracing, this, new Tracing(client));
|
|
21712
|
+
_classPrivateFieldSet(_webmcp2, this, new WebMCP(client, _classPrivateFieldGet(_frameManager3, this)));
|
|
21140
21713
|
_classPrivateFieldSet(_coverage, this, new Coverage(client));
|
|
21141
21714
|
_classPrivateFieldSet(_viewport, this, null);
|
|
21142
21715
|
// Use browser context's connection, as current Bluetooth emulation in Chromium is
|
|
21143
21716
|
// implemented on the browser context level, and not tight to the specific tab.
|
|
21144
21717
|
_classPrivateFieldSet(_cdpBluetoothEmulation, this, new CdpBluetoothEmulation(_classPrivateFieldGet(_primaryTargetClient, this).connection()));
|
|
21145
|
-
const frameManagerEmitter = new EventEmitter(_classPrivateFieldGet(
|
|
21718
|
+
const frameManagerEmitter = new EventEmitter(_classPrivateFieldGet(_frameManager3, this));
|
|
21146
21719
|
frameManagerEmitter.on(exports.FrameManagerEvent.FrameAttached, frame => {
|
|
21147
21720
|
this.emit("frameattached" /* PageEvent.FrameAttached */, frame);
|
|
21148
21721
|
});
|
|
@@ -21158,7 +21731,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21158
21731
|
frameManagerEmitter.on(exports.FrameManagerEvent.BindingCalled, ([world, event]) => {
|
|
21159
21732
|
void _assertClassBrand(_CdpPage_brand, this, _onBindingCalled2).call(this, world, event);
|
|
21160
21733
|
});
|
|
21161
|
-
const networkManagerEmitter = new EventEmitter(_classPrivateFieldGet(
|
|
21734
|
+
const networkManagerEmitter = new EventEmitter(_classPrivateFieldGet(_frameManager3, this).networkManager);
|
|
21162
21735
|
networkManagerEmitter.on(exports.NetworkManagerEvent.Request, request => {
|
|
21163
21736
|
this.emit("request" /* PageEvent.Request */, request);
|
|
21164
21737
|
});
|
|
@@ -21266,7 +21839,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21266
21839
|
return _classPrivateFieldGet(_primaryTarget, this).browserContext();
|
|
21267
21840
|
}
|
|
21268
21841
|
mainFrame() {
|
|
21269
|
-
return _classPrivateFieldGet(
|
|
21842
|
+
return _classPrivateFieldGet(_frameManager3, this).mainFrame();
|
|
21270
21843
|
}
|
|
21271
21844
|
get keyboard() {
|
|
21272
21845
|
return _classPrivateFieldGet(_keyboard4, this);
|
|
@@ -21280,14 +21853,17 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21280
21853
|
get tracing() {
|
|
21281
21854
|
return _classPrivateFieldGet(_tracing, this);
|
|
21282
21855
|
}
|
|
21856
|
+
get webmcp() {
|
|
21857
|
+
return _classPrivateFieldGet(_webmcp2, this);
|
|
21858
|
+
}
|
|
21283
21859
|
frames() {
|
|
21284
|
-
return _classPrivateFieldGet(
|
|
21860
|
+
return _classPrivateFieldGet(_frameManager3, this).frames();
|
|
21285
21861
|
}
|
|
21286
21862
|
workers() {
|
|
21287
21863
|
return Array.from(_classPrivateFieldGet(_workers, this).values());
|
|
21288
21864
|
}
|
|
21289
21865
|
async setRequestInterception(value) {
|
|
21290
|
-
return await _classPrivateFieldGet(
|
|
21866
|
+
return await _classPrivateFieldGet(_frameManager3, this).networkManager.setRequestInterception(value);
|
|
21291
21867
|
}
|
|
21292
21868
|
async setBypassServiceWorker(bypass) {
|
|
21293
21869
|
_classPrivateFieldSet(_serviceWorkerBypassed, this, bypass);
|
|
@@ -21302,10 +21878,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21302
21878
|
});
|
|
21303
21879
|
}
|
|
21304
21880
|
async setOfflineMode(enabled) {
|
|
21305
|
-
return await _classPrivateFieldGet(
|
|
21881
|
+
return await _classPrivateFieldGet(_frameManager3, this).networkManager.setOfflineMode(enabled);
|
|
21306
21882
|
}
|
|
21307
21883
|
async emulateNetworkConditions(networkConditions) {
|
|
21308
|
-
return await _classPrivateFieldGet(
|
|
21884
|
+
return await _classPrivateFieldGet(_frameManager3, this).networkManager.emulateNetworkConditions(networkConditions);
|
|
21309
21885
|
}
|
|
21310
21886
|
async emulateFocusedPage(enabled) {
|
|
21311
21887
|
return await _classPrivateFieldGet(_emulationManager, this).emulateFocus(enabled);
|
|
@@ -21420,7 +21996,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21420
21996
|
_classPrivateFieldGet(_bindings3, this).set(name, binding);
|
|
21421
21997
|
const [{
|
|
21422
21998
|
identifier
|
|
21423
|
-
}] = await Promise.all([_classPrivateFieldGet(
|
|
21999
|
+
}] = await Promise.all([_classPrivateFieldGet(_frameManager3, this).evaluateOnNewDocument(source), _classPrivateFieldGet(_frameManager3, this).addExposedFunctionBinding(binding)]);
|
|
21424
22000
|
_classPrivateFieldGet(_exposedFunctions, this).set(name, identifier);
|
|
21425
22001
|
}
|
|
21426
22002
|
async removeExposedFunction(name) {
|
|
@@ -21432,20 +22008,20 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21432
22008
|
const binding = _classPrivateFieldGet(_bindings3, this).get(name);
|
|
21433
22009
|
_classPrivateFieldGet(_exposedFunctions, this).delete(name);
|
|
21434
22010
|
_classPrivateFieldGet(_bindings3, this).delete(name);
|
|
21435
|
-
await Promise.all([_classPrivateFieldGet(
|
|
22011
|
+
await Promise.all([_classPrivateFieldGet(_frameManager3, this).removeScriptToEvaluateOnNewDocument(exposedFunctionId), _classPrivateFieldGet(_frameManager3, this).removeExposedFunctionBinding(binding)]);
|
|
21436
22012
|
}
|
|
21437
22013
|
async authenticate(credentials) {
|
|
21438
|
-
return await _classPrivateFieldGet(
|
|
22014
|
+
return await _classPrivateFieldGet(_frameManager3, this).networkManager.authenticate(credentials);
|
|
21439
22015
|
}
|
|
21440
22016
|
async setExtraHTTPHeaders(headers) {
|
|
21441
|
-
return await _classPrivateFieldGet(
|
|
22017
|
+
return await _classPrivateFieldGet(_frameManager3, this).networkManager.setExtraHTTPHeaders(headers);
|
|
21442
22018
|
}
|
|
21443
22019
|
async setUserAgent(userAgentOrOptions, userAgentMetadata) {
|
|
21444
22020
|
if (typeof userAgentOrOptions === 'string') {
|
|
21445
|
-
return await _classPrivateFieldGet(
|
|
22021
|
+
return await _classPrivateFieldGet(_frameManager3, this).networkManager.setUserAgent(userAgentOrOptions, userAgentMetadata);
|
|
21446
22022
|
} else {
|
|
21447
22023
|
const userAgent = userAgentOrOptions.userAgent ?? (await this.browser().userAgent());
|
|
21448
|
-
return await _classPrivateFieldGet(
|
|
22024
|
+
return await _classPrivateFieldGet(_frameManager3, this).networkManager.setUserAgent(userAgent, userAgentOrOptions.userAgentMetadata, userAgentOrOptions.platform);
|
|
21449
22025
|
}
|
|
21450
22026
|
}
|
|
21451
22027
|
async metrics() {
|
|
@@ -21508,6 +22084,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21508
22084
|
enabled
|
|
21509
22085
|
});
|
|
21510
22086
|
}
|
|
22087
|
+
async triggerExtensionAction(extension) {
|
|
22088
|
+
return await extension.triggerAction(this);
|
|
22089
|
+
}
|
|
21511
22090
|
async emulateMediaType(type) {
|
|
21512
22091
|
return await _classPrivateFieldGet(_emulationManager, this).emulateMediaType(type);
|
|
21513
22092
|
}
|
|
@@ -21538,13 +22117,13 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21538
22117
|
}
|
|
21539
22118
|
async evaluateOnNewDocument(pageFunction, ...args) {
|
|
21540
22119
|
const source = evaluationString(pageFunction, ...args);
|
|
21541
|
-
return await _classPrivateFieldGet(
|
|
22120
|
+
return await _classPrivateFieldGet(_frameManager3, this).evaluateOnNewDocument(source);
|
|
21542
22121
|
}
|
|
21543
22122
|
async removeScriptToEvaluateOnNewDocument(identifier) {
|
|
21544
|
-
return await _classPrivateFieldGet(
|
|
22123
|
+
return await _classPrivateFieldGet(_frameManager3, this).removeScriptToEvaluateOnNewDocument(identifier);
|
|
21545
22124
|
}
|
|
21546
22125
|
async setCacheEnabled(enabled = true) {
|
|
21547
|
-
await _classPrivateFieldGet(
|
|
22126
|
+
await _classPrivateFieldGet(_frameManager3, this).networkManager.setCacheEnabled(enabled);
|
|
21548
22127
|
}
|
|
21549
22128
|
async _screenshot(options) {
|
|
21550
22129
|
const env_2 = {
|
|
@@ -21740,6 +22319,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21740
22319
|
get bluetooth() {
|
|
21741
22320
|
return _classPrivateFieldGet(_cdpBluetoothEmulation, this);
|
|
21742
22321
|
}
|
|
22322
|
+
extensionRealms() {
|
|
22323
|
+
return this.mainFrame().extensionRealms();
|
|
22324
|
+
}
|
|
21743
22325
|
}
|
|
21744
22326
|
function _attachExistingTargets() {
|
|
21745
22327
|
const queue = [];
|
|
@@ -21770,8 +22352,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21770
22352
|
_classPrivateFieldGet(_touchscreen, this).updateClient(newSession);
|
|
21771
22353
|
_classPrivateFieldGet(_emulationManager, this).updateClient(newSession);
|
|
21772
22354
|
_classPrivateFieldGet(_tracing, this).updateClient(newSession);
|
|
22355
|
+
_classPrivateFieldGet(_webmcp2, this).updateClient(newSession);
|
|
21773
22356
|
_classPrivateFieldGet(_coverage, this).updateClient(newSession);
|
|
21774
|
-
await _classPrivateFieldGet(
|
|
22357
|
+
await _classPrivateFieldGet(_frameManager3, this).swapFrameTree(newSession);
|
|
21775
22358
|
_assertClassBrand(_CdpPage_brand, this, _setupPrimaryTargetListeners).call(this);
|
|
21776
22359
|
}
|
|
21777
22360
|
async function _onSecondaryTarget(session) {
|
|
@@ -21779,7 +22362,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21779
22362
|
if (session.target()._subtype() !== 'prerender') {
|
|
21780
22363
|
return;
|
|
21781
22364
|
}
|
|
21782
|
-
_classPrivateFieldGet(
|
|
22365
|
+
_classPrivateFieldGet(_frameManager3, this).registerSpeculativeSession(session).catch(debugError);
|
|
21783
22366
|
_classPrivateFieldGet(_emulationManager, this).registerSpeculativeSession(session).catch(debugError);
|
|
21784
22367
|
}
|
|
21785
22368
|
/**
|
|
@@ -21807,7 +22390,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21807
22390
|
}
|
|
21808
22391
|
async function _initialize() {
|
|
21809
22392
|
try {
|
|
21810
|
-
await Promise.all([_classPrivateFieldGet(
|
|
22393
|
+
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()]);
|
|
21811
22394
|
} catch (err) {
|
|
21812
22395
|
if (isErrorLike(err) && isTargetClosedError(err)) {
|
|
21813
22396
|
debugError(err);
|
|
@@ -21826,7 +22409,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21826
22409
|
if (!_classPrivateFieldGet(_fileChooserDeferreds, this).size) {
|
|
21827
22410
|
return;
|
|
21828
22411
|
}
|
|
21829
|
-
const frame = _classPrivateFieldGet(
|
|
22412
|
+
const frame = _classPrivateFieldGet(_frameManager3, this).frame(event.frameId);
|
|
21830
22413
|
assert(frame, 'This should never happen.');
|
|
21831
22414
|
// This is guaranteed to be an HTMLInputElement handle by the event.
|
|
21832
22415
|
const handle = __addDisposableResource$1(env_1, await frame.worlds[MAIN_WORLD].adoptBackendNode(event.backendNodeId), false);
|
|
@@ -21885,38 +22468,29 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
21885
22468
|
function _handleException(exception) {
|
|
21886
22469
|
this.emit("pageerror" /* PageEvent.PageError */, createClientError(exception.exceptionDetails));
|
|
21887
22470
|
}
|
|
21888
|
-
function _onConsoleAPI2(world, event) {
|
|
21889
|
-
|
|
21890
|
-
|
|
21891
|
-
|
|
21892
|
-
if (!this.listenerCount("console" /* PageEvent.Console */)) {
|
|
21893
|
-
values.forEach(arg => {
|
|
21894
|
-
return arg.dispose();
|
|
22471
|
+
function _onConsoleAPI2(world, event, values) {
|
|
22472
|
+
if (!values) {
|
|
22473
|
+
values = event.args.map(arg => {
|
|
22474
|
+
return world.createCdpHandle(arg);
|
|
21895
22475
|
});
|
|
21896
|
-
return;
|
|
21897
|
-
}
|
|
21898
|
-
const textTokens = [];
|
|
21899
|
-
// eslint-disable-next-line max-len -- The comment is long.
|
|
21900
|
-
// eslint-disable-next-line @puppeteer/use-using -- These are not owned by this function.
|
|
21901
|
-
for (const arg of values) {
|
|
21902
|
-
textTokens.push(valueFromJSHandle(arg));
|
|
21903
22476
|
}
|
|
21904
|
-
const
|
|
21905
|
-
|
|
21906
|
-
|
|
21907
|
-
|
|
21908
|
-
|
|
21909
|
-
|
|
21910
|
-
|
|
21911
|
-
|
|
22477
|
+
const hasPageConsoleListeners = this.listenerCount("console" /* PageEvent.Console */) > 0;
|
|
22478
|
+
const hasWorkerConsoleListeners = world.environment instanceof WebWorker && world.environment.listenerCount(exports.WebWorkerEvent.Console) > 0;
|
|
22479
|
+
if (!hasPageConsoleListeners) {
|
|
22480
|
+
if (!hasWorkerConsoleListeners) {
|
|
22481
|
+
// eslint-disable-next-line max-len -- The comment is long.
|
|
22482
|
+
// eslint-disable-next-line @puppeteer/use-using -- These are not owned by this function.
|
|
22483
|
+
for (const value of values) {
|
|
22484
|
+
void value.dispose().catch(debugError);
|
|
22485
|
+
}
|
|
21912
22486
|
}
|
|
22487
|
+
return;
|
|
21913
22488
|
}
|
|
21914
22489
|
let targetId;
|
|
21915
22490
|
if (world.environment.client instanceof CdpCDPSession) {
|
|
21916
22491
|
targetId = world.environment.client.target()._targetId;
|
|
21917
22492
|
}
|
|
21918
|
-
|
|
21919
|
-
this.emit("console" /* PageEvent.Console */, message);
|
|
22493
|
+
this.emit("console" /* PageEvent.Console */, createConsoleMessage(event, values, targetId));
|
|
21920
22494
|
}
|
|
21921
22495
|
async function _onBindingCalled2(world, event) {
|
|
21922
22496
|
let payload;
|
|
@@ -22067,19 +22641,19 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22067
22641
|
*/
|
|
22068
22642
|
var _connection3 = /*#__PURE__*/new WeakMap();
|
|
22069
22643
|
var _browser = /*#__PURE__*/new WeakMap();
|
|
22070
|
-
var
|
|
22644
|
+
var _id8 = /*#__PURE__*/new WeakMap();
|
|
22071
22645
|
class CdpBrowserContext extends BrowserContext {
|
|
22072
22646
|
constructor(connection, browser, contextId) {
|
|
22073
22647
|
super();
|
|
22074
22648
|
_classPrivateFieldInitSpec(this, _connection3, void 0);
|
|
22075
22649
|
_classPrivateFieldInitSpec(this, _browser, void 0);
|
|
22076
|
-
_classPrivateFieldInitSpec(this,
|
|
22650
|
+
_classPrivateFieldInitSpec(this, _id8, void 0);
|
|
22077
22651
|
_classPrivateFieldSet(_connection3, this, connection);
|
|
22078
22652
|
_classPrivateFieldSet(_browser, this, browser);
|
|
22079
|
-
_classPrivateFieldSet(
|
|
22653
|
+
_classPrivateFieldSet(_id8, this, contextId);
|
|
22080
22654
|
}
|
|
22081
22655
|
get id() {
|
|
22082
|
-
return _classPrivateFieldGet(
|
|
22656
|
+
return _classPrivateFieldGet(_id8, this);
|
|
22083
22657
|
}
|
|
22084
22658
|
targets() {
|
|
22085
22659
|
return _classPrivateFieldGet(_browser, this).targets().filter(target => {
|
|
@@ -22106,7 +22680,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22106
22680
|
});
|
|
22107
22681
|
await _classPrivateFieldGet(_connection3, this).send('Browser.grantPermissions', {
|
|
22108
22682
|
origin,
|
|
22109
|
-
browserContextId: _classPrivateFieldGet(
|
|
22683
|
+
browserContextId: _classPrivateFieldGet(_id8, this) || undefined,
|
|
22110
22684
|
permissions: protocolPermissions
|
|
22111
22685
|
});
|
|
22112
22686
|
}
|
|
@@ -22121,7 +22695,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22121
22695
|
};
|
|
22122
22696
|
await _classPrivateFieldGet(_connection3, this).send('Browser.setPermission', {
|
|
22123
22697
|
origin: origin === '*' ? undefined : origin,
|
|
22124
|
-
browserContextId: _classPrivateFieldGet(
|
|
22698
|
+
browserContextId: _classPrivateFieldGet(_id8, this) || undefined,
|
|
22125
22699
|
permission: protocolPermission,
|
|
22126
22700
|
setting: permission.state
|
|
22127
22701
|
});
|
|
@@ -22129,7 +22703,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22129
22703
|
}
|
|
22130
22704
|
async clearPermissionOverrides() {
|
|
22131
22705
|
await _classPrivateFieldGet(_connection3, this).send('Browser.resetPermissions', {
|
|
22132
|
-
browserContextId: _classPrivateFieldGet(
|
|
22706
|
+
browserContextId: _classPrivateFieldGet(_id8, this) || undefined
|
|
22133
22707
|
});
|
|
22134
22708
|
}
|
|
22135
22709
|
async newPage(options) {
|
|
@@ -22140,7 +22714,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22140
22714
|
};
|
|
22141
22715
|
try {
|
|
22142
22716
|
const _guard = __addDisposableResource(env_1, await this.waitForScreenshotOperations(), false);
|
|
22143
|
-
return await _classPrivateFieldGet(_browser, this)._createPageInContext(_classPrivateFieldGet(
|
|
22717
|
+
return await _classPrivateFieldGet(_browser, this)._createPageInContext(_classPrivateFieldGet(_id8, this), options);
|
|
22144
22718
|
} catch (e_1) {
|
|
22145
22719
|
env_1.error = e_1;
|
|
22146
22720
|
env_1.hasError = true;
|
|
@@ -22152,14 +22726,14 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22152
22726
|
return _classPrivateFieldGet(_browser, this);
|
|
22153
22727
|
}
|
|
22154
22728
|
async close() {
|
|
22155
|
-
assert(_classPrivateFieldGet(
|
|
22156
|
-
await _classPrivateFieldGet(_browser, this)._disposeContext(_classPrivateFieldGet(
|
|
22729
|
+
assert(_classPrivateFieldGet(_id8, this), 'Default BrowserContext cannot be closed!');
|
|
22730
|
+
await _classPrivateFieldGet(_browser, this)._disposeContext(_classPrivateFieldGet(_id8, this));
|
|
22157
22731
|
}
|
|
22158
22732
|
async cookies() {
|
|
22159
22733
|
const {
|
|
22160
22734
|
cookies
|
|
22161
22735
|
} = await _classPrivateFieldGet(_connection3, this).send('Storage.getCookies', {
|
|
22162
|
-
browserContextId: _classPrivateFieldGet(
|
|
22736
|
+
browserContextId: _classPrivateFieldGet(_id8, this)
|
|
22163
22737
|
});
|
|
22164
22738
|
return cookies.map(cookie => {
|
|
22165
22739
|
return {
|
|
@@ -22175,7 +22749,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22175
22749
|
}
|
|
22176
22750
|
async setCookie(...cookies) {
|
|
22177
22751
|
return await _classPrivateFieldGet(_connection3, this).send('Storage.setCookies', {
|
|
22178
|
-
browserContextId: _classPrivateFieldGet(
|
|
22752
|
+
browserContextId: _classPrivateFieldGet(_id8, this),
|
|
22179
22753
|
cookies: cookies.map(cookie => {
|
|
22180
22754
|
return {
|
|
22181
22755
|
...cookie,
|
|
@@ -22189,7 +22763,71 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22189
22763
|
await _classPrivateFieldGet(_connection3, this).send('Browser.setDownloadBehavior', {
|
|
22190
22764
|
behavior: downloadBehavior.policy,
|
|
22191
22765
|
downloadPath: downloadBehavior.downloadPath,
|
|
22192
|
-
browserContextId: _classPrivateFieldGet(
|
|
22766
|
+
browserContextId: _classPrivateFieldGet(_id8, this)
|
|
22767
|
+
});
|
|
22768
|
+
}
|
|
22769
|
+
}
|
|
22770
|
+
var _browser2 = /*#__PURE__*/new WeakMap();
|
|
22771
|
+
var _CdpExtension_brand = /*#__PURE__*/new WeakSet();
|
|
22772
|
+
class CdpExtension extends Extension {
|
|
22773
|
+
/*
|
|
22774
|
+
* @internal
|
|
22775
|
+
*/
|
|
22776
|
+
constructor(id, version, name, browser) {
|
|
22777
|
+
super(id, version, name);
|
|
22778
|
+
_classPrivateMethodInitSpec(this, _CdpExtension_brand);
|
|
22779
|
+
// needed to access the CDPSession to trigger an extension action.
|
|
22780
|
+
_classPrivateFieldInitSpec(this, _browser2, void 0);
|
|
22781
|
+
_classPrivateFieldSet(_browser2, this, browser);
|
|
22782
|
+
}
|
|
22783
|
+
async workers() {
|
|
22784
|
+
const targets = _classPrivateFieldGet(_browser2, this).targets();
|
|
22785
|
+
const extensionWorkers = targets.filter(target => {
|
|
22786
|
+
const targetUrl = target.url();
|
|
22787
|
+
return target.type() === 'service_worker' && targetUrl.startsWith('chrome-extension://' + this.id);
|
|
22788
|
+
});
|
|
22789
|
+
const workers = [];
|
|
22790
|
+
for (const target of extensionWorkers) {
|
|
22791
|
+
try {
|
|
22792
|
+
const worker = await target.worker();
|
|
22793
|
+
if (worker) {
|
|
22794
|
+
workers.push(worker);
|
|
22795
|
+
}
|
|
22796
|
+
} catch (err) {
|
|
22797
|
+
if (_assertClassBrand(_CdpExtension_brand, this, _canIgnoreError2).call(this, err)) {
|
|
22798
|
+
debugError(err);
|
|
22799
|
+
continue;
|
|
22800
|
+
}
|
|
22801
|
+
throw err;
|
|
22802
|
+
}
|
|
22803
|
+
}
|
|
22804
|
+
return workers;
|
|
22805
|
+
}
|
|
22806
|
+
async pages() {
|
|
22807
|
+
const targets = _classPrivateFieldGet(_browser2, this).targets();
|
|
22808
|
+
const extensionPages = targets.filter(target => {
|
|
22809
|
+
const targetUrl = target.url();
|
|
22810
|
+
return (target.type() === 'page' || target.type() === 'background_page') && targetUrl.startsWith('chrome-extension://' + this.id);
|
|
22811
|
+
});
|
|
22812
|
+
const pages = await Promise.all(extensionPages.map(async target => {
|
|
22813
|
+
try {
|
|
22814
|
+
return await target.asPage();
|
|
22815
|
+
} catch (err) {
|
|
22816
|
+
if (_assertClassBrand(_CdpExtension_brand, this, _canIgnoreError2).call(this, err)) {
|
|
22817
|
+
debugError(err);
|
|
22818
|
+
return null;
|
|
22819
|
+
}
|
|
22820
|
+
throw err;
|
|
22821
|
+
}
|
|
22822
|
+
}));
|
|
22823
|
+
return pages.filter(page => {
|
|
22824
|
+
return page !== null;
|
|
22825
|
+
});
|
|
22826
|
+
}
|
|
22827
|
+
async triggerAction(page) {
|
|
22828
|
+
await _classPrivateFieldGet(_browser2, this)._connection.send('Extensions.triggerAction', {
|
|
22829
|
+
id: this.id,
|
|
22830
|
+
targetId: page._tabId
|
|
22193
22831
|
});
|
|
22194
22832
|
}
|
|
22195
22833
|
}
|
|
@@ -22202,6 +22840,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22202
22840
|
/**
|
|
22203
22841
|
* @internal
|
|
22204
22842
|
*/
|
|
22843
|
+
function _canIgnoreError2(error) {
|
|
22844
|
+
return isErrorLike(error) && (isTargetClosedError(error) || error.message.includes('No target with given id found'));
|
|
22845
|
+
}
|
|
22205
22846
|
exports.InitializationStatus = void 0;
|
|
22206
22847
|
(function (InitializationStatus) {
|
|
22207
22848
|
InitializationStatus["SUCCESS"] = "success";
|
|
@@ -22233,6 +22874,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22233
22874
|
_defineProperty(this, "_initializedDeferred", Deferred.create());
|
|
22234
22875
|
_defineProperty(this, "_isClosedDeferred", Deferred.create());
|
|
22235
22876
|
_defineProperty(this, "_targetId", void 0);
|
|
22877
|
+
_defineProperty(this, "_asPagePromise", void 0);
|
|
22878
|
+
/** @internal */
|
|
22879
|
+
_defineProperty(this, "pagePromise", void 0);
|
|
22236
22880
|
_classPrivateFieldSet(_session, this, session);
|
|
22237
22881
|
_classPrivateFieldSet(_targetManager2, this, targetManager);
|
|
22238
22882
|
_classPrivateFieldSet(_targetInfo, this, targetInfo);
|
|
@@ -22244,13 +22888,19 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22244
22888
|
}
|
|
22245
22889
|
}
|
|
22246
22890
|
async asPage() {
|
|
22247
|
-
|
|
22248
|
-
|
|
22249
|
-
|
|
22891
|
+
if (this.pagePromise) {
|
|
22892
|
+
const page = await this.pagePromise;
|
|
22893
|
+
if (page) {
|
|
22894
|
+
return page;
|
|
22895
|
+
}
|
|
22896
|
+
}
|
|
22897
|
+
if (!this._asPagePromise) {
|
|
22898
|
+
const session = this._session();
|
|
22899
|
+
this._asPagePromise = (session ? Promise.resolve(session) : this._sessionFactory()(/* isAutoAttachEmulated=*/false)).then(client => {
|
|
22250
22900
|
return CdpPage._create(client, this, null);
|
|
22251
22901
|
});
|
|
22252
22902
|
}
|
|
22253
|
-
return await
|
|
22903
|
+
return (await this._asPagePromise) ?? null;
|
|
22254
22904
|
}
|
|
22255
22905
|
_subtype() {
|
|
22256
22906
|
return _classPrivateFieldGet(_targetInfo, this).subtype;
|
|
@@ -22362,7 +23012,6 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22362
23012
|
constructor(targetInfo, session, browserContext, targetManager, sessionFactory, defaultViewport) {
|
|
22363
23013
|
super(targetInfo, session, browserContext, targetManager, sessionFactory);
|
|
22364
23014
|
_classPrivateFieldInitSpec(this, _defaultViewport, void 0);
|
|
22365
|
-
_defineProperty(this, "pagePromise", void 0);
|
|
22366
23015
|
_classPrivateFieldSet(_defaultViewport, this, defaultViewport ?? undefined);
|
|
22367
23016
|
}
|
|
22368
23017
|
_initialize() {
|
|
@@ -22421,9 +23070,8 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22421
23070
|
async worker() {
|
|
22422
23071
|
if (!_classPrivateFieldGet(_workerPromise, this)) {
|
|
22423
23072
|
const session = this._session();
|
|
22424
|
-
// TODO(einbinder): Make workers send their console logs.
|
|
22425
23073
|
_classPrivateFieldSet(_workerPromise, this, (session ? Promise.resolve(session) : this._sessionFactory()(/* isAutoAttachEmulated=*/false)).then(client => {
|
|
22426
|
-
return new CdpWebWorker(client, this._getTargetInfo().url, this._targetId, this.type(), () => {} /*
|
|
23074
|
+
return new CdpWebWorker(client, this._getTargetInfo().url, this._targetId, this.type(), () => {} /* exceptionThrown */, undefined /* networkManager */);
|
|
22427
23075
|
}));
|
|
22428
23076
|
}
|
|
22429
23077
|
return await _classPrivateFieldGet(_workerPromise, this);
|
|
@@ -22611,7 +23259,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22611
23259
|
// CDP.
|
|
22612
23260
|
if (targetInfo.type === 'service_worker') {
|
|
22613
23261
|
await _classPrivateFieldGet(_silentDetach, this).call(this, session, parentSession);
|
|
22614
|
-
if (_classPrivateFieldGet(_attachedTargetsByTargetId, this).has(targetInfo.targetId)) {
|
|
23262
|
+
if (_classPrivateFieldGet(_attachedTargetsByTargetId, this).has(targetInfo.targetId) || _classPrivateFieldGet(_ignoredTargets, this).has(targetInfo.targetId) || !_classPrivateFieldGet(_discoveredTargetsByTargetId, this).has(targetInfo.targetId)) {
|
|
22615
23263
|
return;
|
|
22616
23264
|
}
|
|
22617
23265
|
const target = _classPrivateFieldGet(_targetFactory, this).call(this, targetInfo);
|
|
@@ -22703,6 +23351,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22703
23351
|
_assertClassBrand(_TargetManager_brand, this, _finishInitializationIfReady).call(this);
|
|
22704
23352
|
await _classPrivateFieldGet(_initializeDeferred, this).valueOrThrow();
|
|
22705
23353
|
}
|
|
23354
|
+
addToIgnoreTarget(targetId) {
|
|
23355
|
+
_classPrivateFieldGet(_ignoredTargets, this).add(targetId);
|
|
23356
|
+
}
|
|
22706
23357
|
getChildTargets(target) {
|
|
22707
23358
|
return target._childTargets();
|
|
22708
23359
|
}
|
|
@@ -22716,6 +23367,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22716
23367
|
getAvailableTargets() {
|
|
22717
23368
|
return _classPrivateFieldGet(_attachedTargetsByTargetId, this);
|
|
22718
23369
|
}
|
|
23370
|
+
getDiscoveredTargetInfos() {
|
|
23371
|
+
return _classPrivateFieldGet(_discoveredTargetsByTargetId, this);
|
|
23372
|
+
}
|
|
22719
23373
|
}
|
|
22720
23374
|
|
|
22721
23375
|
/**
|
|
@@ -22780,8 +23434,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22780
23434
|
var _defaultContext = /*#__PURE__*/new WeakMap();
|
|
22781
23435
|
var _contexts = /*#__PURE__*/new WeakMap();
|
|
22782
23436
|
var _networkEnabled2 = /*#__PURE__*/new WeakMap();
|
|
23437
|
+
var _issuesEnabled = /*#__PURE__*/new WeakMap();
|
|
22783
23438
|
var _targetManager3 = /*#__PURE__*/new WeakMap();
|
|
22784
23439
|
var _handleDevToolsAsPage = /*#__PURE__*/new WeakMap();
|
|
23440
|
+
var _extensions = /*#__PURE__*/new WeakMap();
|
|
22785
23441
|
var _emitDisconnected = /*#__PURE__*/new WeakMap();
|
|
22786
23442
|
var _CdpBrowser_brand = /*#__PURE__*/new WeakSet();
|
|
22787
23443
|
var _createTarget = /*#__PURE__*/new WeakMap();
|
|
@@ -22790,8 +23446,8 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22790
23446
|
var _onTargetChanged = /*#__PURE__*/new WeakMap();
|
|
22791
23447
|
var _onTargetDiscovered = /*#__PURE__*/new WeakMap();
|
|
22792
23448
|
class CdpBrowser extends Browser {
|
|
22793
|
-
static async _create(connection, contextIds, acceptInsecureCerts, defaultViewport, downloadBehavior, process, closeCallback, targetFilterCallback, isPageTargetCallback, waitForInitiallyDiscoveredTargets = true, networkEnabled = true, handleDevToolsAsPage = false) {
|
|
22794
|
-
const browser = new CdpBrowser(connection, contextIds, defaultViewport, process, closeCallback, targetFilterCallback, isPageTargetCallback, waitForInitiallyDiscoveredTargets, networkEnabled, handleDevToolsAsPage);
|
|
23449
|
+
static async _create(connection, contextIds, acceptInsecureCerts, defaultViewport, downloadBehavior, process, closeCallback, targetFilterCallback, isPageTargetCallback, waitForInitiallyDiscoveredTargets = true, networkEnabled = true, issuesEnabled = true, handleDevToolsAsPage = false) {
|
|
23450
|
+
const browser = new CdpBrowser(connection, contextIds, defaultViewport, process, closeCallback, targetFilterCallback, isPageTargetCallback, waitForInitiallyDiscoveredTargets, networkEnabled, issuesEnabled, handleDevToolsAsPage);
|
|
22795
23451
|
if (acceptInsecureCerts) {
|
|
22796
23452
|
await connection.send('Security.setIgnoreCertificateErrors', {
|
|
22797
23453
|
ignore: true
|
|
@@ -22800,7 +23456,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22800
23456
|
await browser._attach(downloadBehavior);
|
|
22801
23457
|
return browser;
|
|
22802
23458
|
}
|
|
22803
|
-
constructor(connection, contextIds, defaultViewport, process, closeCallback, targetFilterCallback, _isPageTargetCallback2, waitForInitiallyDiscoveredTargets = true, networkEnabled = true, handleDevToolsAsPage = false) {
|
|
23459
|
+
constructor(connection, contextIds, defaultViewport, process, closeCallback, targetFilterCallback, _isPageTargetCallback2, waitForInitiallyDiscoveredTargets = true, networkEnabled = true, issuesEnabled = true, handleDevToolsAsPage = false) {
|
|
22804
23460
|
super();
|
|
22805
23461
|
_classPrivateMethodInitSpec(this, _CdpBrowser_brand);
|
|
22806
23462
|
_defineProperty(this, "protocol", 'cdp');
|
|
@@ -22813,8 +23469,10 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22813
23469
|
_classPrivateFieldInitSpec(this, _defaultContext, void 0);
|
|
22814
23470
|
_classPrivateFieldInitSpec(this, _contexts, new Map());
|
|
22815
23471
|
_classPrivateFieldInitSpec(this, _networkEnabled2, true);
|
|
23472
|
+
_classPrivateFieldInitSpec(this, _issuesEnabled, true);
|
|
22816
23473
|
_classPrivateFieldInitSpec(this, _targetManager3, void 0);
|
|
22817
23474
|
_classPrivateFieldInitSpec(this, _handleDevToolsAsPage, false);
|
|
23475
|
+
_classPrivateFieldInitSpec(this, _extensions, new Map());
|
|
22818
23476
|
_classPrivateFieldInitSpec(this, _emitDisconnected, () => {
|
|
22819
23477
|
this.emit("disconnected" /* BrowserEvent.Disconnected */, undefined);
|
|
22820
23478
|
});
|
|
@@ -22865,6 +23523,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
22865
23523
|
this.emit("targetdiscovered" /* BrowserEvent.TargetDiscovered */, targetInfo);
|
|
22866
23524
|
});
|
|
22867
23525
|
_classPrivateFieldSet(_networkEnabled2, this, networkEnabled);
|
|
23526
|
+
_classPrivateFieldSet(_issuesEnabled, this, issuesEnabled);
|
|
22868
23527
|
_classPrivateFieldSet(_defaultViewport2, this, defaultViewport);
|
|
22869
23528
|
_classPrivateFieldSet(_process, this, process);
|
|
22870
23529
|
_classPrivateFieldSet(_connection5, this, connection);
|
|
@@ -23014,12 +23673,33 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
23014
23673
|
} = await _classPrivateFieldGet(_connection5, this).send('Extensions.loadUnpacked', {
|
|
23015
23674
|
path
|
|
23016
23675
|
});
|
|
23676
|
+
_classPrivateFieldGet(_extensions, this).delete(id);
|
|
23017
23677
|
return id;
|
|
23018
23678
|
}
|
|
23019
|
-
uninstallExtension(id) {
|
|
23020
|
-
|
|
23679
|
+
async uninstallExtension(id) {
|
|
23680
|
+
await _classPrivateFieldGet(_connection5, this).send('Extensions.uninstall', {
|
|
23021
23681
|
id
|
|
23022
23682
|
});
|
|
23683
|
+
// Currently sending the Extensions.uninstall command does not trigger
|
|
23684
|
+
// the Target.targetDestroyed event for service workers. This causes
|
|
23685
|
+
// flakiness in the extension tests.
|
|
23686
|
+
// TODO(nroscino): Remove this once the event is correctly emitted.
|
|
23687
|
+
const targetDestroyedPromises = [];
|
|
23688
|
+
for (const [targetId, targetInfo] of this._targetManager().getDiscoveredTargetInfos().entries()) {
|
|
23689
|
+
if (targetInfo.url.includes(id) && targetInfo.type === 'service_worker') {
|
|
23690
|
+
this._targetManager().addToIgnoreTarget(targetId);
|
|
23691
|
+
targetDestroyedPromises.push(new Promise(resolve => {
|
|
23692
|
+
return setTimeout(() => {
|
|
23693
|
+
_classPrivateFieldGet(_connection5, this).emit('Target.targetDestroyed', {
|
|
23694
|
+
targetId: targetId
|
|
23695
|
+
});
|
|
23696
|
+
resolve(null);
|
|
23697
|
+
}, 0);
|
|
23698
|
+
}));
|
|
23699
|
+
}
|
|
23700
|
+
}
|
|
23701
|
+
await Promise.all(targetDestroyedPromises);
|
|
23702
|
+
_classPrivateFieldGet(_extensions, this).delete(id);
|
|
23023
23703
|
}
|
|
23024
23704
|
async screens() {
|
|
23025
23705
|
const {
|
|
@@ -23084,6 +23764,12 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
23084
23764
|
this._detach();
|
|
23085
23765
|
return Promise.resolve();
|
|
23086
23766
|
}
|
|
23767
|
+
/**
|
|
23768
|
+
* @internal
|
|
23769
|
+
*/
|
|
23770
|
+
get _connection() {
|
|
23771
|
+
return _classPrivateFieldGet(_connection5, this);
|
|
23772
|
+
}
|
|
23087
23773
|
get connected() {
|
|
23088
23774
|
return !_classPrivateFieldGet(_connection5, this)._closed;
|
|
23089
23775
|
}
|
|
@@ -23095,6 +23781,23 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
23095
23781
|
isNetworkEnabled() {
|
|
23096
23782
|
return _classPrivateFieldGet(_networkEnabled2, this);
|
|
23097
23783
|
}
|
|
23784
|
+
async extensions() {
|
|
23785
|
+
const response = await _classPrivateFieldGet(_connection5, this).send('Extensions.getExtensions');
|
|
23786
|
+
const extensionsMap = new Map();
|
|
23787
|
+
for (const currExtension of response.extensions) {
|
|
23788
|
+
if (_classPrivateFieldGet(_extensions, this).has(currExtension.id)) {
|
|
23789
|
+
extensionsMap.set(currExtension.id, _classPrivateFieldGet(_extensions, this).get(currExtension.id));
|
|
23790
|
+
} else {
|
|
23791
|
+
const newExtension = new CdpExtension(currExtension.id, currExtension.version, currExtension.name, this);
|
|
23792
|
+
extensionsMap.set(currExtension.id, newExtension);
|
|
23793
|
+
}
|
|
23794
|
+
}
|
|
23795
|
+
_classPrivateFieldSet(_extensions, this, extensionsMap);
|
|
23796
|
+
return _classPrivateFieldGet(_extensions, this);
|
|
23797
|
+
}
|
|
23798
|
+
isIssuesEnabled() {
|
|
23799
|
+
return _classPrivateFieldGet(_issuesEnabled, this);
|
|
23800
|
+
}
|
|
23098
23801
|
}
|
|
23099
23802
|
|
|
23100
23803
|
/**
|
|
@@ -23120,6 +23823,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
23120
23823
|
const {
|
|
23121
23824
|
acceptInsecureCerts = false,
|
|
23122
23825
|
networkEnabled = true,
|
|
23826
|
+
issuesEnabled = true,
|
|
23123
23827
|
defaultViewport = DEFAULT_VIEWPORT,
|
|
23124
23828
|
downloadBehavior,
|
|
23125
23829
|
targetFilter,
|
|
@@ -23135,7 +23839,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
23135
23839
|
} = await connection.send('Target.getBrowserContexts');
|
|
23136
23840
|
const browser = await CdpBrowser._create(connection, browserContextIds, acceptInsecureCerts, defaultViewport, downloadBehavior, undefined, () => {
|
|
23137
23841
|
return connection.send('Browser.close').catch(debugError);
|
|
23138
|
-
}, targetFilter, isPageTarget, undefined, networkEnabled, handleDevToolsAsPage);
|
|
23842
|
+
}, targetFilter, isPageTarget, undefined, networkEnabled, issuesEnabled, handleDevToolsAsPage);
|
|
23139
23843
|
return browser;
|
|
23140
23844
|
}
|
|
23141
23845
|
const tabTargetInfo = {
|
|
@@ -24926,6 +25630,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
24926
25630
|
const {
|
|
24927
25631
|
acceptInsecureCerts = false,
|
|
24928
25632
|
networkEnabled = true,
|
|
25633
|
+
issuesEnabled = true,
|
|
24929
25634
|
defaultViewport = DEFAULT_VIEWPORT
|
|
24930
25635
|
} = options;
|
|
24931
25636
|
const {
|
|
@@ -24942,6 +25647,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
24942
25647
|
defaultViewport: defaultViewport,
|
|
24943
25648
|
acceptInsecureCerts: acceptInsecureCerts,
|
|
24944
25649
|
networkEnabled,
|
|
25650
|
+
issuesEnabled,
|
|
24945
25651
|
capabilities: options.capabilities
|
|
24946
25652
|
});
|
|
24947
25653
|
return bidiBrowser;
|
|
@@ -25257,9 +25963,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
25257
25963
|
* @internal
|
|
25258
25964
|
*/
|
|
25259
25965
|
const PUPPETEER_REVISIONS = Object.freeze({
|
|
25260
|
-
chrome: '
|
|
25261
|
-
'chrome-headless-shell': '
|
|
25262
|
-
firefox: '
|
|
25966
|
+
chrome: '147.0.7727.56',
|
|
25967
|
+
'chrome-headless-shell': '147.0.7727.56',
|
|
25968
|
+
firefox: 'stable_149.0.2'
|
|
25263
25969
|
});
|
|
25264
25970
|
|
|
25265
25971
|
/**
|
|
@@ -25332,6 +26038,7 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
25332
26038
|
exports.EmulationManager = EmulationManager;
|
|
25333
26039
|
exports.EventEmitter = EventEmitter;
|
|
25334
26040
|
exports.ExecutionContext = ExecutionContext;
|
|
26041
|
+
exports.Extension = Extension;
|
|
25335
26042
|
exports.ExtensionTransport = ExtensionTransport;
|
|
25336
26043
|
exports.FileChooser = FileChooser;
|
|
25337
26044
|
exports.FilteredLocator = FilteredLocator;
|
|
@@ -25394,6 +26101,9 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
25394
26101
|
exports.UnsupportedOperation = UnsupportedOperation;
|
|
25395
26102
|
exports.WEB_PERMISSION_TO_PROTOCOL_PERMISSION = WEB_PERMISSION_TO_PROTOCOL_PERMISSION;
|
|
25396
26103
|
exports.WaitTask = WaitTask;
|
|
26104
|
+
exports.WebMCP = WebMCP;
|
|
26105
|
+
exports.WebMCPTool = WebMCPTool;
|
|
26106
|
+
exports.WebMCPToolCall = WebMCPToolCall;
|
|
25397
26107
|
exports.WebWorker = WebWorker;
|
|
25398
26108
|
exports.WorkerTarget = WorkerTarget;
|
|
25399
26109
|
exports.XPathQueryHandler = XPathQueryHandler;
|
|
@@ -25404,9 +26114,11 @@ var Puppeteer = function (exports, _PuppeteerURL, _LazyArg, _ARIAQueryHandler, _
|
|
|
25404
26114
|
exports.asyncDisposeSymbol = asyncDisposeSymbol;
|
|
25405
26115
|
exports.bindIsolatedHandle = bindIsolatedHandle;
|
|
25406
26116
|
exports.connect = connect;
|
|
26117
|
+
exports.convertConsoleMessageLevel = convertConsoleMessageLevel;
|
|
25407
26118
|
exports.convertCookiesPartitionKeyFromPuppeteerToCdp = convertCookiesPartitionKeyFromPuppeteerToCdp;
|
|
25408
26119
|
exports.convertSameSiteFromPuppeteerToCdp = convertSameSiteFromPuppeteerToCdp;
|
|
25409
26120
|
exports.createClientError = createClientError;
|
|
26121
|
+
exports.createConsoleMessage = createConsoleMessage;
|
|
25410
26122
|
exports.createEvaluationError = createEvaluationError;
|
|
25411
26123
|
exports.createIncrementalIdGenerator = createIncrementalIdGenerator;
|
|
25412
26124
|
exports.createProtocolErrorMessage = createProtocolErrorMessage;
|