chrome-devtools-frontend 1.0.1037221 → 1.0.1039140
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/config/gni/devtools_grd_files.gni +9 -2
- package/front_end/core/common/ParsedURL.ts +1 -1
- package/front_end/core/i18n/locales/en-US.json +2 -2
- package/front_end/core/i18n/locales/en-XL.json +2 -2
- package/front_end/core/sdk/ResourceTreeModel.ts +12 -8
- package/front_end/panels/sources/NavigatorView.ts +9 -0
- package/front_end/services/puppeteer/PuppeteerConnection.ts +1 -1
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +244 -244
- package/front_end/third_party/lighthouse/locales/en-US.json +2 -2
- package/front_end/third_party/lighthouse/locales/en-XL.json +2 -2
- package/front_end/third_party/puppeteer/package/README.md +20 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Accessibility.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Accessibility.js +4 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js +10 -8
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.d.ts +19 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.js +23 -10
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ChromeTargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ChromeTargetManager.js +35 -20
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ChromeTargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.d.ts +9 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.js +19 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.d.ts +5 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.js +6 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Debug.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Debug.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Debug.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Debug.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Dialog.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Dialog.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Dialog.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Dialog.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ElementHandle.d.ts +168 -131
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ElementHandle.js +208 -206
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Errors.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EventEmitter.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.d.ts +74 -75
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.js +82 -97
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FileChooser.d.ts +16 -8
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FileChooser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FileChooser.js +17 -9
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FileChooser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FirefoxTargetManager.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FirefoxTargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FirefoxTargetManager.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FirefoxTargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Frame.d.ts +634 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Frame.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Frame.js +713 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Frame.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts +9 -679
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js +77 -803
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.d.ts +11 -10
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.js +11 -10
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.d.ts +34 -13
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.js +35 -14
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/{DOMWorld.d.ts → IsolatedWorld.d.ts} +58 -13
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/IsolatedWorld.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/{DOMWorld.js → IsolatedWorld.js} +124 -151
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/IsolatedWorld.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts +40 -58
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js +53 -76
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.js +23 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.js +17 -17
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js +8 -8
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/PDFOptions.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/PDFOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/PDFOptions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.d.ts +395 -296
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.js +398 -313
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.d.ts +14 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.js +14 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/QueryHandler.d.ts +38 -17
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/QueryHandler.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/QueryHandler.js +49 -31
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/QueryHandler.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.js +7 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Tracing.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Tracing.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Tracing.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Tracing.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.d.ts +8 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.js +8 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.d.ts +1 -34
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.js +5 -53
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts +3 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js +6 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/injected.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/initializePuppeteer.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/initializePuppeteer.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/initializePuppeteer.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/Poller.d.ts +28 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/Poller.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/Poller.js +148 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/Poller.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.js +18 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserFetcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.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 +2 -2
- 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/node/FirefoxLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/FirefoxLauncher.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/FirefoxLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/types.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/types.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/types.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/types.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/DeferredPromise.d.ts +25 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/DeferredPromise.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/DeferredPromise.js +78 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/DeferredPromise.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/ErrorLike.d.ts +17 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/ErrorLike.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/ErrorLike.js +22 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/ErrorLike.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/{common → util}/assert.d.ts +0 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/assert.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/{common → util}/assert.js +0 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/assert.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/getPackageDirectory.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/getPackageDirectory.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/getPackageDirectory.js +19 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/getPackageDirectory.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.js +4 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js +10 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts +19 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js +23 -10
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ChromeTargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ChromeTargetManager.js +36 -21
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ChromeTargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts +9 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.js +19 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts +5 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.js +6 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ElementHandle.d.ts +168 -131
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ElementHandle.js +208 -206
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts +74 -75
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.js +83 -98
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.d.ts +16 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.js +17 -9
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FirefoxTargetManager.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FirefoxTargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FirefoxTargetManager.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FirefoxTargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Frame.d.ts +634 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Frame.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Frame.js +709 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Frame.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts +9 -679
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js +72 -797
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts +11 -10
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js +11 -10
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts +34 -13
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.js +35 -14
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/{DOMWorld.d.ts → IsolatedWorld.d.ts} +58 -13
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/IsolatedWorld.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/{DOMWorld.js → IsolatedWorld.js} +123 -150
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/IsolatedWorld.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts +40 -58
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +54 -77
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js +24 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.js +17 -17
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js +8 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts +395 -296
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js +398 -313
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts +14 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.js +14 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts +38 -17
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.js +49 -31
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.js +7 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts +8 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.js +8 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.d.ts +1 -34
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.js +3 -48
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts +3 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/injected.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/generated/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initializePuppeteer.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initializePuppeteer.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initializePuppeteer.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/Poller.d.ts +28 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/Poller.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/Poller.js +142 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/Poller.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/injected.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/injected.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/injected.js +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/injected/injected.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.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 +2 -2
- 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/node/FirefoxLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/FirefoxLauncher.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/FirefoxLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/types.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/types.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/types.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/types.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/DeferredPromise.d.ts +25 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/DeferredPromise.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/DeferredPromise.js +73 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/DeferredPromise.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/ErrorLike.d.ts +17 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/ErrorLike.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/ErrorLike.js +17 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/ErrorLike.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/{common → util}/assert.d.ts +0 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/assert.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/{common → util}/assert.js +0 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/assert.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/getPackageDirectory.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/getPackageDirectory.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/getPackageDirectory.js +15 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/getPackageDirectory.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +1069 -878
- package/front_end/third_party/puppeteer/package/package.json +32 -28
- package/front_end/third_party/puppeteer/package/typescript-if-required.js +1 -1
- package/front_end/third_party/puppeteer/puppeteer.ts +1 -1
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryHighlightChipList.ts +16 -6
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +28 -4
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +15 -0
- package/front_end/ui/components/linear_memory_inspector/linearMemoryHighlightChipList.css +27 -12
- package/front_end/ui/components/linear_memory_inspector/linearMemoryViewer.css +19 -4
- package/package.json +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/assert.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/assert.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.d.ts.map +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.js.map +0 -1
@@ -23,11 +23,11 @@ import { CDPSession } from './Connection.js';
|
|
23
23
|
import { ConsoleMessage } from './ConsoleMessage.js';
|
24
24
|
import { Coverage } from './Coverage.js';
|
25
25
|
import { Dialog } from './Dialog.js';
|
26
|
-
import { WaitForSelectorOptions } from './
|
26
|
+
import { WaitForSelectorOptions } from './IsolatedWorld.js';
|
27
27
|
import { ElementHandle } from './ElementHandle.js';
|
28
28
|
import { EventEmitter } from './EventEmitter.js';
|
29
29
|
import { FileChooser } from './FileChooser.js';
|
30
|
-
import { Frame } from './
|
30
|
+
import { Frame } from './Frame.js';
|
31
31
|
import { HTTPRequest } from './HTTPRequest.js';
|
32
32
|
import { HTTPResponse } from './HTTPResponse.js';
|
33
33
|
import { Keyboard, Mouse, MouseButton, Touchscreen } from './Input.js';
|
@@ -64,12 +64,12 @@ export interface Metrics {
|
|
64
64
|
*/
|
65
65
|
export interface WaitTimeoutOptions {
|
66
66
|
/**
|
67
|
-
* Maximum wait time in milliseconds
|
68
|
-
* disable the timeout.
|
67
|
+
* Maximum wait time in milliseconds. Pass 0 to disable the timeout.
|
69
68
|
*
|
70
|
-
* @remarks
|
71
69
|
* The default value can be changed by using the
|
72
70
|
* {@link Page.setDefaultTimeout} method.
|
71
|
+
*
|
72
|
+
* @defaultValue `30000`
|
73
73
|
*/
|
74
74
|
timeout?: number;
|
75
75
|
}
|
@@ -78,13 +78,13 @@ export interface WaitTimeoutOptions {
|
|
78
78
|
*/
|
79
79
|
export interface WaitForOptions {
|
80
80
|
/**
|
81
|
-
* Maximum wait time in milliseconds
|
82
|
-
* disable the timeout.
|
81
|
+
* Maximum wait time in milliseconds. Pass 0 to disable the timeout.
|
83
82
|
*
|
84
|
-
* @remarks
|
85
83
|
* The default value can be changed by using the
|
86
84
|
* {@link Page.setDefaultTimeout} or {@link Page.setDefaultNavigationTimeout}
|
87
85
|
* methods.
|
86
|
+
*
|
87
|
+
* @defaultValue `30000`
|
88
88
|
*/
|
89
89
|
timeout?: number;
|
90
90
|
waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
|
@@ -94,11 +94,11 @@ export interface WaitForOptions {
|
|
94
94
|
*/
|
95
95
|
export interface GeolocationOptions {
|
96
96
|
/**
|
97
|
-
* Latitude between
|
97
|
+
* Latitude between `-90` and `90`.
|
98
98
|
*/
|
99
99
|
longitude: number;
|
100
100
|
/**
|
101
|
-
* Longitude between
|
101
|
+
* Longitude between `-180` and `180`.
|
102
102
|
*/
|
103
103
|
latitude: number;
|
104
104
|
/**
|
@@ -127,7 +127,7 @@ export interface ScreenshotClip {
|
|
127
127
|
*/
|
128
128
|
export interface ScreenshotOptions {
|
129
129
|
/**
|
130
|
-
* @defaultValue
|
130
|
+
* @defaultValue `png`
|
131
131
|
*/
|
132
132
|
type?: 'png' | 'jpeg' | 'webp';
|
133
133
|
/**
|
@@ -138,8 +138,8 @@ export interface ScreenshotOptions {
|
|
138
138
|
*/
|
139
139
|
path?: string;
|
140
140
|
/**
|
141
|
-
* When true
|
142
|
-
* @defaultValue false
|
141
|
+
* When `true`, takes a screenshot of the full page.
|
142
|
+
* @defaultValue `false`
|
143
143
|
*/
|
144
144
|
fullPage?: boolean;
|
145
145
|
/**
|
@@ -152,22 +152,22 @@ export interface ScreenshotOptions {
|
|
152
152
|
quality?: number;
|
153
153
|
/**
|
154
154
|
* Hides default white background and allows capturing screenshots with transparency.
|
155
|
-
* @defaultValue false
|
155
|
+
* @defaultValue `false`
|
156
156
|
*/
|
157
157
|
omitBackground?: boolean;
|
158
158
|
/**
|
159
159
|
* Encoding of the image.
|
160
|
-
* @defaultValue
|
160
|
+
* @defaultValue `binary`
|
161
161
|
*/
|
162
162
|
encoding?: 'base64' | 'binary';
|
163
163
|
/**
|
164
164
|
* Capture the screenshot beyond the viewport.
|
165
|
-
* @defaultValue true
|
165
|
+
* @defaultValue `true`
|
166
166
|
*/
|
167
167
|
captureBeyondViewport?: boolean;
|
168
168
|
/**
|
169
169
|
* Capture the screenshot from the surface, rather than the view.
|
170
|
-
* @defaultValue true
|
170
|
+
* @defaultValue `true`
|
171
171
|
*/
|
172
172
|
fromSurface?: boolean;
|
173
173
|
}
|
@@ -177,7 +177,8 @@ export interface ScreenshotOptions {
|
|
177
177
|
* @public
|
178
178
|
*/
|
179
179
|
export declare const enum PageEmittedEvents {
|
180
|
-
/**
|
180
|
+
/**
|
181
|
+
* Emitted when the page closes.
|
181
182
|
* @eventProperty
|
182
183
|
*/
|
183
184
|
Close = "close",
|
@@ -192,12 +193,13 @@ export declare const enum PageEmittedEvents {
|
|
192
193
|
*
|
193
194
|
* @example
|
194
195
|
* An example of handling `console` event:
|
196
|
+
*
|
195
197
|
* ```ts
|
196
198
|
* page.on('console', msg => {
|
197
199
|
* for (let i = 0; i < msg.args().length; ++i)
|
198
|
-
*
|
199
|
-
*
|
200
|
-
*
|
200
|
+
* console.log(`${i}: ${msg.args()[i]}`);
|
201
|
+
* });
|
202
|
+
* page.evaluate(() => console.log('hello', 5, {foo: 'bar'}));
|
201
203
|
* ```
|
202
204
|
*/
|
203
205
|
Console = "console",
|
@@ -238,14 +240,15 @@ export declare const enum PageEmittedEvents {
|
|
238
240
|
*
|
239
241
|
* @remarks
|
240
242
|
* Contains an object with two properties:
|
243
|
+
*
|
241
244
|
* - `title`: the title passed to `console.timeStamp`
|
242
245
|
* - `metrics`: objec containing metrics as key/value pairs. The values will
|
243
246
|
* be `number`s.
|
244
247
|
*/
|
245
248
|
Metrics = "metrics",
|
246
249
|
/**
|
247
|
-
* Emitted when an uncaught exception happens within the page.
|
248
|
-
*
|
250
|
+
* Emitted when an uncaught exception happens within the page. Contains an
|
251
|
+
* `Error`.
|
249
252
|
*/
|
250
253
|
PageError = "pageerror",
|
251
254
|
/**
|
@@ -274,12 +277,13 @@ export declare const enum PageEmittedEvents {
|
|
274
277
|
* Emitted when a page issues a request and contains a {@link HTTPRequest}.
|
275
278
|
*
|
276
279
|
* @remarks
|
277
|
-
* The object is readonly. See {@link Page.setRequestInterception} for
|
278
|
-
* and mutating requests.
|
280
|
+
* The object is readonly. See {@link Page.setRequestInterception} for
|
281
|
+
* intercepting and mutating requests.
|
279
282
|
*/
|
280
283
|
Request = "request",
|
281
284
|
/**
|
282
|
-
* Emitted when a request ended up loading from cache. Contains a
|
285
|
+
* Emitted when a request ended up loading from cache. Contains a
|
286
|
+
* {@link HTTPRequest}.
|
283
287
|
*
|
284
288
|
* @remarks
|
285
289
|
* For certain requests, might contain undefined.
|
@@ -298,7 +302,8 @@ export declare const enum PageEmittedEvents {
|
|
298
302
|
*/
|
299
303
|
RequestFailed = "requestfailed",
|
300
304
|
/**
|
301
|
-
* Emitted when a request finishes successfully. Contains a
|
305
|
+
* Emitted when a request finishes successfully. Contains a
|
306
|
+
* {@link HTTPRequest}.
|
302
307
|
*/
|
303
308
|
RequestFinished = "requestfinished",
|
304
309
|
/**
|
@@ -323,6 +328,7 @@ export declare const enum PageEmittedEvents {
|
|
323
328
|
*
|
324
329
|
* See {@link PageEmittedEvents} for more detail on the events and when they are
|
325
330
|
* emitted.
|
331
|
+
*
|
326
332
|
* @public
|
327
333
|
*/
|
328
334
|
export interface PageEventObject {
|
@@ -362,6 +368,7 @@ export interface PageEventObject {
|
|
362
368
|
*
|
363
369
|
* @example
|
364
370
|
* This example creates a page, navigates it to a URL, and then saves a screenshot:
|
371
|
+
*
|
365
372
|
* ```ts
|
366
373
|
* const puppeteer = require('puppeteer');
|
367
374
|
*
|
@@ -379,6 +386,7 @@ export interface PageEventObject {
|
|
379
386
|
*
|
380
387
|
* @example
|
381
388
|
* This example logs a message for a single page `load` event:
|
389
|
+
*
|
382
390
|
* ```ts
|
383
391
|
* page.once('load', () => console.log('Page loaded!'));
|
384
392
|
* ```
|
@@ -449,9 +457,9 @@ export declare class Page extends EventEmitter {
|
|
449
457
|
*
|
450
458
|
* ```ts
|
451
459
|
* const [fileChooser] = await Promise.all([
|
452
|
-
*
|
453
|
-
*
|
454
|
-
*
|
460
|
+
* page.waitForFileChooser(),
|
461
|
+
* page.click('#upload-file-button'),
|
462
|
+
* // some button that triggers file selection
|
455
463
|
* ]);
|
456
464
|
* await fileChooser.accept(['/tmp/myfile.pdf']);
|
457
465
|
* ```
|
@@ -459,10 +467,13 @@ export declare class Page extends EventEmitter {
|
|
459
467
|
waitForFileChooser(options?: WaitTimeoutOptions): Promise<FileChooser>;
|
460
468
|
/**
|
461
469
|
* Sets the page's geolocation.
|
470
|
+
*
|
462
471
|
* @remarks
|
463
|
-
*
|
472
|
+
* Consider using {@link BrowserContext.overridePermissions} to grant
|
464
473
|
* permissions for the page to read its geolocation.
|
474
|
+
*
|
465
475
|
* @example
|
476
|
+
*
|
466
477
|
* ```ts
|
467
478
|
* await page.setGeolocation({latitude: 59.95, longitude: 30.31667});
|
468
479
|
* ```
|
@@ -486,6 +497,7 @@ export declare class Page extends EventEmitter {
|
|
486
497
|
browserContext(): BrowserContext;
|
487
498
|
/**
|
488
499
|
* @returns The page's main frame.
|
500
|
+
*
|
489
501
|
* @remarks
|
490
502
|
* Page is guaranteed to have a main frame which persists during navigations.
|
491
503
|
*/
|
@@ -500,27 +512,31 @@ export declare class Page extends EventEmitter {
|
|
500
512
|
*/
|
501
513
|
frames(): Frame[];
|
502
514
|
/**
|
503
|
-
* @returns all of the dedicated
|
504
|
-
*
|
505
|
-
* WebWorkers}
|
506
|
-
*
|
515
|
+
* @returns all of the dedicated {@link
|
516
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API |
|
517
|
+
* WebWorkers} associated with the page.
|
518
|
+
*
|
507
519
|
* @remarks
|
508
|
-
*
|
520
|
+
* This does not contain ServiceWorkers
|
509
521
|
*/
|
510
522
|
workers(): WebWorker[];
|
511
523
|
/**
|
512
|
-
* @param value - Whether to enable request interception.
|
513
|
-
*
|
514
|
-
* @remarks
|
515
524
|
* Activating request interception enables {@link HTTPRequest.abort},
|
516
|
-
* {@link HTTPRequest.continue} and {@link HTTPRequest.respond} methods.
|
525
|
+
* {@link HTTPRequest.continue} and {@link HTTPRequest.respond} methods. This
|
517
526
|
* provides the capability to modify network requests that are made by a page.
|
518
527
|
*
|
519
528
|
* Once request interception is enabled, every request will stall unless it's
|
520
529
|
* continued, responded or aborted; or completed using the browser cache.
|
521
530
|
*
|
531
|
+
* Enabling request interception disables page caching.
|
532
|
+
*
|
533
|
+
* See the
|
534
|
+
* {@link https://pptr.dev/next/guides/request-interception|Request interception guide}
|
535
|
+
* for more details.
|
536
|
+
*
|
522
537
|
* @example
|
523
538
|
* An example of a naïve request interceptor that aborts all image requests:
|
539
|
+
*
|
524
540
|
* ```ts
|
525
541
|
* const puppeteer = require('puppeteer');
|
526
542
|
* (async () => {
|
@@ -528,17 +544,19 @@ export declare class Page extends EventEmitter {
|
|
528
544
|
* const page = await browser.newPage();
|
529
545
|
* await page.setRequestInterception(true);
|
530
546
|
* page.on('request', interceptedRequest => {
|
531
|
-
* if (
|
532
|
-
*
|
547
|
+
* if (
|
548
|
+
* interceptedRequest.url().endsWith('.png') ||
|
549
|
+
* interceptedRequest.url().endsWith('.jpg')
|
550
|
+
* )
|
533
551
|
* interceptedRequest.abort();
|
534
|
-
* else
|
535
|
-
*
|
536
|
-
* });
|
552
|
+
* else interceptedRequest.continue();
|
553
|
+
* });
|
537
554
|
* await page.goto('https://example.com');
|
538
555
|
* await browser.close();
|
539
556
|
* })();
|
540
557
|
* ```
|
541
|
-
*
|
558
|
+
*
|
559
|
+
* @param value - Whether to enable request interception.
|
542
560
|
*/
|
543
561
|
setRequestInterception(value: boolean): Promise<void>;
|
544
562
|
/**
|
@@ -546,7 +564,7 @@ export declare class Page extends EventEmitter {
|
|
546
564
|
*
|
547
565
|
* @remarks
|
548
566
|
* Activating drag interception enables the `Input.drag`,
|
549
|
-
* methods
|
567
|
+
* methods This provides the capability to capture drag events emitted
|
550
568
|
* on the page, which can then be used to simulate drag-and-drop.
|
551
569
|
*/
|
552
570
|
setDragInterception(enabled: boolean): Promise<void>;
|
@@ -561,19 +579,21 @@ export declare class Page extends EventEmitter {
|
|
561
579
|
/**
|
562
580
|
* @param networkConditions - Passing `null` disables network condition emulation.
|
563
581
|
* @example
|
582
|
+
*
|
564
583
|
* ```ts
|
565
584
|
* const puppeteer = require('puppeteer');
|
566
585
|
* const slow3G = puppeteer.networkConditions['Slow 3G'];
|
567
586
|
*
|
568
587
|
* (async () => {
|
569
|
-
*
|
570
|
-
*
|
571
|
-
*
|
572
|
-
*
|
573
|
-
*
|
574
|
-
*
|
588
|
+
* const browser = await puppeteer.launch();
|
589
|
+
* const page = await browser.newPage();
|
590
|
+
* await page.emulateNetworkConditions(slow3G);
|
591
|
+
* await page.goto('https://www.google.com');
|
592
|
+
* // other actions...
|
593
|
+
* await browser.close();
|
575
594
|
* })();
|
576
595
|
* ```
|
596
|
+
*
|
577
597
|
* @remarks
|
578
598
|
* NOTE: This does not affect WebSockets and WebRTC PeerConnections (see
|
579
599
|
* https://crbug.com/563644). To set the page offline, you can use
|
@@ -595,7 +615,7 @@ export declare class Page extends EventEmitter {
|
|
595
615
|
* - {@link Page.setContent | page.setContent(html,options)}
|
596
616
|
*
|
597
617
|
* - {@link Page.waitForNavigation | page.waitForNavigation(options)}
|
598
|
-
*
|
618
|
+
* @param timeout - Maximum navigation time in milliseconds.
|
599
619
|
*/
|
600
620
|
setDefaultNavigationTimeout(timeout: number): void;
|
601
621
|
/**
|
@@ -633,15 +653,20 @@ export declare class Page extends EventEmitter {
|
|
633
653
|
* recommended as they are easier to debug and use with TypeScript):
|
634
654
|
*
|
635
655
|
* @example
|
656
|
+
*
|
636
657
|
* ```ts
|
637
|
-
* const aHandle = await page.evaluateHandle('document')
|
658
|
+
* const aHandle = await page.evaluateHandle('document');
|
638
659
|
* ```
|
639
660
|
*
|
640
661
|
* @example
|
641
662
|
* {@link JSHandle} instances can be passed as arguments to the `pageFunction`:
|
663
|
+
*
|
642
664
|
* ```ts
|
643
665
|
* const aHandle = await page.evaluateHandle(() => document.body);
|
644
|
-
* const resultHandle = await page.evaluateHandle(
|
666
|
+
* const resultHandle = await page.evaluateHandle(
|
667
|
+
* body => body.innerHTML,
|
668
|
+
* aHandle
|
669
|
+
* );
|
645
670
|
* console.log(await resultHandle.jsonValue());
|
646
671
|
* await resultHandle.dispose();
|
647
672
|
* ```
|
@@ -651,14 +676,17 @@ export declare class Page extends EventEmitter {
|
|
651
676
|
* you instead get an {@link ElementHandle} back:
|
652
677
|
*
|
653
678
|
* @example
|
679
|
+
*
|
654
680
|
* ```ts
|
655
|
-
* const button = await page.evaluateHandle(() =>
|
681
|
+
* const button = await page.evaluateHandle(() =>
|
682
|
+
* document.querySelector('button')
|
683
|
+
* );
|
656
684
|
* // can call `click` because `button` is an `ElementHandle`
|
657
685
|
* await button.click();
|
658
686
|
* ```
|
659
687
|
*
|
660
688
|
* The TypeScript definitions assume that `evaluateHandle` returns
|
661
|
-
*
|
689
|
+
* a `JSHandle`, but if you know it's going to return an
|
662
690
|
* `ElementHandle`, pass it as the generic argument:
|
663
691
|
*
|
664
692
|
* ```ts
|
@@ -682,7 +710,7 @@ export declare class Page extends EventEmitter {
|
|
682
710
|
*
|
683
711
|
* ```ts
|
684
712
|
* // Create a Map object
|
685
|
-
* await page.evaluate(() => window.map = new Map());
|
713
|
+
* await page.evaluate(() => (window.map = new Map()));
|
686
714
|
* // Get a handle to the Map object prototype
|
687
715
|
* const mapPrototype = await page.evaluateHandle(() => Map.prototype);
|
688
716
|
* // Query all map instances into an array
|
@@ -692,6 +720,7 @@ export declare class Page extends EventEmitter {
|
|
692
720
|
* await mapInstances.dispose();
|
693
721
|
* await mapPrototype.dispose();
|
694
722
|
* ```
|
723
|
+
*
|
695
724
|
* @param prototypeHandle - a handle to the object prototype.
|
696
725
|
* @returns Promise which resolves to a handle to an array of objects with
|
697
726
|
* this prototype.
|
@@ -726,7 +755,10 @@ export declare class Page extends EventEmitter {
|
|
726
755
|
* ```ts
|
727
756
|
* // if you don't provide HTMLInputElement here, TS will error
|
728
757
|
* // as `value` is not on `Element`
|
729
|
-
* const searchValue = await page.$eval(
|
758
|
+
* const searchValue = await page.$eval(
|
759
|
+
* '#search',
|
760
|
+
* (el: HTMLInputElement) => el.value
|
761
|
+
* );
|
730
762
|
* ```
|
731
763
|
*
|
732
764
|
* The compiler should be able to infer the return type
|
@@ -739,7 +771,8 @@ export declare class Page extends EventEmitter {
|
|
739
771
|
* // The compiler can infer the return type in this case, but if it can't
|
740
772
|
* // or if you want to be more explicit, provide it as the generic type.
|
741
773
|
* const searchValue = await page.$eval<string>(
|
742
|
-
*
|
774
|
+
* '#search',
|
775
|
+
* (el: HTMLInputElement) => el.value
|
743
776
|
* );
|
744
777
|
* ```
|
745
778
|
*
|
@@ -764,7 +797,6 @@ export declare class Page extends EventEmitter {
|
|
764
797
|
* the page and passes the result as the first argument to the `pageFunction`.
|
765
798
|
*
|
766
799
|
* @remarks
|
767
|
-
*
|
768
800
|
* If `pageFunction` returns a promise `$$eval` will wait for the promise to
|
769
801
|
* resolve and then return its value.
|
770
802
|
*
|
@@ -776,7 +808,7 @@ export declare class Page extends EventEmitter {
|
|
776
808
|
*
|
777
809
|
* // get the text content of all the `.options` elements:
|
778
810
|
* const options = await page.$$eval('div > span.options', options => {
|
779
|
-
* return options.map(option => option.textContent)
|
811
|
+
* return options.map(option => option.textContent);
|
780
812
|
* });
|
781
813
|
* ```
|
782
814
|
*
|
@@ -805,16 +837,17 @@ export declare class Page extends EventEmitter {
|
|
805
837
|
* // The compiler can infer the return type in this case, but if it can't
|
806
838
|
* // or if you want to be more explicit, provide it as the generic type.
|
807
839
|
* const allInputValues = await page.$$eval<string[]>(
|
808
|
-
*
|
840
|
+
* 'input',
|
841
|
+
* (elements: HTMLInputElement[]) => elements.map(e => e.textContent)
|
809
842
|
* );
|
810
843
|
* ```
|
811
844
|
*
|
812
845
|
* @param selector - the
|
813
846
|
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
|
814
847
|
* to query for
|
815
|
-
* @param pageFunction - the function to be evaluated in the page context.
|
816
|
-
* be passed the result of
|
817
|
-
* as its first argument.
|
848
|
+
* @param pageFunction - the function to be evaluated in the page context.
|
849
|
+
* Will be passed the result of
|
850
|
+
* `Array.from(document.querySelectorAll(selector))` as its first argument.
|
818
851
|
* @param args - any additional arguments to pass through to `pageFunction`.
|
819
852
|
*
|
820
853
|
* @returns The result of calling `pageFunction`. If it returns an element it
|
@@ -829,8 +862,10 @@ export declare class Page extends EventEmitter {
|
|
829
862
|
* The method evaluates the XPath expression relative to the page document as
|
830
863
|
* its context node. If there are no such elements, the method resolves to an
|
831
864
|
* empty array.
|
865
|
+
*
|
832
866
|
* @remarks
|
833
867
|
* Shortcut for {@link Frame.$x | Page.mainFrame().$x(expression) }.
|
868
|
+
*
|
834
869
|
* @param expression - Expression to evaluate
|
835
870
|
*/
|
836
871
|
$x(expression: string): Promise<Array<ElementHandle<Node>>>;
|
@@ -842,6 +877,7 @@ export declare class Page extends EventEmitter {
|
|
842
877
|
deleteCookie(...cookies: Protocol.Network.DeleteCookiesRequest[]): Promise<void>;
|
843
878
|
/**
|
844
879
|
* @example
|
880
|
+
*
|
845
881
|
* ```ts
|
846
882
|
* await page.setCookie(cookieObject1, cookieObject2);
|
847
883
|
* ```
|
@@ -849,10 +885,13 @@ export declare class Page extends EventEmitter {
|
|
849
885
|
setCookie(...cookies: Protocol.Network.CookieParam[]): Promise<void>;
|
850
886
|
/**
|
851
887
|
* Adds a `<script>` tag into the page with the desired URL or content.
|
888
|
+
*
|
852
889
|
* @remarks
|
853
|
-
* Shortcut for
|
854
|
-
* @
|
855
|
-
*
|
890
|
+
* Shortcut for
|
891
|
+
* {@link Frame.addScriptTag | page.mainFrame().addScriptTag(options)}.
|
892
|
+
*
|
893
|
+
* @returns Promise which resolves to the added tag when the script's onload
|
894
|
+
* fires or when the script content was injected into frame.
|
856
895
|
*/
|
857
896
|
addScriptTag(options: {
|
858
897
|
url?: string;
|
@@ -873,81 +912,104 @@ export declare class Page extends EventEmitter {
|
|
873
912
|
content?: string;
|
874
913
|
}): Promise<ElementHandle<Node>>;
|
875
914
|
/**
|
876
|
-
* The method adds a function called `name` on the page's `window` object.
|
877
|
-
* called, the function executes `puppeteerFunction` in node.js and
|
878
|
-
* `Promise` which resolves to the return value of
|
915
|
+
* The method adds a function called `name` on the page's `window` object.
|
916
|
+
* When called, the function executes `puppeteerFunction` in node.js and
|
917
|
+
* returns a `Promise` which resolves to the return value of
|
918
|
+
* `puppeteerFunction`.
|
879
919
|
*
|
880
920
|
* If the puppeteerFunction returns a `Promise`, it will be awaited.
|
881
921
|
*
|
882
|
-
*
|
883
|
-
*
|
884
|
-
*
|
885
|
-
*
|
922
|
+
* :::note
|
923
|
+
*
|
924
|
+
* Functions installed via `page.exposeFunction` survive navigations.
|
925
|
+
*
|
926
|
+
* :::note
|
927
|
+
*
|
886
928
|
* @example
|
887
929
|
* An example of adding an `md5` function into the page:
|
930
|
+
*
|
888
931
|
* ```ts
|
889
932
|
* const puppeteer = require('puppeteer');
|
890
933
|
* const crypto = require('crypto');
|
891
934
|
*
|
892
935
|
* (async () => {
|
893
|
-
*
|
894
|
-
*
|
895
|
-
*
|
896
|
-
*
|
897
|
-
*
|
898
|
-
*
|
899
|
-
*
|
900
|
-
*
|
901
|
-
*
|
902
|
-
*
|
903
|
-
*
|
904
|
-
*
|
905
|
-
*
|
936
|
+
* const browser = await puppeteer.launch();
|
937
|
+
* const page = await browser.newPage();
|
938
|
+
* page.on('console', msg => console.log(msg.text()));
|
939
|
+
* await page.exposeFunction('md5', text =>
|
940
|
+
* crypto.createHash('md5').update(text).digest('hex')
|
941
|
+
* );
|
942
|
+
* await page.evaluate(async () => {
|
943
|
+
* // use window.md5 to compute hashes
|
944
|
+
* const myString = 'PUPPETEER';
|
945
|
+
* const myHash = await window.md5(myString);
|
946
|
+
* console.log(`md5 of ${myString} is ${myHash}`);
|
947
|
+
* });
|
948
|
+
* await browser.close();
|
906
949
|
* })();
|
907
950
|
* ```
|
951
|
+
*
|
952
|
+
* @example
|
908
953
|
* An example of adding a `window.readfile` function into the page:
|
954
|
+
*
|
909
955
|
* ```ts
|
910
956
|
* const puppeteer = require('puppeteer');
|
911
957
|
* const fs = require('fs');
|
912
958
|
*
|
913
959
|
* (async () => {
|
914
|
-
*
|
915
|
-
*
|
916
|
-
*
|
917
|
-
*
|
918
|
-
*
|
919
|
-
*
|
920
|
-
*
|
921
|
-
*
|
922
|
-
*
|
923
|
-
*
|
924
|
-
*
|
925
|
-
*
|
926
|
-
*
|
927
|
-
*
|
928
|
-
*
|
929
|
-
*
|
930
|
-
*
|
960
|
+
* const browser = await puppeteer.launch();
|
961
|
+
* const page = await browser.newPage();
|
962
|
+
* page.on('console', msg => console.log(msg.text()));
|
963
|
+
* await page.exposeFunction('readfile', async filePath => {
|
964
|
+
* return new Promise((resolve, reject) => {
|
965
|
+
* fs.readFile(filePath, 'utf8', (err, text) => {
|
966
|
+
* if (err) reject(err);
|
967
|
+
* else resolve(text);
|
968
|
+
* });
|
969
|
+
* });
|
970
|
+
* });
|
971
|
+
* await page.evaluate(async () => {
|
972
|
+
* // use window.readfile to read contents of a file
|
973
|
+
* const content = await window.readfile('/etc/hosts');
|
974
|
+
* console.log(content);
|
975
|
+
* });
|
976
|
+
* await browser.close();
|
931
977
|
* })();
|
932
978
|
* ```
|
979
|
+
*
|
980
|
+
* @param name - Name of the function on the window object
|
981
|
+
* @param pptrFunction - Callback function which will be called in Puppeteer's
|
982
|
+
* context.
|
933
983
|
*/
|
934
984
|
exposeFunction(name: string, pptrFunction: Function | {
|
935
985
|
default: Function;
|
936
986
|
}): Promise<void>;
|
937
987
|
/**
|
938
988
|
* Provide credentials for `HTTP authentication`.
|
939
|
-
*
|
989
|
+
*
|
990
|
+
* @remarks
|
991
|
+
* To disable authentication, pass `null`.
|
940
992
|
*/
|
941
993
|
authenticate(credentials: Credentials): Promise<void>;
|
942
994
|
/**
|
943
995
|
* The extra HTTP headers will be sent with every request the page initiates.
|
944
|
-
*
|
996
|
+
*
|
997
|
+
* :::tip
|
998
|
+
*
|
999
|
+
* All HTTP header names are lowercased. (HTTP headers are
|
945
1000
|
* case-insensitive, so this shouldn’t impact your server code.)
|
946
|
-
*
|
1001
|
+
*
|
1002
|
+
* :::
|
1003
|
+
*
|
1004
|
+
* :::note
|
1005
|
+
*
|
1006
|
+
* page.setExtraHTTPHeaders does not guarantee the order of headers in
|
947
1007
|
* the outgoing requests.
|
1008
|
+
*
|
1009
|
+
* :::
|
1010
|
+
*
|
948
1011
|
* @param headers - An object containing additional HTTP headers to be sent
|
949
1012
|
* with every request. All header values must be strings.
|
950
|
-
* @returns
|
951
1013
|
*/
|
952
1014
|
setExtraHTTPHeaders(headers: Record<string, string>): Promise<void>;
|
953
1015
|
/**
|
@@ -983,12 +1045,12 @@ export declare class Page extends EventEmitter {
|
|
983
1045
|
*
|
984
1046
|
* - `TaskDuration` : Combined duration of all tasks performed by the browser.
|
985
1047
|
*
|
986
|
-
*
|
987
1048
|
* - `JSHeapUsedSize` : Used JavaScript heap size.
|
988
1049
|
*
|
989
1050
|
* - `JSHeapTotalSize` : Total JavaScript heap size.
|
1051
|
+
*
|
990
1052
|
* @remarks
|
991
|
-
*
|
1053
|
+
* All timestamps are in monotonic time: monotonically increasing time
|
992
1054
|
* in seconds since an arbitrary point in the past.
|
993
1055
|
*/
|
994
1056
|
metrics(): Promise<Metrics>;
|
@@ -1012,17 +1074,17 @@ export declare class Page extends EventEmitter {
|
|
1012
1074
|
* {@link Page.setDefaultTimeout} methods.
|
1013
1075
|
*
|
1014
1076
|
* - `waitUntil`: When to consider setting markup succeeded, defaults to
|
1015
|
-
*
|
1016
|
-
*
|
1017
|
-
*
|
1018
|
-
*
|
1019
|
-
*
|
1020
|
-
*
|
1021
|
-
*
|
1022
|
-
*
|
1023
|
-
*
|
1024
|
-
*
|
1025
|
-
*
|
1077
|
+
* `load`. Given an array of event strings, setting content is considered
|
1078
|
+
* to be successful after all events have been fired. Events can be
|
1079
|
+
* either:<br/>
|
1080
|
+
* - `load` : consider setting content to be finished when the `load` event
|
1081
|
+
* is fired.<br/>
|
1082
|
+
* - `domcontentloaded` : consider setting content to be finished when the
|
1083
|
+
* `DOMContentLoaded` event is fired.<br/>
|
1084
|
+
* - `networkidle0` : consider setting content to be finished when there are
|
1085
|
+
* no more than 0 network connections for at least `500` ms.<br/>
|
1086
|
+
* - `networkidle2` : consider setting content to be finished when there are
|
1087
|
+
* no more than 2 network connections for at least `500` ms.
|
1026
1088
|
*/
|
1027
1089
|
setContent(html: string, options?: WaitForOptions): Promise<void>;
|
1028
1090
|
/**
|
@@ -1041,22 +1103,23 @@ export declare class Page extends EventEmitter {
|
|
1041
1103
|
* {@link Page.setDefaultTimeout} methods.
|
1042
1104
|
*
|
1043
1105
|
* - `waitUntil`:When to consider navigation succeeded, defaults to `load`.
|
1044
|
-
*
|
1045
|
-
*
|
1046
|
-
*
|
1047
|
-
*
|
1048
|
-
*
|
1049
|
-
*
|
1050
|
-
*
|
1051
|
-
*
|
1052
|
-
*
|
1053
|
-
*
|
1106
|
+
* Given an array of event strings, navigation is considered to be
|
1107
|
+
* successful after all events have been fired. Events can be either:<br/>
|
1108
|
+
* - `load` : consider navigation to be finished when the load event is
|
1109
|
+
* fired.<br/>
|
1110
|
+
* - `domcontentloaded` : consider navigation to be finished when the
|
1111
|
+
* DOMContentLoaded event is fired.<br/>
|
1112
|
+
* - `networkidle0` : consider navigation to be finished when there are no
|
1113
|
+
* more than 0 network connections for at least `500` ms.<br/>
|
1114
|
+
* - `networkidle2` : consider navigation to be finished when there are no
|
1115
|
+
* more than 2 network connections for at least `500` ms.
|
1054
1116
|
*
|
1055
1117
|
* - `referer` : Referer header value. If provided it will take preference
|
1056
1118
|
* over the referer header value set by
|
1057
1119
|
* {@link Page.setExtraHTTPHeaders |page.setExtraHTTPHeaders()}.
|
1058
1120
|
*
|
1059
1121
|
* `page.goto` will throw an error if:
|
1122
|
+
*
|
1060
1123
|
* - there's an SSL error (e.g. in case of self-signed certificates).
|
1061
1124
|
* - target URL is invalid.
|
1062
1125
|
* - the timeout is exceeded during navigation.
|
@@ -1064,9 +1127,9 @@ export declare class Page extends EventEmitter {
|
|
1064
1127
|
* - the main resource failed to load.
|
1065
1128
|
*
|
1066
1129
|
* `page.goto` will not throw an error when any valid HTTP status code is
|
1067
|
-
*
|
1068
|
-
*
|
1069
|
-
*
|
1130
|
+
* returned by the remote server, including 404 "Not Found" and 500
|
1131
|
+
* "Internal Server Error". The status code for such responses can be
|
1132
|
+
* retrieved by calling response.status().
|
1070
1133
|
*
|
1071
1134
|
* NOTE: `page.goto` either throws an error or returns a main resource
|
1072
1135
|
* response. The only exceptions are navigation to about:blank or navigation
|
@@ -1096,16 +1159,16 @@ export declare class Page extends EventEmitter {
|
|
1096
1159
|
* {@link Page.setDefaultTimeout} methods.
|
1097
1160
|
*
|
1098
1161
|
* - `waitUntil`: When to consider navigation succeeded, defaults to `load`.
|
1099
|
-
*
|
1100
|
-
*
|
1101
|
-
*
|
1102
|
-
*
|
1103
|
-
*
|
1104
|
-
*
|
1105
|
-
*
|
1106
|
-
*
|
1107
|
-
*
|
1108
|
-
*
|
1162
|
+
* Given an array of event strings, navigation is considered to be
|
1163
|
+
* successful after all events have been fired. Events can be either:<br/>
|
1164
|
+
* - `load` : consider navigation to be finished when the load event is
|
1165
|
+
* fired.<br/>
|
1166
|
+
* - `domcontentloaded` : consider navigation to be finished when the
|
1167
|
+
* DOMContentLoaded event is fired.<br/>
|
1168
|
+
* - `networkidle0` : consider navigation to be finished when there are no
|
1169
|
+
* more than 0 network connections for at least `500` ms.<br/>
|
1170
|
+
* - `networkidle2` : consider navigation to be finished when there are no
|
1171
|
+
* more than 2 network connections for at least `500` ms.
|
1109
1172
|
*/
|
1110
1173
|
reload(options?: WaitForOptions): Promise<HTTPResponse | null>;
|
1111
1174
|
/**
|
@@ -1113,10 +1176,11 @@ export declare class Page extends EventEmitter {
|
|
1113
1176
|
* you run code that will indirectly cause the page to navigate.
|
1114
1177
|
*
|
1115
1178
|
* @example
|
1179
|
+
*
|
1116
1180
|
* ```ts
|
1117
1181
|
* const [response] = await Promise.all([
|
1118
|
-
*
|
1119
|
-
*
|
1182
|
+
* page.waitForNavigation(), // The promise resolves after navigation has finished
|
1183
|
+
* page.click('a.my-link'), // Clicking the link will indirectly cause a navigation
|
1120
1184
|
* ]);
|
1121
1185
|
* ```
|
1122
1186
|
*
|
@@ -1128,6 +1192,7 @@ export declare class Page extends EventEmitter {
|
|
1128
1192
|
* @param options - Navigation parameters which might have the following
|
1129
1193
|
* properties:
|
1130
1194
|
* @returns A `Promise` which resolves to the main resource response.
|
1195
|
+
*
|
1131
1196
|
* - In case of multiple redirects, the navigation will resolve with the
|
1132
1197
|
* response of the last redirect.
|
1133
1198
|
* - In case of navigation to a different anchor or navigation due to History
|
@@ -1139,25 +1204,27 @@ export declare class Page extends EventEmitter {
|
|
1139
1204
|
* @param options - Optional waiting parameters
|
1140
1205
|
* @returns Promise which resolves to the matched response
|
1141
1206
|
* @example
|
1207
|
+
*
|
1142
1208
|
* ```ts
|
1143
1209
|
* const firstResponse = await page.waitForResponse(
|
1144
|
-
*
|
1210
|
+
* 'https://example.com/resource'
|
1145
1211
|
* );
|
1146
1212
|
* const finalResponse = await page.waitForResponse(
|
1147
|
-
*
|
1148
|
-
*
|
1213
|
+
* response =>
|
1214
|
+
* response.url() === 'https://example.com' && response.status() === 200
|
1149
1215
|
* );
|
1150
|
-
* const finalResponse = await page.waitForResponse(async
|
1151
|
-
*
|
1216
|
+
* const finalResponse = await page.waitForResponse(async response => {
|
1217
|
+
* return (await response.text()).includes('<html>');
|
1152
1218
|
* });
|
1153
1219
|
* return finalResponse.ok();
|
1154
1220
|
* ```
|
1221
|
+
*
|
1155
1222
|
* @remarks
|
1156
1223
|
* Optional Waiting Parameters have:
|
1157
1224
|
*
|
1158
1225
|
* - `timeout`: Maximum wait time in milliseconds, defaults to `30` seconds, pass
|
1159
|
-
*
|
1160
|
-
*
|
1226
|
+
* `0` to disable the timeout. The default value can be changed by using the
|
1227
|
+
* {@link Page.setDefaultTimeout} method.
|
1161
1228
|
*/
|
1162
1229
|
waitForRequest(urlOrPredicate: string | ((req: HTTPRequest) => boolean | Promise<boolean>), options?: {
|
1163
1230
|
timeout?: number;
|
@@ -1167,25 +1234,27 @@ export declare class Page extends EventEmitter {
|
|
1167
1234
|
* @param options - Optional waiting parameters
|
1168
1235
|
* @returns Promise which resolves to the matched response.
|
1169
1236
|
* @example
|
1237
|
+
*
|
1170
1238
|
* ```ts
|
1171
1239
|
* const firstResponse = await page.waitForResponse(
|
1172
|
-
*
|
1240
|
+
* 'https://example.com/resource'
|
1173
1241
|
* );
|
1174
1242
|
* const finalResponse = await page.waitForResponse(
|
1175
|
-
*
|
1176
|
-
*
|
1243
|
+
* response =>
|
1244
|
+
* response.url() === 'https://example.com' && response.status() === 200
|
1177
1245
|
* );
|
1178
|
-
* const finalResponse = await page.waitForResponse(async
|
1179
|
-
*
|
1246
|
+
* const finalResponse = await page.waitForResponse(async response => {
|
1247
|
+
* return (await response.text()).includes('<html>');
|
1180
1248
|
* });
|
1181
1249
|
* return finalResponse.ok();
|
1182
1250
|
* ```
|
1251
|
+
*
|
1183
1252
|
* @remarks
|
1184
1253
|
* Optional Parameter have:
|
1185
1254
|
*
|
1186
1255
|
* - `timeout`: Maximum wait time in milliseconds, defaults to `30` seconds,
|
1187
|
-
*
|
1188
|
-
*
|
1256
|
+
* pass `0` to disable the timeout. The default value can be changed by using
|
1257
|
+
* the {@link Page.setDefaultTimeout} method.
|
1189
1258
|
*/
|
1190
1259
|
waitForResponse(urlOrPredicate: string | ((res: HTTPResponse) => boolean | Promise<boolean>), options?: {
|
1191
1260
|
timeout?: number;
|
@@ -1203,17 +1272,19 @@ export declare class Page extends EventEmitter {
|
|
1203
1272
|
* @param options - Optional waiting parameters
|
1204
1273
|
* @returns Promise which resolves to the matched frame.
|
1205
1274
|
* @example
|
1275
|
+
*
|
1206
1276
|
* ```ts
|
1207
|
-
* const frame = await page.waitForFrame(async
|
1277
|
+
* const frame = await page.waitForFrame(async frame => {
|
1208
1278
|
* return frame.name() === 'Test';
|
1209
1279
|
* });
|
1210
1280
|
* ```
|
1281
|
+
*
|
1211
1282
|
* @remarks
|
1212
1283
|
* Optional Parameter have:
|
1213
1284
|
*
|
1214
1285
|
* - `timeout`: Maximum wait time in milliseconds, defaults to `30` seconds,
|
1215
|
-
*
|
1216
|
-
*
|
1286
|
+
* pass `0` to disable the timeout. The default value can be changed by using
|
1287
|
+
* the {@link Page.setDefaultTimeout} method.
|
1217
1288
|
*/
|
1218
1289
|
waitForFrame(urlOrPredicate: string | ((frame: Frame) => boolean | Promise<boolean>), options?: {
|
1219
1290
|
timeout?: number;
|
@@ -1233,16 +1304,16 @@ export declare class Page extends EventEmitter {
|
|
1233
1304
|
* {@link Page.setDefaultTimeout} methods.
|
1234
1305
|
*
|
1235
1306
|
* - `waitUntil` : When to consider navigation succeeded, defaults to `load`.
|
1236
|
-
*
|
1237
|
-
*
|
1238
|
-
*
|
1239
|
-
*
|
1240
|
-
*
|
1241
|
-
*
|
1242
|
-
*
|
1243
|
-
*
|
1244
|
-
*
|
1245
|
-
*
|
1307
|
+
* Given an array of event strings, navigation is considered to be
|
1308
|
+
* successful after all events have been fired. Events can be either:<br/>
|
1309
|
+
* - `load` : consider navigation to be finished when the load event is
|
1310
|
+
* fired.<br/>
|
1311
|
+
* - `domcontentloaded` : consider navigation to be finished when the
|
1312
|
+
* DOMContentLoaded event is fired.<br/>
|
1313
|
+
* - `networkidle0` : consider navigation to be finished when there are no
|
1314
|
+
* more than 0 network connections for at least `500` ms.<br/>
|
1315
|
+
* - `networkidle2` : consider navigation to be finished when there are no
|
1316
|
+
* more than 2 network connections for at least `500` ms.
|
1246
1317
|
*/
|
1247
1318
|
goBack(options?: WaitForOptions): Promise<HTTPResponse | null>;
|
1248
1319
|
/**
|
@@ -1260,16 +1331,16 @@ export declare class Page extends EventEmitter {
|
|
1260
1331
|
* {@link Page.setDefaultTimeout} methods.
|
1261
1332
|
*
|
1262
1333
|
* - `waitUntil`: When to consider navigation succeeded, defaults to `load`.
|
1263
|
-
*
|
1264
|
-
*
|
1265
|
-
*
|
1266
|
-
*
|
1267
|
-
*
|
1268
|
-
*
|
1269
|
-
*
|
1270
|
-
*
|
1271
|
-
*
|
1272
|
-
*
|
1334
|
+
* Given an array of event strings, navigation is considered to be
|
1335
|
+
* successful after all events have been fired. Events can be either:<br/>
|
1336
|
+
* - `load` : consider navigation to be finished when the load event is
|
1337
|
+
* fired.<br/>
|
1338
|
+
* - `domcontentloaded` : consider navigation to be finished when the
|
1339
|
+
* DOMContentLoaded event is fired.<br/>
|
1340
|
+
* - `networkidle0` : consider navigation to be finished when there are no
|
1341
|
+
* more than 0 network connections for at least `500` ms.<br/>
|
1342
|
+
* - `networkidle2` : consider navigation to be finished when there are no
|
1343
|
+
* more than 2 network connections for at least `500` ms.
|
1273
1344
|
*/
|
1274
1345
|
goForward(options?: WaitForOptions): Promise<HTTPResponse | null>;
|
1275
1346
|
/**
|
@@ -1287,18 +1358,20 @@ export declare class Page extends EventEmitter {
|
|
1287
1358
|
* don't expect phones to change size, so you should emulate before navigating
|
1288
1359
|
* to the page.
|
1289
1360
|
* @example
|
1361
|
+
*
|
1290
1362
|
* ```ts
|
1291
1363
|
* const puppeteer = require('puppeteer');
|
1292
1364
|
* const iPhone = puppeteer.devices['iPhone 6'];
|
1293
1365
|
* (async () => {
|
1294
|
-
*
|
1295
|
-
*
|
1296
|
-
*
|
1297
|
-
*
|
1298
|
-
*
|
1299
|
-
*
|
1366
|
+
* const browser = await puppeteer.launch();
|
1367
|
+
* const page = await browser.newPage();
|
1368
|
+
* await page.emulate(iPhone);
|
1369
|
+
* await page.goto('https://www.google.com');
|
1370
|
+
* // other actions...
|
1371
|
+
* await browser.close();
|
1300
1372
|
* })();
|
1301
1373
|
* ```
|
1374
|
+
*
|
1302
1375
|
* @remarks List of all available devices is available in the source code:
|
1303
1376
|
* {@link https://github.com/puppeteer/puppeteer/blob/main/src/common/DeviceDescriptors.ts | src/common/DeviceDescriptors.ts}.
|
1304
1377
|
*/
|
@@ -1328,6 +1401,7 @@ export declare class Page extends EventEmitter {
|
|
1328
1401
|
* values are `screen`, `print` and `null`. Passing `null` disables CSS media
|
1329
1402
|
* emulation.
|
1330
1403
|
* @example
|
1404
|
+
*
|
1331
1405
|
* ```ts
|
1332
1406
|
* await page.evaluate(() => matchMedia('screen').matches);
|
1333
1407
|
* // → true
|
@@ -1358,45 +1432,54 @@ export declare class Page extends EventEmitter {
|
|
1358
1432
|
* objects, emulates CSS media features on the page. Each media feature object
|
1359
1433
|
* must have the following properties:
|
1360
1434
|
* @example
|
1435
|
+
*
|
1361
1436
|
* ```ts
|
1362
1437
|
* await page.emulateMediaFeatures([
|
1363
|
-
*
|
1438
|
+
* {name: 'prefers-color-scheme', value: 'dark'},
|
1364
1439
|
* ]);
|
1365
|
-
* await page.evaluate(
|
1440
|
+
* await page.evaluate(
|
1441
|
+
* () => matchMedia('(prefers-color-scheme: dark)').matches
|
1442
|
+
* );
|
1366
1443
|
* // → true
|
1367
|
-
* await page.evaluate(
|
1444
|
+
* await page.evaluate(
|
1445
|
+
* () => matchMedia('(prefers-color-scheme: light)').matches
|
1446
|
+
* );
|
1368
1447
|
* // → false
|
1369
1448
|
*
|
1370
1449
|
* await page.emulateMediaFeatures([
|
1371
|
-
*
|
1450
|
+
* {name: 'prefers-reduced-motion', value: 'reduce'},
|
1372
1451
|
* ]);
|
1373
1452
|
* await page.evaluate(
|
1374
|
-
*
|
1453
|
+
* () => matchMedia('(prefers-reduced-motion: reduce)').matches
|
1375
1454
|
* );
|
1376
1455
|
* // → true
|
1377
1456
|
* await page.evaluate(
|
1378
|
-
*
|
1457
|
+
* () => matchMedia('(prefers-reduced-motion: no-preference)').matches
|
1379
1458
|
* );
|
1380
1459
|
* // → false
|
1381
1460
|
*
|
1382
1461
|
* await page.emulateMediaFeatures([
|
1383
|
-
*
|
1384
|
-
*
|
1462
|
+
* {name: 'prefers-color-scheme', value: 'dark'},
|
1463
|
+
* {name: 'prefers-reduced-motion', value: 'reduce'},
|
1385
1464
|
* ]);
|
1386
|
-
* await page.evaluate(
|
1465
|
+
* await page.evaluate(
|
1466
|
+
* () => matchMedia('(prefers-color-scheme: dark)').matches
|
1467
|
+
* );
|
1387
1468
|
* // → true
|
1388
|
-
* await page.evaluate(
|
1469
|
+
* await page.evaluate(
|
1470
|
+
* () => matchMedia('(prefers-color-scheme: light)').matches
|
1471
|
+
* );
|
1389
1472
|
* // → false
|
1390
1473
|
* await page.evaluate(
|
1391
|
-
*
|
1474
|
+
* () => matchMedia('(prefers-reduced-motion: reduce)').matches
|
1392
1475
|
* );
|
1393
1476
|
* // → true
|
1394
1477
|
* await page.evaluate(
|
1395
|
-
*
|
1478
|
+
* () => matchMedia('(prefers-reduced-motion: no-preference)').matches
|
1396
1479
|
* );
|
1397
1480
|
* // → false
|
1398
1481
|
*
|
1399
|
-
* await page.emulateMediaFeatures([{
|
1482
|
+
* await page.emulateMediaFeatures([{name: 'color-gamut', value: 'p3'}]);
|
1400
1483
|
* await page.evaluate(() => matchMedia('(color-gamut: srgb)').matches);
|
1401
1484
|
* // → true
|
1402
1485
|
* await page.evaluate(() => matchMedia('(color-gamut: p3)').matches);
|
@@ -1418,6 +1501,7 @@ export declare class Page extends EventEmitter {
|
|
1418
1501
|
* If no arguments set, clears idle state emulation.
|
1419
1502
|
*
|
1420
1503
|
* @example
|
1504
|
+
*
|
1421
1505
|
* ```ts
|
1422
1506
|
* // set idle emulation
|
1423
1507
|
* await page.emulateIdleState({isUserActive: true, isScreenUnlocked: false});
|
@@ -1439,6 +1523,7 @@ export declare class Page extends EventEmitter {
|
|
1439
1523
|
* Simulates the given vision deficiency on the page.
|
1440
1524
|
*
|
1441
1525
|
* @example
|
1526
|
+
*
|
1442
1527
|
* ```ts
|
1443
1528
|
* const puppeteer = require('puppeteer');
|
1444
1529
|
*
|
@@ -1448,13 +1533,13 @@ export declare class Page extends EventEmitter {
|
|
1448
1533
|
* await page.goto('https://v8.dev/blog/10-years');
|
1449
1534
|
*
|
1450
1535
|
* await page.emulateVisionDeficiency('achromatopsia');
|
1451
|
-
* await page.screenshot({
|
1536
|
+
* await page.screenshot({path: 'achromatopsia.png'});
|
1452
1537
|
*
|
1453
1538
|
* await page.emulateVisionDeficiency('deuteranopia');
|
1454
|
-
* await page.screenshot({
|
1539
|
+
* await page.screenshot({path: 'deuteranopia.png'});
|
1455
1540
|
*
|
1456
1541
|
* await page.emulateVisionDeficiency('blurredVision');
|
1457
|
-
* await page.screenshot({
|
1542
|
+
* await page.screenshot({path: 'blurred-vision.png'});
|
1458
1543
|
*
|
1459
1544
|
* await browser.close();
|
1460
1545
|
* })();
|
@@ -1471,12 +1556,13 @@ export declare class Page extends EventEmitter {
|
|
1471
1556
|
* In the case of multiple pages in a single browser, each page can have its
|
1472
1557
|
* own viewport size.
|
1473
1558
|
* @example
|
1559
|
+
*
|
1474
1560
|
* ```ts
|
1475
1561
|
* const page = await browser.newPage();
|
1476
1562
|
* await page.setViewport({
|
1477
|
-
*
|
1478
|
-
*
|
1479
|
-
*
|
1563
|
+
* width: 640,
|
1564
|
+
* height: 480,
|
1565
|
+
* deviceScaleFactor: 1,
|
1480
1566
|
* });
|
1481
1567
|
* await page.goto('https://example.com');
|
1482
1568
|
* ```
|
@@ -1524,8 +1610,6 @@ export declare class Page extends EventEmitter {
|
|
1524
1610
|
*/
|
1525
1611
|
viewport(): Viewport | null;
|
1526
1612
|
/**
|
1527
|
-
* @remarks
|
1528
|
-
*
|
1529
1613
|
* Evaluates a function in the page's context and returns the result.
|
1530
1614
|
*
|
1531
1615
|
* If the function passed to `page.evaluteHandle` returns a Promise, the
|
@@ -1544,6 +1628,7 @@ export declare class Page extends EventEmitter {
|
|
1544
1628
|
* recommended as they are easier to debug and use with TypeScript):
|
1545
1629
|
*
|
1546
1630
|
* @example
|
1631
|
+
*
|
1547
1632
|
* ```ts
|
1548
1633
|
* const aHandle = await page.evaluate('1 + 2');
|
1549
1634
|
* ```
|
@@ -1578,7 +1663,7 @@ export declare class Page extends EventEmitter {
|
|
1578
1663
|
* - whenever the page is navigated
|
1579
1664
|
*
|
1580
1665
|
* - whenever the child frame is attached or navigated. In this case, the
|
1581
|
-
*
|
1666
|
+
* function is invoked in the context of the newly attached frame.
|
1582
1667
|
*
|
1583
1668
|
* The function is invoked after the document was created but before any of
|
1584
1669
|
* its scripts were run. This is useful to amend the JavaScript environment,
|
@@ -1587,6 +1672,7 @@ export declare class Page extends EventEmitter {
|
|
1587
1672
|
* @param args - Arguments to pass to `pageFunction`
|
1588
1673
|
* @example
|
1589
1674
|
* An example of overriding the navigator.languages property before the page loads:
|
1675
|
+
*
|
1590
1676
|
* ```ts
|
1591
1677
|
* // preload.js
|
1592
1678
|
*
|
@@ -1632,10 +1718,10 @@ export declare class Page extends EventEmitter {
|
|
1632
1718
|
*
|
1633
1719
|
* - `clip` : An object which specifies clipping region of the page.
|
1634
1720
|
* Should have the following fields:<br/>
|
1635
|
-
*
|
1636
|
-
*
|
1637
|
-
*
|
1638
|
-
*
|
1721
|
+
* - `x` : x-coordinate of top-left corner of clip area.<br/>
|
1722
|
+
* - `y` : y-coordinate of top-left corner of clip area.<br/>
|
1723
|
+
* - `width` : width of clipping area.<br/>
|
1724
|
+
* - `height` : height of clipping area.
|
1639
1725
|
*
|
1640
1726
|
* - `omitBackground` : Hides default white background and allows
|
1641
1727
|
* capturing screenshots with transparency. Defaults to `false`.
|
@@ -1675,7 +1761,6 @@ export declare class Page extends EventEmitter {
|
|
1675
1761
|
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-print-color-adjust | `-webkit-print-color-adjust`}
|
1676
1762
|
* property to force rendering of exact colors.
|
1677
1763
|
*
|
1678
|
-
*
|
1679
1764
|
* @param options - options for generating the PDF.
|
1680
1765
|
*/
|
1681
1766
|
createPDFStream(options?: PDFOptions): Promise<Readable>;
|
@@ -1708,12 +1793,14 @@ export declare class Page extends EventEmitter {
|
|
1708
1793
|
* there's a separate `page.waitForNavigation()` promise to be resolved, you
|
1709
1794
|
* may end up with a race condition that yields unexpected results. The
|
1710
1795
|
* correct pattern for click and wait for navigation is the following:
|
1796
|
+
*
|
1711
1797
|
* ```ts
|
1712
1798
|
* const [response] = await Promise.all([
|
1713
|
-
*
|
1714
|
-
*
|
1799
|
+
* page.waitForNavigation(waitOptions),
|
1800
|
+
* page.click(selector, clickOptions),
|
1715
1801
|
* ]);
|
1716
1802
|
* ```
|
1803
|
+
*
|
1717
1804
|
* Shortcut for {@link Frame.click | page.mainFrame().click(selector[, options]) }.
|
1718
1805
|
* @param selector - A `selector` to search for element to click. If there are
|
1719
1806
|
* multiple elements satisfying the `selector`, the first will be clicked
|
@@ -1734,7 +1821,7 @@ export declare class Page extends EventEmitter {
|
|
1734
1821
|
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector }
|
1735
1822
|
* of an element to focus. If there are multiple elements satisfying the
|
1736
1823
|
* selector, the first will be focused.
|
1737
|
-
* @returns
|
1824
|
+
* @returns Promise which resolves when the element matching selector is
|
1738
1825
|
* successfully focused. The promise will be rejected if there is no element
|
1739
1826
|
* matching selector.
|
1740
1827
|
* @remarks
|
@@ -1762,10 +1849,12 @@ export declare class Page extends EventEmitter {
|
|
1762
1849
|
* throws an error.
|
1763
1850
|
*
|
1764
1851
|
* @example
|
1852
|
+
*
|
1765
1853
|
* ```ts
|
1766
1854
|
* page.select('select#colors', 'blue'); // single selection
|
1767
1855
|
* page.select('select#colors', 'red', 'green', 'blue'); // multiple selections
|
1768
1856
|
* ```
|
1857
|
+
*
|
1769
1858
|
* @param selector - A
|
1770
1859
|
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | Selector}
|
1771
1860
|
* to query the page for
|
@@ -1797,12 +1886,14 @@ export declare class Page extends EventEmitter {
|
|
1797
1886
|
*
|
1798
1887
|
* To press a special key, like `Control` or `ArrowDown`, use {@link Keyboard.press}.
|
1799
1888
|
* @example
|
1889
|
+
*
|
1800
1890
|
* ```ts
|
1801
1891
|
* await page.type('#mytextarea', 'Hello');
|
1802
1892
|
* // Types instantly
|
1803
|
-
* await page.type('#mytextarea', 'World', {
|
1893
|
+
* await page.type('#mytextarea', 'World', {delay: 100});
|
1804
1894
|
* // Types slower, like a user
|
1805
1895
|
* ```
|
1896
|
+
*
|
1806
1897
|
* @param selector - A
|
1807
1898
|
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
|
1808
1899
|
* of an element to type into. If there are multiple elements satisfying the
|
@@ -1817,13 +1908,14 @@ export declare class Page extends EventEmitter {
|
|
1817
1908
|
delay: number;
|
1818
1909
|
}): Promise<void>;
|
1819
1910
|
/**
|
1911
|
+
* @deprecated Use `new Promise(r => setTimeout(r, milliseconds));`.
|
1912
|
+
*
|
1820
1913
|
* Causes your script to wait for the given number of milliseconds.
|
1821
1914
|
*
|
1822
1915
|
* @remarks
|
1823
|
-
*
|
1824
1916
|
* It's generally recommended to not wait for a number of seconds, but instead
|
1825
|
-
* use {@link
|
1826
|
-
* {@link
|
1917
|
+
* use {@link Frame.waitForSelector}, {@link Frame.waitForXPath} or
|
1918
|
+
* {@link Frame.waitForFunction} to wait for exactly the conditions you want.
|
1827
1919
|
*
|
1828
1920
|
* @example
|
1829
1921
|
*
|
@@ -1843,25 +1935,27 @@ export declare class Page extends EventEmitter {
|
|
1843
1935
|
* function will throw.
|
1844
1936
|
*
|
1845
1937
|
* This method works across navigations:
|
1938
|
+
*
|
1846
1939
|
* ```ts
|
1847
1940
|
* const puppeteer = require('puppeteer');
|
1848
1941
|
* (async () => {
|
1849
|
-
*
|
1850
|
-
*
|
1851
|
-
*
|
1852
|
-
*
|
1853
|
-
*
|
1854
|
-
*
|
1855
|
-
*
|
1856
|
-
*
|
1857
|
-
*
|
1858
|
-
*
|
1859
|
-
*
|
1860
|
-
*
|
1861
|
-
*
|
1862
|
-
*
|
1942
|
+
* const browser = await puppeteer.launch();
|
1943
|
+
* const page = await browser.newPage();
|
1944
|
+
* let currentURL;
|
1945
|
+
* page
|
1946
|
+
* .waitForSelector('img')
|
1947
|
+
* .then(() => console.log('First URL with image: ' + currentURL));
|
1948
|
+
* for (currentURL of [
|
1949
|
+
* 'https://example.com',
|
1950
|
+
* 'https://google.com',
|
1951
|
+
* 'https://bbc.com',
|
1952
|
+
* ]) {
|
1953
|
+
* await page.goto(currentURL);
|
1954
|
+
* }
|
1955
|
+
* await browser.close();
|
1863
1956
|
* })();
|
1864
1957
|
* ```
|
1958
|
+
*
|
1865
1959
|
* @param selector - A
|
1866
1960
|
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | selector}
|
1867
1961
|
* of an element to wait for
|
@@ -1873,16 +1967,16 @@ export declare class Page extends EventEmitter {
|
|
1873
1967
|
* The optional Parameter in Arguments `options` are :
|
1874
1968
|
*
|
1875
1969
|
* - `Visible`: A boolean wait for element to be present in DOM and to be
|
1876
|
-
*
|
1877
|
-
*
|
1970
|
+
* visible, i.e. to not have `display: none` or `visibility: hidden` CSS
|
1971
|
+
* properties. Defaults to `false`.
|
1878
1972
|
*
|
1879
1973
|
* - `hidden`: Wait for element to not be found in the DOM or to be hidden,
|
1880
|
-
*
|
1881
|
-
*
|
1974
|
+
* i.e. have `display: none` or `visibility: hidden` CSS properties. Defaults to
|
1975
|
+
* `false`.
|
1882
1976
|
*
|
1883
1977
|
* - `timeout`: maximum time to wait for in milliseconds. Defaults to `30000`
|
1884
|
-
*
|
1885
|
-
*
|
1978
|
+
* (30 seconds). Pass `0` to disable timeout. The default value can be changed
|
1979
|
+
* by using the {@link Page.setDefaultTimeout} method.
|
1886
1980
|
*/
|
1887
1981
|
waitForSelector<Selector extends string>(selector: Selector, options?: Exclude<WaitForSelectorOptions, 'root'>): Promise<ElementHandle<NodeFor<Selector>> | null>;
|
1888
1982
|
/**
|
@@ -1892,25 +1986,27 @@ export declare class Page extends EventEmitter {
|
|
1892
1986
|
* function will throw.
|
1893
1987
|
*
|
1894
1988
|
* This method works across navigation
|
1989
|
+
*
|
1895
1990
|
* ```ts
|
1896
1991
|
* const puppeteer = require('puppeteer');
|
1897
1992
|
* (async () => {
|
1898
|
-
*
|
1899
|
-
*
|
1900
|
-
*
|
1901
|
-
*
|
1902
|
-
*
|
1903
|
-
*
|
1904
|
-
*
|
1905
|
-
*
|
1906
|
-
*
|
1907
|
-
*
|
1908
|
-
*
|
1909
|
-
*
|
1910
|
-
*
|
1911
|
-
*
|
1993
|
+
* const browser = await puppeteer.launch();
|
1994
|
+
* const page = await browser.newPage();
|
1995
|
+
* let currentURL;
|
1996
|
+
* page
|
1997
|
+
* .waitForXPath('//img')
|
1998
|
+
* .then(() => console.log('First URL with image: ' + currentURL));
|
1999
|
+
* for (currentURL of [
|
2000
|
+
* 'https://example.com',
|
2001
|
+
* 'https://google.com',
|
2002
|
+
* 'https://bbc.com',
|
2003
|
+
* ]) {
|
2004
|
+
* await page.goto(currentURL);
|
2005
|
+
* }
|
2006
|
+
* await browser.close();
|
1912
2007
|
* })();
|
1913
2008
|
* ```
|
2009
|
+
*
|
1914
2010
|
* @param xpath - A
|
1915
2011
|
* {@link https://developer.mozilla.org/en-US/docs/Web/XPath | xpath} of an
|
1916
2012
|
* element to wait for
|
@@ -1922,16 +2018,16 @@ export declare class Page extends EventEmitter {
|
|
1922
2018
|
* The optional Argument `options` have properties:
|
1923
2019
|
*
|
1924
2020
|
* - `visible`: A boolean to wait for element to be present in DOM and to be
|
1925
|
-
*
|
1926
|
-
*
|
2021
|
+
* visible, i.e. to not have `display: none` or `visibility: hidden` CSS
|
2022
|
+
* properties. Defaults to `false`.
|
1927
2023
|
*
|
1928
2024
|
* - `hidden`: A boolean wait for element to not be found in the DOM or to be
|
1929
|
-
*
|
1930
|
-
*
|
2025
|
+
* hidden, i.e. have `display: none` or `visibility: hidden` CSS properties.
|
2026
|
+
* Defaults to `false`.
|
1931
2027
|
*
|
1932
2028
|
* - `timeout`: A number which is maximum time to wait for in milliseconds.
|
1933
|
-
*
|
1934
|
-
*
|
2029
|
+
* Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default
|
2030
|
+
* value can be changed by using the {@link Page.setDefaultTimeout} method.
|
1935
2031
|
*/
|
1936
2032
|
waitForXPath(xpath: string, options?: {
|
1937
2033
|
visible?: boolean;
|
@@ -1947,65 +2043,68 @@ export declare class Page extends EventEmitter {
|
|
1947
2043
|
* ```ts
|
1948
2044
|
* const puppeteer = require('puppeteer');
|
1949
2045
|
* (async () => {
|
1950
|
-
*
|
1951
|
-
*
|
1952
|
-
*
|
1953
|
-
*
|
1954
|
-
*
|
1955
|
-
*
|
2046
|
+
* const browser = await puppeteer.launch();
|
2047
|
+
* const page = await browser.newPage();
|
2048
|
+
* const watchDog = page.waitForFunction('window.innerWidth < 100');
|
2049
|
+
* await page.setViewport({width: 50, height: 50});
|
2050
|
+
* await watchDog;
|
2051
|
+
* await browser.close();
|
1956
2052
|
* })();
|
1957
2053
|
* ```
|
1958
2054
|
*
|
1959
2055
|
* @example
|
1960
2056
|
* To pass arguments from node.js to the predicate of
|
1961
2057
|
* {@link Page.waitForFunction} function:
|
2058
|
+
*
|
1962
2059
|
* ```ts
|
1963
2060
|
* const selector = '.foo';
|
1964
2061
|
* await page.waitForFunction(
|
1965
|
-
*
|
1966
|
-
*
|
1967
|
-
*
|
2062
|
+
* selector => !!document.querySelector(selector),
|
2063
|
+
* {},
|
2064
|
+
* selector
|
1968
2065
|
* );
|
1969
2066
|
* ```
|
1970
2067
|
*
|
1971
2068
|
* @example
|
1972
2069
|
* The predicate of {@link Page.waitForFunction} can be asynchronous too:
|
2070
|
+
*
|
1973
2071
|
* ```ts
|
1974
2072
|
* const username = 'github-username';
|
1975
2073
|
* await page.waitForFunction(
|
1976
|
-
*
|
1977
|
-
*
|
1978
|
-
*
|
1979
|
-
*
|
1980
|
-
*
|
1981
|
-
*
|
1982
|
-
*
|
1983
|
-
*
|
1984
|
-
*
|
1985
|
-
*
|
1986
|
-
*
|
1987
|
-
*
|
1988
|
-
*
|
1989
|
-
*
|
2074
|
+
* async username => {
|
2075
|
+
* const githubResponse = await fetch(
|
2076
|
+
* `https://api.github.com/users/${username}`
|
2077
|
+
* );
|
2078
|
+
* const githubUser = await githubResponse.json();
|
2079
|
+
* // show the avatar
|
2080
|
+
* const img = document.createElement('img');
|
2081
|
+
* img.src = githubUser.avatar_url;
|
2082
|
+
* // wait 3 seconds
|
2083
|
+
* await new Promise((resolve, reject) => setTimeout(resolve, 3000));
|
2084
|
+
* img.remove();
|
2085
|
+
* },
|
2086
|
+
* {},
|
2087
|
+
* username
|
1990
2088
|
* );
|
1991
2089
|
* ```
|
1992
2090
|
*
|
1993
2091
|
* @param pageFunction - Function to be evaluated in browser context
|
1994
2092
|
* @param options - Optional waiting parameters
|
2093
|
+
*
|
1995
2094
|
* - `polling` - An interval at which the `pageFunction` is executed, defaults
|
1996
2095
|
* to `raf`. If `polling` is a number, then it is treated as an interval in
|
1997
2096
|
* milliseconds at which the function would be executed. If polling is a
|
1998
2097
|
* string, then it can be one of the following values:
|
1999
|
-
*
|
2000
|
-
*
|
2001
|
-
*
|
2002
|
-
*
|
2098
|
+
* - `raf` - to constantly execute `pageFunction` in
|
2099
|
+
* `requestAnimationFrame` callback. This is the tightest polling mode
|
2100
|
+
* which is suitable to observe styling changes.
|
2101
|
+
* - `mutation`- to execute pageFunction on every DOM mutation.
|
2003
2102
|
* - `timeout` - maximum time to wait for in milliseconds. Defaults to `30000`
|
2004
2103
|
* (30 seconds). Pass `0` to disable timeout. The default value can be
|
2005
2104
|
* changed by using the {@link Page.setDefaultTimeout} method.
|
2006
|
-
*
|
2007
|
-
*
|
2008
|
-
*
|
2105
|
+
* @param args - Arguments to pass to `pageFunction`
|
2106
|
+
* @returns A `Promise` which resolves to a JSHandle/ElementHandle of the the
|
2107
|
+
* `pageFunction`'s return value.
|
2009
2108
|
*/
|
2010
2109
|
waitForFunction<Params extends unknown[], Func extends EvaluateFunc<Params> = EvaluateFunc<Params>>(pageFunction: Func | string, options?: {
|
2011
2110
|
timeout?: number;
|