puppeteer-core
Advanced tools
Comparing version 13.5.0 to 13.5.1
@@ -39,2 +39,3 @@ /** | ||
FrameDetached: symbol; | ||
FrameSwapped: symbol; | ||
LifecycleEvent: symbol; | ||
@@ -41,0 +42,0 @@ FrameNavigatedWithinDocument: symbol; |
@@ -39,2 +39,3 @@ "use strict"; | ||
FrameDetached: Symbol('FrameManager.FrameDetached'), | ||
FrameSwapped: Symbol('FrameManager.FrameSwapped'), | ||
LifecycleEvent: Symbol('FrameManager.LifecycleEvent'), | ||
@@ -317,2 +318,5 @@ FrameNavigatedWithinDocument: Symbol('FrameManager.FrameNavigatedWithinDocument'), | ||
} | ||
else if (reason === 'swap') { | ||
this.emit(exports.FrameManagerEmittedEvents.FrameSwapped, frame); | ||
} | ||
} | ||
@@ -319,0 +323,0 @@ _onExecutionContextCreated(contextPayload, session) { |
@@ -52,2 +52,3 @@ /** | ||
_hasSameDocumentNavigation?: boolean; | ||
_swapped?: boolean; | ||
constructor(frameManager: FrameManager, frame: Frame, waitUntil: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[], timeout: number); | ||
@@ -64,2 +65,3 @@ _onRequest(request: HTTPRequest): void; | ||
_navigatedWithinDocument(frame: Frame): void; | ||
_frameSwapped(frame: Frame): void; | ||
_checkLifecycleComplete(): void; | ||
@@ -66,0 +68,0 @@ dispose(): void; |
@@ -54,2 +54,3 @@ "use strict"; | ||
helper_js_1.helper.addEventListener(this._frameManager, FrameManager_js_1.FrameManagerEmittedEvents.FrameNavigatedWithinDocument, this._navigatedWithinDocument.bind(this)), | ||
helper_js_1.helper.addEventListener(this._frameManager, FrameManager_js_1.FrameManagerEmittedEvents.FrameSwapped, this._frameSwapped.bind(this)), | ||
helper_js_1.helper.addEventListener(this._frameManager, FrameManager_js_1.FrameManagerEmittedEvents.FrameDetached, this._onFrameDetached.bind(this)), | ||
@@ -116,2 +117,8 @@ helper_js_1.helper.addEventListener(this._frameManager.networkManager(), NetworkManager_js_1.NetworkManagerEmittedEvents.Request, this._onRequest.bind(this)), | ||
} | ||
_frameSwapped(frame) { | ||
if (frame !== this._frame) | ||
return; | ||
this._swapped = true; | ||
this._checkLifecycleComplete(); | ||
} | ||
_checkLifecycleComplete() { | ||
@@ -123,4 +130,9 @@ // We expect navigation to commit. | ||
if (this._frame._loaderId === this._initialLoaderId && | ||
!this._hasSameDocumentNavigation) | ||
!this._hasSameDocumentNavigation) { | ||
if (this._swapped) { | ||
this._swapped = false; | ||
this._newDocumentNavigationCompleteCallback(); | ||
} | ||
return; | ||
} | ||
if (this._hasSameDocumentNavigation) | ||
@@ -127,0 +139,0 @@ this._sameDocumentNavigationCompleteCallback(); |
@@ -39,2 +39,3 @@ /** | ||
FrameDetached: symbol; | ||
FrameSwapped: symbol; | ||
LifecycleEvent: symbol; | ||
@@ -41,0 +42,0 @@ FrameNavigatedWithinDocument: symbol; |
@@ -36,2 +36,3 @@ /** | ||
FrameDetached: Symbol('FrameManager.FrameDetached'), | ||
FrameSwapped: Symbol('FrameManager.FrameSwapped'), | ||
LifecycleEvent: Symbol('FrameManager.LifecycleEvent'), | ||
@@ -314,2 +315,5 @@ FrameNavigatedWithinDocument: Symbol('FrameManager.FrameNavigatedWithinDocument'), | ||
} | ||
else if (reason === 'swap') { | ||
this.emit(FrameManagerEmittedEvents.FrameSwapped, frame); | ||
} | ||
} | ||
@@ -316,0 +320,0 @@ _onExecutionContextCreated(contextPayload, session) { |
@@ -52,2 +52,3 @@ /** | ||
_hasSameDocumentNavigation?: boolean; | ||
_swapped?: boolean; | ||
constructor(frameManager: FrameManager, frame: Frame, waitUntil: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[], timeout: number); | ||
@@ -64,2 +65,3 @@ _onRequest(request: HTTPRequest): void; | ||
_navigatedWithinDocument(frame: Frame): void; | ||
_frameSwapped(frame: Frame): void; | ||
_checkLifecycleComplete(): void; | ||
@@ -66,0 +68,0 @@ dispose(): void; |
@@ -51,2 +51,3 @@ /** | ||
helper.addEventListener(this._frameManager, FrameManagerEmittedEvents.FrameNavigatedWithinDocument, this._navigatedWithinDocument.bind(this)), | ||
helper.addEventListener(this._frameManager, FrameManagerEmittedEvents.FrameSwapped, this._frameSwapped.bind(this)), | ||
helper.addEventListener(this._frameManager, FrameManagerEmittedEvents.FrameDetached, this._onFrameDetached.bind(this)), | ||
@@ -113,2 +114,8 @@ helper.addEventListener(this._frameManager.networkManager(), NetworkManagerEmittedEvents.Request, this._onRequest.bind(this)), | ||
} | ||
_frameSwapped(frame) { | ||
if (frame !== this._frame) | ||
return; | ||
this._swapped = true; | ||
this._checkLifecycleComplete(); | ||
} | ||
_checkLifecycleComplete() { | ||
@@ -120,4 +127,9 @@ // We expect navigation to commit. | ||
if (this._frame._loaderId === this._initialLoaderId && | ||
!this._hasSameDocumentNavigation) | ||
!this._hasSameDocumentNavigation) { | ||
if (this._swapped) { | ||
this._swapped = false; | ||
this._newDocumentNavigationCompleteCallback(); | ||
} | ||
return; | ||
} | ||
if (this._hasSameDocumentNavigation) | ||
@@ -124,0 +136,0 @@ this._sameDocumentNavigationCompleteCallback(); |
{ | ||
"name": "puppeteer-core", | ||
"version": "13.5.0", | ||
"version": "13.5.1", | ||
"description": "A high-level API to control headless Chrome over the DevTools Protocol", | ||
"keywords": [ | ||
"puppeteer", | ||
"chrome", | ||
"headless", | ||
"automation" | ||
], | ||
"main": "./cjs-entry-core.js", | ||
@@ -89,4 +95,4 @@ "types": "lib/types.d.ts", | ||
"@types/ws": "8.5.2", | ||
"@typescript-eslint/eslint-plugin": "5.12.1", | ||
"@typescript-eslint/parser": "5.12.1", | ||
"@typescript-eslint/eslint-plugin": "5.14.0", | ||
"@typescript-eslint/parser": "5.14.0", | ||
"@web/test-runner": "0.13.27", | ||
@@ -93,0 +99,0 @@ "commonmark": "0.30.0", |
@@ -11,3 +11,3 @@ # Puppeteer | ||
###### [API](https://github.com/puppeteer/puppeteer/blob/v13.5.0/docs/api.md) | [FAQ](#faq) | [Contributing](https://github.com/puppeteer/puppeteer/blob/main/CONTRIBUTING.md) | [Troubleshooting](https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md) | ||
###### [API](https://github.com/puppeteer/puppeteer/blob/v13.5.1/docs/api.md) | [FAQ](#faq) | [Contributing](https://github.com/puppeteer/puppeteer/blob/main/CONTRIBUTING.md) | [Troubleshooting](https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md) | ||
@@ -43,3 +43,3 @@ > Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the [DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/). Puppeteer runs [headless](https://developers.google.com/web/updates/2017/04/headless-chrome) by default, but can be configured to run full (non-headless) Chrome or Chromium. | ||
Note: When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win) that is guaranteed to work with the API. To skip the download, download into another path, or download a different browser, see [Environment variables](https://github.com/puppeteer/puppeteer/blob/v13.5.0/docs/api.md#environment-variables). | ||
Note: When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win) that is guaranteed to work with the API. To skip the download, download into another path, or download a different browser, see [Environment variables](https://github.com/puppeteer/puppeteer/blob/v13.5.1/docs/api.md#environment-variables). | ||
@@ -69,3 +69,3 @@ ### puppeteer-core | ||
Puppeteer will be familiar to people using other browser testing frameworks. You create an instance | ||
of `Browser`, open pages, and then manipulate them with [Puppeteer's API](https://github.com/puppeteer/puppeteer/blob/v13.5.0/docs/api.md#). | ||
of `Browser`, open pages, and then manipulate them with [Puppeteer's API](https://github.com/puppeteer/puppeteer/blob/v13.5.1/docs/api.md#). | ||
@@ -95,3 +95,3 @@ **Example** - navigating to https://example.com and saving a screenshot as _example.png_: | ||
Puppeteer sets an initial page size to 800×600px, which defines the screenshot size. The page size can be customized with [`Page.setViewport()`](https://github.com/puppeteer/puppeteer/blob/v13.5.0/docs/api.md#pagesetviewportviewport). | ||
Puppeteer sets an initial page size to 800×600px, which defines the screenshot size. The page size can be customized with [`Page.setViewport()`](https://github.com/puppeteer/puppeteer/blob/v13.5.1/docs/api.md#pagesetviewportviewport). | ||
@@ -123,3 +123,3 @@ **Example** - create a PDF. | ||
See [`Page.pdf()`](https://github.com/puppeteer/puppeteer/blob/v13.5.0/docs/api.md#pagepdfoptions) for more information about creating pdfs. | ||
See [`Page.pdf()`](https://github.com/puppeteer/puppeteer/blob/v13.5.1/docs/api.md#pagepdfoptions) for more information about creating pdfs. | ||
@@ -159,3 +159,3 @@ **Example** - evaluate script in the context of the page | ||
See [`Page.evaluate()`](https://github.com/puppeteer/puppeteer/blob/v13.5.0/docs/api.md#pageevaluatepagefunction-args) for more information on `evaluate` and related methods like `evaluateOnNewDocument` and `exposeFunction`. | ||
See [`Page.evaluate()`](https://github.com/puppeteer/puppeteer/blob/v13.5.1/docs/api.md#pageevaluatepagefunction-args) for more information on `evaluate` and related methods like `evaluateOnNewDocument` and `exposeFunction`. | ||
@@ -170,3 +170,3 @@ <!-- [END getstarted] --> | ||
Puppeteer launches Chromium in [headless mode](https://developers.google.com/web/updates/2017/04/headless-chrome). To launch a full version of Chromium, set the [`headless` option](https://github.com/puppeteer/puppeteer/blob/v13.5.0/docs/api.md#puppeteerlaunchoptions) when launching a browser: | ||
Puppeteer launches Chromium in [headless mode](https://developers.google.com/web/updates/2017/04/headless-chrome). To launch a full version of Chromium, set the [`headless` option](https://github.com/puppeteer/puppeteer/blob/v13.5.1/docs/api.md#puppeteerlaunchoptions) when launching a browser: | ||
@@ -187,3 +187,3 @@ ```js | ||
You can also use Puppeteer with Firefox Nightly (experimental support). See [`Puppeteer.launch()`](https://github.com/puppeteer/puppeteer/blob/v13.5.0/docs/api.md#puppeteerlaunchoptions) for more information. | ||
You can also use Puppeteer with Firefox Nightly (experimental support). See [`Puppeteer.launch()`](https://github.com/puppeteer/puppeteer/blob/v13.5.1/docs/api.md#puppeteerlaunchoptions) for more information. | ||
@@ -200,3 +200,3 @@ See [`this article`](https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for a description of the differences between Chromium and Chrome. [`This article`](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/chromium_browser_vs_google_chrome.md) describes some differences for Linux users. | ||
- [API Documentation](https://github.com/puppeteer/puppeteer/blob/v13.5.0/docs/api.md) | ||
- [API Documentation](https://github.com/puppeteer/puppeteer/blob/v13.5.1/docs/api.md) | ||
- [Examples](https://github.com/puppeteer/puppeteer/tree/main/examples/) | ||
@@ -343,3 +343,3 @@ - [Community list of Puppeteer resources](https://github.com/transitive-bullshit/awesome-puppeteer) | ||
From Puppeteer v2.1.0 onwards you can specify [`puppeteer.launch({product: 'firefox'})`](https://github.com/puppeteer/puppeteer/blob/v13.5.0/docs/api.md#puppeteerlaunchoptions) to run your Puppeteer scripts in Firefox Nightly, without any additional custom patches. While [an older experiment](https://www.npmjs.com/package/puppeteer-firefox) required a patched version of Firefox, [the current approach](https://wiki.mozilla.org/Remote) works with “stock” Firefox. | ||
From Puppeteer v2.1.0 onwards you can specify [`puppeteer.launch({product: 'firefox'})`](https://github.com/puppeteer/puppeteer/blob/v13.5.1/docs/api.md#puppeteerlaunchoptions) to run your Puppeteer scripts in Firefox Nightly, without any additional custom patches. While [an older experiment](https://www.npmjs.com/package/puppeteer-firefox) required a patched version of Firefox, [the current approach](https://wiki.mozilla.org/Remote) works with “stock” Firefox. | ||
@@ -447,3 +447,3 @@ We will continue to collaborate with other browser vendors to bring Puppeteer support to browsers such as Safari. | ||
- Puppeteer is bundled with Chromium — not Chrome — and so by default, it inherits all of [Chromium's media-related limitations](https://www.chromium.org/audio-video). This means that Puppeteer does not support licensed formats such as AAC or H.264. (However, it is possible to force Puppeteer to use a separately-installed version Chrome instead of Chromium via the [`executablePath` option to `puppeteer.launch`](https://github.com/puppeteer/puppeteer/blob/v13.5.0/docs/api.md#puppeteerlaunchoptions). You should only use this configuration if you need an official release of Chrome that supports these media formats.) | ||
- Puppeteer is bundled with Chromium — not Chrome — and so by default, it inherits all of [Chromium's media-related limitations](https://www.chromium.org/audio-video). This means that Puppeteer does not support licensed formats such as AAC or H.264. (However, it is possible to force Puppeteer to use a separately-installed version Chrome instead of Chromium via the [`executablePath` option to `puppeteer.launch`](https://github.com/puppeteer/puppeteer/blob/v13.5.1/docs/api.md#puppeteerlaunchoptions). You should only use this configuration if you need an official release of Chrome that supports these media formats.) | ||
- Since Puppeteer (in all configurations) controls a desktop version of Chromium/Chrome, features that are only supported by the mobile version of Chrome are not supported. This means that Puppeteer [does not support HTTP Live Streaming (HLS)](https://caniuse.com/#feat=http-live-streaming). | ||
@@ -450,0 +450,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2971838
54313