docs: fix warnings, remove node 14, sort files (#10846)

This commit is contained in:
Nikolay Vitkov 2023-09-05 10:41:21 +02:00 committed by GitHub
parent 7ac04eb2e5
commit 0ab6f76945
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 22 additions and 28 deletions

View File

@ -182,21 +182,6 @@ const browser = await puppeteer.launch({
});
```
## Chrome is downloaded but fails to launch on Node.js 14
If you get an error that looks like this when trying to launch Chromium:
```
(node:15505) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
spawn /Users/.../node_modules/puppeteer/.local-chromium/mac-756035/chrome-mac/Chromium.app/Contents/MacOS/Chromium ENOENT
```
This means that the browser was downloaded but failed to be extracted correctly.
The most common cause is a bug in Node.js v14.0.0 which broke `extract-zip`, the
module Puppeteer uses to extract browser downloads into the right place. The bug
was fixed in Node.js v14.1.0, so please make sure you're running that version or
higher.
## Setting Up Chrome Linux Sandbox
In order to protect the host environment from untrusted web content, Chrome uses

View File

@ -103,6 +103,9 @@ export interface InstallOptions {
export function install(
options: InstallOptions & {unpack?: true}
): Promise<InstalledBrowser>;
/**
* @public
*/
export function install(
options: InstallOptions & {unpack: false}
): Promise<string>;

View File

@ -17,12 +17,14 @@
export * from './Browser.js';
export * from './BrowserContext.js';
export * from './Dialog.js';
export * from './Page.js';
export * from './JSHandle.js';
export * from './ElementHandle.js';
export * from './Input.js';
export * from './Environment.js';
export * from './Frame.js';
export * from './HTTPResponse.js';
export * from './HTTPRequest.js';
export * from './HTTPResponse.js';
export * from './Input.js';
export * from './JSHandle.js';
export * from './locators/locators.js';
export * from './Page.js';
export * from './Realm.js';
export * from './Target.js';

View File

@ -14,10 +14,14 @@
* limitations under the License.
*/
/**
* Order of exports matters
* Don't sort
*/
export * from './Locator.js';
export * from './NodeLocator.js';
export * from './FilteredLocator.js';
export * from './RaceLocator.js';
export * from './DelegatedLocator.js';
export * from './MappedLocator.js';
export * from './FilteredLocator.js';
export * from './FunctionLocator.js';
export * from './MappedLocator.js';
export * from './NodeLocator.js';
export * from './RaceLocator.js';

View File

@ -54,7 +54,7 @@ const getSourceUrlComment = (url: string) => {
*
* - Each {@link Frame} of a {@link Page | page} has a "default" execution
* context that is always created after frame is attached to DOM. This context
* is returned by the {@link Frame.executionContext} method.
* is returned by the {@link Frame.realm} method.
* - Each {@link https://developer.chrome.com/extensions | Chrome extensions}
* creates additional execution contexts to isolate their code.
*

View File

@ -69,7 +69,7 @@ export const NetworkManagerEmittedEvents = {
/**
* @internal
*/
interface FrameProvider {
export interface FrameProvider {
frame(id: string): Frame | null;
}

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
export * from './BidiOverCDP.js';
export * from './Browser.js';
export * from './BrowserContext.js';
export * from './Page.js';
export * from './Connection.js';
export * from './BidiOverCDP.js';
export * from './Page.js';

View File

@ -56,6 +56,7 @@ export * from './PredefinedNetworkConditions.js';
export * from './Product.js';
export * from './Puppeteer.js';
export * from './PuppeteerViewport.js';
export * from './QueryHandler.js';
export * from './SecurityDetails.js';
export * from './Target.js';
export * from './TargetManager.js';
@ -67,4 +68,3 @@ export * from './USKeyboardLayout.js';
export * from './util.js';
export * from './WaitTask.js';
export * from './WebWorker.js';
export * from './QueryHandler.js';