mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat!: drop support for node16 (#10912)
This commit is contained in:
parent
e04016a4a0
commit
953f4207b1
8
package-lock.json
generated
8
package-lock.json
generated
@ -10893,7 +10893,7 @@
|
||||
"@types/yargs": "17.0.32"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.3.0"
|
||||
"node": ">=18.17.1"
|
||||
}
|
||||
},
|
||||
"packages/browsers/node_modules/cliui": {
|
||||
@ -10945,7 +10945,7 @@
|
||||
"@schematics/angular": "^17.0.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.13.2"
|
||||
"node": ">=18.17.1"
|
||||
}
|
||||
},
|
||||
"packages/ng-schematics/node_modules/@angular-devkit/architect": {
|
||||
@ -11382,7 +11382,7 @@
|
||||
"@types/node": "18.17.15"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.13.2"
|
||||
"node": ">=18.17.1"
|
||||
}
|
||||
},
|
||||
"packages/puppeteer-core": {
|
||||
@ -11405,7 +11405,7 @@
|
||||
"rxjs": "7.8.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.13.2"
|
||||
"node": ">=18.17.1"
|
||||
}
|
||||
},
|
||||
"packages/puppeteer-core/node_modules/@types/node": {
|
||||
|
@ -87,7 +87,7 @@
|
||||
"author": "The Chromium Authors",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=16.3.0"
|
||||
"node": ">=18"
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
|
@ -48,7 +48,7 @@
|
||||
"author": "The Chromium Authors",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=16.13.2"
|
||||
"node": ">=18"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular-devkit/architect": "^0.1701.1",
|
||||
|
@ -31,7 +31,7 @@
|
||||
"url": "https://github.com/puppeteer/puppeteer/tree/main/packages/puppeteer-core"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.13.2"
|
||||
"node": ">=18"
|
||||
},
|
||||
"scripts": {
|
||||
"build:docs": "wireit",
|
||||
|
@ -14,7 +14,6 @@ import {isErrorLike} from '../util/ErrorLike.js';
|
||||
import type {ConnectionTransport} from './ConnectionTransport.js';
|
||||
import type {ConnectOptions} from './ConnectOptions.js';
|
||||
import type {BrowserConnectOptions} from './ConnectOptions.js';
|
||||
import {getFetch} from './fetch.js';
|
||||
|
||||
const getWebSocketTransportClass = async () => {
|
||||
return isNode
|
||||
@ -93,9 +92,8 @@ async function getConnectionTransport(
|
||||
async function getWSEndpoint(browserURL: string): Promise<string> {
|
||||
const endpointURL = new URL('/json/version', browserURL);
|
||||
|
||||
const fetch = await getFetch();
|
||||
try {
|
||||
const result = await fetch(endpointURL.toString(), {
|
||||
const result = await globalThis.fetch(endpointURL.toString(), {
|
||||
method: 'GET',
|
||||
});
|
||||
if (!result.ok) {
|
||||
|
@ -15,7 +15,6 @@ export * from './Debug.js';
|
||||
export * from './Device.js';
|
||||
export * from './Errors.js';
|
||||
export * from './EventEmitter.js';
|
||||
export * from './fetch.js';
|
||||
export * from './FileChooser.js';
|
||||
export * from './GetQueryHandler.js';
|
||||
export * from './HandleIterator.js';
|
||||
|
@ -1,14 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Gets the global version if we're in the browser, else loads the node-fetch module.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export const getFetch = async (): Promise<typeof fetch> => {
|
||||
return (globalThis as any).fetch || (await import('cross-fetch')).fetch;
|
||||
};
|
@ -32,7 +32,7 @@
|
||||
"url": "https://github.com/puppeteer/puppeteer/tree/main/packages/puppeteer"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.13.2"
|
||||
"node": ">=18"
|
||||
},
|
||||
"scripts": {
|
||||
"build:docs": "wireit",
|
||||
|
Loading…
Reference in New Issue
Block a user