first commit
This commit is contained in:
257
node_modules/puppeteer/README.md
generated
vendored
Normal file
257
node_modules/puppeteer/README.md
generated
vendored
Normal file
@@ -0,0 +1,257 @@
|
||||
# Puppeteer
|
||||
|
||||
[](https://github.com/puppeteer/puppeteer/actions?query=workflow%3ACI)
|
||||
[](https://npmjs.org/package/puppeteer)
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/10379601/29446482-04f7036a-841f-11e7-9872-91d1fc2ea683.png" height="200" align="right"/>
|
||||
|
||||
#### [Guides](https://pptr.dev/category/guides) | [API](https://pptr.dev/api) | [FAQ](https://pptr.dev/faq) | [Contributing](https://pptr.dev/contributing) | [Troubleshooting](https://pptr.dev/troubleshooting)
|
||||
|
||||
> Puppeteer is a Node.js library which provides a high-level API to control
|
||||
> Chrome/Chromium over the
|
||||
> [DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/).
|
||||
> Puppeteer runs in
|
||||
> [headless](https://developer.chrome.com/articles/new-headless/)
|
||||
> mode by default, but can be configured to run in full ("headful")
|
||||
> Chrome/Chromium.
|
||||
|
||||
#### What can I do?
|
||||
|
||||
Most things that you can do manually in the browser can be done using Puppeteer!
|
||||
Here are a few examples to get you started:
|
||||
|
||||
- Generate screenshots and PDFs of pages.
|
||||
- Crawl a SPA (Single-Page Application) and generate pre-rendered content (i.e.
|
||||
"SSR" (Server-Side Rendering)).
|
||||
- Automate form submission, UI testing, keyboard input, etc.
|
||||
- Create an automated testing environment using the latest JavaScript and
|
||||
browser features.
|
||||
- Capture a
|
||||
[timeline trace](https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/reference)
|
||||
of your site to help diagnose performance issues.
|
||||
- [Test Chrome Extensions](https://pptr.dev/guides/chrome-extensions).
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Installation
|
||||
|
||||
To use Puppeteer in your project, run:
|
||||
|
||||
```bash
|
||||
npm i puppeteer
|
||||
# or using yarn
|
||||
yarn add puppeteer
|
||||
# or using pnpm
|
||||
pnpm i puppeteer
|
||||
```
|
||||
|
||||
When you install Puppeteer, it automatically downloads a recent version of
|
||||
[Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) (~170MB macOS, ~282MB Linux, ~280MB Windows) and a `chrome-headless-shell` binary (starting with Puppeteer v21.6.0) that is [guaranteed to
|
||||
work](https://pptr.dev/faq#q-why-doesnt-puppeteer-vxxx-work-with-chromium-vyyy)
|
||||
with Puppeteer. The browser is downloaded to the `$HOME/.cache/puppeteer` folder
|
||||
by default (starting with Puppeteer v19.0.0). See [configuration](https://pptr.dev/api/puppeteer.configuration) for configuration options and environmental variables to control the download behavor.
|
||||
|
||||
If you deploy a project using Puppeteer to a hosting provider, such as Render or
|
||||
Heroku, you might need to reconfigure the location of the cache to be within
|
||||
your project folder (see an example below) because not all hosting providers
|
||||
include `$HOME/.cache` into the project's deployment.
|
||||
|
||||
For a version of Puppeteer without the browser installation, see
|
||||
[`puppeteer-core`](#puppeteer-core).
|
||||
|
||||
If used with TypeScript, the minimum supported TypeScript version is `4.7.4`.
|
||||
|
||||
#### Configuration
|
||||
|
||||
Puppeteer uses several defaults that can be customized through configuration
|
||||
files.
|
||||
|
||||
For example, to change the default cache directory Puppeteer uses to install
|
||||
browsers, you can add a `.puppeteerrc.cjs` (or `puppeteer.config.cjs`) at the
|
||||
root of your application with the contents
|
||||
|
||||
```js
|
||||
const {join} = require('path');
|
||||
|
||||
/**
|
||||
* @type {import("puppeteer").Configuration}
|
||||
*/
|
||||
module.exports = {
|
||||
// Changes the cache location for Puppeteer.
|
||||
cacheDirectory: join(__dirname, '.cache', 'puppeteer'),
|
||||
};
|
||||
```
|
||||
|
||||
After adding the configuration file, you will need to remove and reinstall
|
||||
`puppeteer` for it to take effect.
|
||||
|
||||
See the [configuration guide](https://pptr.dev/guides/configuration) for more
|
||||
information.
|
||||
|
||||
#### `puppeteer-core`
|
||||
|
||||
For every release since v1.7.0 we publish two packages:
|
||||
|
||||
- [`puppeteer`](https://www.npmjs.com/package/puppeteer)
|
||||
- [`puppeteer-core`](https://www.npmjs.com/package/puppeteer-core)
|
||||
|
||||
`puppeteer` is a _product_ for browser automation. When installed, it downloads
|
||||
a version of Chrome, which it then drives using `puppeteer-core`. Being an
|
||||
end-user product, `puppeteer` automates several workflows using reasonable
|
||||
defaults [that can be customized](https://pptr.dev/guides/configuration).
|
||||
|
||||
`puppeteer-core` is a _library_ to help drive anything that supports DevTools
|
||||
protocol. Being a library, `puppeteer-core` is fully driven through its
|
||||
programmatic interface implying no defaults are assumed and `puppeteer-core`
|
||||
will not download Chrome when installed.
|
||||
|
||||
You should use `puppeteer-core` if you are
|
||||
[connecting to a remote browser](https://pptr.dev/api/puppeteer.puppeteer.connect)
|
||||
or [managing browsers yourself](https://pptr.dev/browsers-api/).
|
||||
If you are managing browsers yourself, you will need to call
|
||||
[`puppeteer.launch`](https://pptr.dev/api/puppeteer.puppeteernode.launch) with
|
||||
an explicit
|
||||
[`executablePath`](https://pptr.dev/api/puppeteer.launchoptions)
|
||||
(or [`channel`](https://pptr.dev/api/puppeteer.launchoptions) if it's
|
||||
installed in a standard location).
|
||||
|
||||
When using `puppeteer-core`, remember to change the import:
|
||||
|
||||
```ts
|
||||
import puppeteer from 'puppeteer-core';
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
Puppeteer follows the latest
|
||||
[maintenance LTS](https://github.com/nodejs/Release#release-schedule) version of
|
||||
Node.
|
||||
|
||||
Puppeteer will be familiar to people using other browser testing frameworks. You
|
||||
[launch](https://pptr.dev/api/puppeteer.puppeteernode.launch)/[connect](https://pptr.dev/api/puppeteer.puppeteernode.connect)
|
||||
a [browser](https://pptr.dev/api/puppeteer.browser),
|
||||
[create](https://pptr.dev/api/puppeteer.browser.newpage) some
|
||||
[pages](https://pptr.dev/api/puppeteer.page), and then manipulate them with
|
||||
[Puppeteer's API](https://pptr.dev/api).
|
||||
|
||||
For more in-depth usage, check our [guides](https://pptr.dev/category/guides)
|
||||
and [examples](https://github.com/puppeteer/puppeteer/tree/main/examples).
|
||||
|
||||
#### Example
|
||||
|
||||
The following example searches [developer.chrome.com](https://developer.chrome.com/) for blog posts with text "automate beyond recorder", click on the first result and print the full title of the blog post.
|
||||
|
||||
```ts
|
||||
import puppeteer from 'puppeteer';
|
||||
|
||||
(async () => {
|
||||
// Launch the browser and open a new blank page
|
||||
const browser = await puppeteer.launch();
|
||||
const page = await browser.newPage();
|
||||
|
||||
// Navigate the page to a URL
|
||||
await page.goto('https://developer.chrome.com/');
|
||||
|
||||
// Set screen size
|
||||
await page.setViewport({width: 1080, height: 1024});
|
||||
|
||||
// Type into search box
|
||||
await page.type('.devsite-search-field', 'automate beyond recorder');
|
||||
|
||||
// Wait and click on first result
|
||||
const searchResultSelector = '.devsite-result-item-link';
|
||||
await page.waitForSelector(searchResultSelector);
|
||||
await page.click(searchResultSelector);
|
||||
|
||||
// Locate the full title with a unique string
|
||||
const textSelector = await page.waitForSelector(
|
||||
'text/Customize and automate'
|
||||
);
|
||||
const fullTitle = await textSelector?.evaluate(el => el.textContent);
|
||||
|
||||
// Print the full title
|
||||
console.log('The title of this blog post is "%s".', fullTitle);
|
||||
|
||||
await browser.close();
|
||||
})();
|
||||
```
|
||||
|
||||
### Default runtime settings
|
||||
|
||||
**1. Uses Headless mode**
|
||||
|
||||
By default Puppeteer launches Chrome in
|
||||
[old Headless mode](https://developer.chrome.com/articles/new-headless/).
|
||||
|
||||
```ts
|
||||
const browser = await puppeteer.launch();
|
||||
// Equivalent to
|
||||
const browser = await puppeteer.launch({headless: true});
|
||||
```
|
||||
|
||||
[Chrome 112 launched a new Headless mode](https://developer.chrome.com/articles/new-headless/) that might cause some differences in behavior compared to the old Headless implementation.
|
||||
In the future Puppeteer will start defaulting to new implementation.
|
||||
We recommend you try it out before the switch:
|
||||
|
||||
```ts
|
||||
const browser = await puppeteer.launch({headless: 'new'});
|
||||
```
|
||||
|
||||
To launch a "headful" version of Chrome, set the
|
||||
[`headless`](https://pptr.dev/api/puppeteer.browserlaunchargumentoptions) to `false`
|
||||
option when launching a browser:
|
||||
|
||||
```ts
|
||||
const browser = await puppeteer.launch({headless: false});
|
||||
```
|
||||
|
||||
**2. Runs a bundled version of Chrome**
|
||||
|
||||
By default, Puppeteer downloads and uses a specific version of Chrome so its
|
||||
API is guaranteed to work out of the box. To use Puppeteer with a different
|
||||
version of Chrome or Chromium, pass in the executable's path when creating a
|
||||
`Browser` instance:
|
||||
|
||||
```ts
|
||||
const browser = await puppeteer.launch({executablePath: '/path/to/Chrome'});
|
||||
```
|
||||
|
||||
You can also use Puppeteer with Firefox. See
|
||||
[status of cross-browser support](https://pptr.dev/faq/#q-what-is-the-status-of-cross-browser-support) for
|
||||
more information.
|
||||
|
||||
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.
|
||||
|
||||
**3. Creates a fresh user profile**
|
||||
|
||||
Puppeteer creates its own browser user profile which it **cleans up on every
|
||||
run**.
|
||||
|
||||
#### Using Docker
|
||||
|
||||
See our [Docker guide](https://pptr.dev/guides/docker).
|
||||
|
||||
#### Using Chrome Extensions
|
||||
|
||||
See our [Chrome extensions guide](https://pptr.dev/guides/chrome-extensions).
|
||||
|
||||
## Resources
|
||||
|
||||
- [API Documentation](https://pptr.dev/api)
|
||||
- [Guides](https://pptr.dev/category/guides)
|
||||
- [Examples](https://github.com/puppeteer/puppeteer/tree/main/examples)
|
||||
- [Community list of Puppeteer resources](https://github.com/transitive-bullshit/awesome-puppeteer)
|
||||
|
||||
## Contributing
|
||||
|
||||
Check out our [contributing guide](https://pptr.dev/contributing) to get an
|
||||
overview of Puppeteer development.
|
||||
|
||||
## FAQ
|
||||
|
||||
Our [FAQ](https://pptr.dev/faq) has migrated to
|
||||
[our site](https://pptr.dev/faq).
|
||||
35
node_modules/puppeteer/install.mjs
generated
vendored
Executable file
35
node_modules/puppeteer/install.mjs
generated
vendored
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file is part of public API.
|
||||
*
|
||||
* By default, the `puppeteer` package runs this script during the installation
|
||||
* process unless one of the env flags is provided.
|
||||
* `puppeteer-core` package doesn't include this step at all. However, it's
|
||||
* still possible to install a supported browser using this script when
|
||||
* necessary.
|
||||
*/
|
||||
|
||||
async function importInstaller() {
|
||||
try {
|
||||
return await import('puppeteer/internal/node/install.js');
|
||||
} catch {
|
||||
console.warn(
|
||||
'Skipping browser installation because the Puppeteer build is not available. Run `npm install` again after you have re-built Puppeteer.'
|
||||
);
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const {downloadBrowser} = await importInstaller();
|
||||
downloadBrowser();
|
||||
} catch (error) {
|
||||
console.warn('Browser download failed', error);
|
||||
}
|
||||
11
node_modules/puppeteer/lib/cjs/puppeteer/getConfiguration.d.ts
generated
vendored
Normal file
11
node_modules/puppeteer/lib/cjs/puppeteer/getConfiguration.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import type { Configuration } from 'puppeteer-core';
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const getConfiguration: () => Configuration;
|
||||
//# sourceMappingURL=getConfiguration.d.ts.map
|
||||
1
node_modules/puppeteer/lib/cjs/puppeteer/getConfiguration.d.ts.map
generated
vendored
Normal file
1
node_modules/puppeteer/lib/cjs/puppeteer/getConfiguration.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"getConfiguration.d.ts","sourceRoot":"","sources":["../../../src/getConfiguration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAC,aAAa,EAAU,MAAM,gBAAgB,CAAC;AA+B3D;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,aA+GnC,CAAC"}
|
||||
126
node_modules/puppeteer/lib/cjs/puppeteer/getConfiguration.js
generated
vendored
Normal file
126
node_modules/puppeteer/lib/cjs/puppeteer/getConfiguration.js
generated
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getConfiguration = void 0;
|
||||
const os_1 = require("os");
|
||||
const path_1 = require("path");
|
||||
const cosmiconfig_1 = require("cosmiconfig");
|
||||
function getBooleanEnvVar(name) {
|
||||
const env = process.env[name];
|
||||
if (env === undefined) {
|
||||
return;
|
||||
}
|
||||
switch (env.toLowerCase()) {
|
||||
case '':
|
||||
case '0':
|
||||
case 'false':
|
||||
case 'off':
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
function isSupportedProduct(product) {
|
||||
switch (product) {
|
||||
case 'chrome':
|
||||
case 'firefox':
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
const getConfiguration = () => {
|
||||
const result = (0, cosmiconfig_1.cosmiconfigSync)('puppeteer', {
|
||||
searchStrategy: 'global',
|
||||
}).search();
|
||||
const configuration = result ? result.config : {};
|
||||
configuration.logLevel = (process.env['PUPPETEER_LOGLEVEL'] ??
|
||||
process.env['npm_config_LOGLEVEL'] ??
|
||||
process.env['npm_package_config_LOGLEVEL'] ??
|
||||
configuration.logLevel ??
|
||||
'warn');
|
||||
// Merging environment variables.
|
||||
configuration.defaultProduct = (process.env['PUPPETEER_PRODUCT'] ??
|
||||
process.env['npm_config_puppeteer_product'] ??
|
||||
process.env['npm_package_config_puppeteer_product'] ??
|
||||
configuration.defaultProduct ??
|
||||
'chrome');
|
||||
configuration.executablePath =
|
||||
process.env['PUPPETEER_EXECUTABLE_PATH'] ??
|
||||
process.env['npm_config_puppeteer_executable_path'] ??
|
||||
process.env['npm_package_config_puppeteer_executable_path'] ??
|
||||
configuration.executablePath;
|
||||
// Default to skipDownload if executablePath is set
|
||||
if (configuration.executablePath) {
|
||||
configuration.skipDownload = true;
|
||||
}
|
||||
// Set skipDownload explicitly or from default
|
||||
configuration.skipDownload = Boolean(getBooleanEnvVar('PUPPETEER_SKIP_DOWNLOAD') ??
|
||||
getBooleanEnvVar('npm_config_puppeteer_skip_download') ??
|
||||
getBooleanEnvVar('npm_package_config_puppeteer_skip_download') ??
|
||||
configuration.skipDownload);
|
||||
// Set skipChromeDownload explicitly or from default
|
||||
configuration.skipChromeDownload = Boolean(getBooleanEnvVar('PUPPETEER_SKIP_CHROME_DOWNLOAD') ??
|
||||
getBooleanEnvVar('npm_config_puppeteer_skip_chrome_download') ??
|
||||
getBooleanEnvVar('npm_package_config_puppeteer_skip_chrome_download') ??
|
||||
configuration.skipChromeDownload);
|
||||
// Set skipChromeDownload explicitly or from default
|
||||
configuration.skipChromeHeadlessShellDownload = Boolean(getBooleanEnvVar('PUPPETEER_SKIP_CHROME_HEADLESS_SHELL_DOWNLOAD') ??
|
||||
getBooleanEnvVar('npm_config_puppeteer_skip_chrome_headless_shell_download') ??
|
||||
getBooleanEnvVar('npm_package_config_puppeteer_skip_chrome_headless_shell_download') ??
|
||||
configuration.skipChromeHeadlessShellDownload);
|
||||
// Prepare variables used in browser downloading
|
||||
if (!configuration.skipDownload) {
|
||||
configuration.browserRevision =
|
||||
process.env['PUPPETEER_BROWSER_REVISION'] ??
|
||||
process.env['npm_config_puppeteer_browser_revision'] ??
|
||||
process.env['npm_package_config_puppeteer_browser_revision'] ??
|
||||
configuration.browserRevision;
|
||||
const downloadHost = process.env['PUPPETEER_DOWNLOAD_HOST'] ??
|
||||
process.env['npm_config_puppeteer_download_host'] ??
|
||||
process.env['npm_package_config_puppeteer_download_host'];
|
||||
if (downloadHost && configuration.logLevel === 'warn') {
|
||||
console.warn(`PUPPETEER_DOWNLOAD_HOST is deprecated. Use PUPPETEER_DOWNLOAD_BASE_URL instead.`);
|
||||
}
|
||||
configuration.downloadBaseUrl =
|
||||
process.env['PUPPETEER_DOWNLOAD_BASE_URL'] ??
|
||||
process.env['npm_config_puppeteer_download_base_url'] ??
|
||||
process.env['npm_package_config_puppeteer_download_base_url'] ??
|
||||
configuration.downloadBaseUrl ??
|
||||
downloadHost;
|
||||
configuration.downloadPath =
|
||||
process.env['PUPPETEER_DOWNLOAD_PATH'] ??
|
||||
process.env['npm_config_puppeteer_download_path'] ??
|
||||
process.env['npm_package_config_puppeteer_download_path'] ??
|
||||
configuration.downloadPath;
|
||||
}
|
||||
configuration.cacheDirectory =
|
||||
process.env['PUPPETEER_CACHE_DIR'] ??
|
||||
process.env['npm_config_puppeteer_cache_dir'] ??
|
||||
process.env['npm_package_config_puppeteer_cache_dir'] ??
|
||||
configuration.cacheDirectory ??
|
||||
(0, path_1.join)((0, os_1.homedir)(), '.cache', 'puppeteer');
|
||||
configuration.temporaryDirectory =
|
||||
process.env['PUPPETEER_TMP_DIR'] ??
|
||||
process.env['npm_config_puppeteer_tmp_dir'] ??
|
||||
process.env['npm_package_config_puppeteer_tmp_dir'] ??
|
||||
configuration.temporaryDirectory;
|
||||
configuration.experiments ??= {};
|
||||
// Validate configuration.
|
||||
if (!isSupportedProduct(configuration.defaultProduct)) {
|
||||
throw new Error(`Unsupported product ${configuration.defaultProduct}`);
|
||||
}
|
||||
return configuration;
|
||||
};
|
||||
exports.getConfiguration = getConfiguration;
|
||||
//# sourceMappingURL=getConfiguration.js.map
|
||||
1
node_modules/puppeteer/lib/cjs/puppeteer/getConfiguration.js.map
generated
vendored
Normal file
1
node_modules/puppeteer/lib/cjs/puppeteer/getConfiguration.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"getConfiguration.js","sourceRoot":"","sources":["../../../src/getConfiguration.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,2BAA2B;AAC3B,+BAA0B;AAE1B,6CAA4C;AAG5C,SAAS,gBAAgB,CAAC,IAAY;IACpC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO;IACT,CAAC;IACD,QAAQ,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC;QAC1B,KAAK,EAAE,CAAC;QACR,KAAK,GAAG,CAAC;QACT,KAAK,OAAO,CAAC;QACb,KAAK,KAAK;YACR,OAAO,KAAK,CAAC;QACf;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,OAAgB;IAC1C,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,QAAQ,CAAC;QACd,KAAK,SAAS;YACZ,OAAO,IAAI,CAAC;QACd;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC;AAED;;GAEG;AACI,MAAM,gBAAgB,GAAG,GAAkB,EAAE;IAClD,MAAM,MAAM,GAAG,IAAA,6BAAe,EAAC,WAAW,EAAE;QAC1C,cAAc,EAAE,QAAQ;KACzB,CAAC,CAAC,MAAM,EAAE,CAAC;IACZ,MAAM,aAAa,GAAkB,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAEjE,aAAa,CAAC,QAAQ,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;QAClC,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC;QAC1C,aAAa,CAAC,QAAQ;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AAC,8BAA8B,CAAC;YAC3C,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC;YACnD,aAAa,CAAC,kBAAkB,CAAC;IAEnC,aAAa,CAAC,WAAW,KAAK,EAAE,CAAC;IAEjC,0BAA0B;IAC1B,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE,CAAC;QACtD,MAAM,IAAI,KAAK,CAAC,uBAAuB,aAAa,CAAC,cAAc,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AA/GW,QAAA,gBAAgB,oBA+G3B"}
|
||||
8
node_modules/puppeteer/lib/cjs/puppeteer/node/cli.d.ts
generated
vendored
Normal file
8
node_modules/puppeteer/lib/cjs/puppeteer/node/cli.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
export {};
|
||||
//# sourceMappingURL=cli.d.ts.map
|
||||
1
node_modules/puppeteer/lib/cjs/puppeteer/node/cli.d.ts.map
generated
vendored
Normal file
1
node_modules/puppeteer/lib/cjs/puppeteer/node/cli.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../src/node/cli.ts"],"names":[],"mappings":";AAEA;;;;GAIG"}
|
||||
32
node_modules/puppeteer/lib/cjs/puppeteer/node/cli.js
generated
vendored
Executable file
32
node_modules/puppeteer/lib/cjs/puppeteer/node/cli.js
generated
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env node
|
||||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const browsers_1 = require("@puppeteer/browsers");
|
||||
const revisions_js_1 = require("puppeteer-core/internal/revisions.js");
|
||||
const puppeteer_js_1 = __importDefault(require("../puppeteer.js"));
|
||||
// TODO: deprecate downloadPath in favour of cacheDirectory.
|
||||
const cacheDir = puppeteer_js_1.default.configuration.downloadPath ??
|
||||
puppeteer_js_1.default.configuration.cacheDirectory;
|
||||
void new browsers_1.CLI({
|
||||
cachePath: cacheDir,
|
||||
scriptName: 'puppeteer',
|
||||
prefixCommand: {
|
||||
cmd: 'browsers',
|
||||
description: 'Manage browsers of this Puppeteer installation',
|
||||
},
|
||||
allowCachePathOverride: false,
|
||||
pinnedBrowsers: {
|
||||
[browsers_1.Browser.CHROME]: revisions_js_1.PUPPETEER_REVISIONS.chrome,
|
||||
[browsers_1.Browser.FIREFOX]: revisions_js_1.PUPPETEER_REVISIONS.firefox,
|
||||
[browsers_1.Browser.CHROMEHEADLESSSHELL]: revisions_js_1.PUPPETEER_REVISIONS['chrome-headless-shell'],
|
||||
},
|
||||
}).run(process.argv);
|
||||
//# sourceMappingURL=cli.js.map
|
||||
1
node_modules/puppeteer/lib/cjs/puppeteer/node/cli.js.map
generated
vendored
Normal file
1
node_modules/puppeteer/lib/cjs/puppeteer/node/cli.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../../src/node/cli.ts"],"names":[],"mappings":";;AAEA;;;;GAIG;;;;;AAEH,kDAAiD;AACjD,uEAAyE;AAEzE,mEAAwC;AAExC,4DAA4D;AAC5D,MAAM,QAAQ,GACZ,sBAAS,CAAC,aAAa,CAAC,YAAY;IACpC,sBAAS,CAAC,aAAa,CAAC,cAAe,CAAC;AAE1C,KAAK,IAAI,cAAG,CAAC;IACX,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE,WAAW;IACvB,aAAa,EAAE;QACb,GAAG,EAAE,UAAU;QACf,WAAW,EAAE,gDAAgD;KAC9D;IACD,sBAAsB,EAAE,KAAK;IAC7B,cAAc,EAAE;QACd,CAAC,kBAAO,CAAC,MAAM,CAAC,EAAE,kCAAmB,CAAC,MAAM;QAC5C,CAAC,kBAAO,CAAC,OAAO,CAAC,EAAE,kCAAmB,CAAC,OAAO;QAC9C,CAAC,kBAAO,CAAC,mBAAmB,CAAC,EAAE,kCAAmB,CAAC,uBAAuB,CAAC;KAC5E;CACF,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
||||
10
node_modules/puppeteer/lib/cjs/puppeteer/node/install.d.ts
generated
vendored
Normal file
10
node_modules/puppeteer/lib/cjs/puppeteer/node/install.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare function downloadBrowser(): Promise<void>;
|
||||
//# sourceMappingURL=install.d.ts.map
|
||||
1
node_modules/puppeteer/lib/cjs/puppeteer/node/install.d.ts.map
generated
vendored
Normal file
1
node_modules/puppeteer/lib/cjs/puppeteer/node/install.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../../src/node/install.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsBH;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CA6GrD"}
|
||||
136
node_modules/puppeteer/lib/cjs/puppeteer/node/install.js
generated
vendored
Normal file
136
node_modules/puppeteer/lib/cjs/puppeteer/node/install.js
generated
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.downloadBrowser = void 0;
|
||||
const browsers_1 = require("@puppeteer/browsers");
|
||||
const revisions_js_1 = require("puppeteer-core/internal/revisions.js");
|
||||
const getConfiguration_js_1 = require("../getConfiguration.js");
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
const supportedProducts = {
|
||||
chrome: 'Chrome',
|
||||
firefox: 'Firefox Nightly',
|
||||
};
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
async function downloadBrowser() {
|
||||
overrideProxy();
|
||||
const configuration = (0, getConfiguration_js_1.getConfiguration)();
|
||||
if (configuration.skipDownload) {
|
||||
logPolitely('**INFO** Skipping browser download as instructed.');
|
||||
return;
|
||||
}
|
||||
const downloadBaseUrl = configuration.downloadBaseUrl;
|
||||
const platform = (0, browsers_1.detectBrowserPlatform)();
|
||||
if (!platform) {
|
||||
throw new Error('The current platform is not supported.');
|
||||
}
|
||||
const product = configuration.defaultProduct;
|
||||
const browser = productToBrowser(product);
|
||||
const unresolvedBuildId = configuration.browserRevision || revisions_js_1.PUPPETEER_REVISIONS[product] || 'latest';
|
||||
const unresolvedShellBuildId = configuration.browserRevision ||
|
||||
revisions_js_1.PUPPETEER_REVISIONS['chrome-headless-shell'] ||
|
||||
'latest';
|
||||
// TODO: deprecate downloadPath in favour of cacheDirectory.
|
||||
const cacheDir = configuration.downloadPath ?? configuration.cacheDirectory;
|
||||
try {
|
||||
const installationJobs = [];
|
||||
if (configuration.skipChromeDownload) {
|
||||
logPolitely('**INFO** Skipping Chrome download as instructed.');
|
||||
}
|
||||
else {
|
||||
const buildId = await (0, browsers_1.resolveBuildId)(browser, platform, unresolvedBuildId);
|
||||
installationJobs.push((0, browsers_1.install)({
|
||||
browser,
|
||||
cacheDir,
|
||||
platform,
|
||||
buildId,
|
||||
downloadProgressCallback: (0, browsers_1.makeProgressCallback)(browser, buildId),
|
||||
baseUrl: downloadBaseUrl,
|
||||
})
|
||||
.then(result => {
|
||||
logPolitely(`${supportedProducts[product]} (${result.buildId}) downloaded to ${result.path}`);
|
||||
})
|
||||
.catch(error => {
|
||||
throw new Error(`ERROR: Failed to set up ${supportedProducts[product]} v${buildId}! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.`, {
|
||||
cause: error,
|
||||
});
|
||||
}));
|
||||
}
|
||||
if (browser === browsers_1.Browser.CHROME) {
|
||||
if (configuration.skipChromeHeadlessShellDownload) {
|
||||
logPolitely('**INFO** Skipping Chrome download as instructed.');
|
||||
}
|
||||
else {
|
||||
const shellBuildId = await (0, browsers_1.resolveBuildId)(browser, platform, unresolvedShellBuildId);
|
||||
installationJobs.push((0, browsers_1.install)({
|
||||
browser: browsers_1.Browser.CHROMEHEADLESSSHELL,
|
||||
cacheDir,
|
||||
platform,
|
||||
buildId: shellBuildId,
|
||||
downloadProgressCallback: (0, browsers_1.makeProgressCallback)(browser, shellBuildId),
|
||||
baseUrl: downloadBaseUrl,
|
||||
})
|
||||
.then(result => {
|
||||
logPolitely(`${browsers_1.Browser.CHROMEHEADLESSSHELL} (${result.buildId}) downloaded to ${result.path}`);
|
||||
})
|
||||
.catch(error => {
|
||||
throw new Error(`ERROR: Failed to set up ${browsers_1.Browser.CHROMEHEADLESSSHELL} v${shellBuildId}! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.`, {
|
||||
cause: error,
|
||||
});
|
||||
}));
|
||||
}
|
||||
}
|
||||
await Promise.all(installationJobs);
|
||||
}
|
||||
catch (error) {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
exports.downloadBrowser = downloadBrowser;
|
||||
function productToBrowser(product) {
|
||||
switch (product) {
|
||||
case 'chrome':
|
||||
return browsers_1.Browser.CHROME;
|
||||
case 'firefox':
|
||||
return browsers_1.Browser.FIREFOX;
|
||||
}
|
||||
return browsers_1.Browser.CHROME;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
function logPolitely(toBeLogged) {
|
||||
const logLevel = process.env['npm_config_loglevel'] || '';
|
||||
const logLevelDisplay = ['silent', 'error', 'warn'].indexOf(logLevel) > -1;
|
||||
// eslint-disable-next-line no-console
|
||||
if (!logLevelDisplay) {
|
||||
console.log(toBeLogged);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
function overrideProxy() {
|
||||
// Override current environment proxy settings with npm configuration, if any.
|
||||
const NPM_HTTPS_PROXY = process.env['npm_config_https_proxy'] || process.env['npm_config_proxy'];
|
||||
const NPM_HTTP_PROXY = process.env['npm_config_http_proxy'] || process.env['npm_config_proxy'];
|
||||
const NPM_NO_PROXY = process.env['npm_config_no_proxy'];
|
||||
if (NPM_HTTPS_PROXY) {
|
||||
process.env['HTTPS_PROXY'] = NPM_HTTPS_PROXY;
|
||||
}
|
||||
if (NPM_HTTP_PROXY) {
|
||||
process.env['HTTP_PROXY'] = NPM_HTTP_PROXY;
|
||||
}
|
||||
if (NPM_NO_PROXY) {
|
||||
process.env['NO_PROXY'] = NPM_NO_PROXY;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=install.js.map
|
||||
1
node_modules/puppeteer/lib/cjs/puppeteer/node/install.js.map
generated
vendored
Normal file
1
node_modules/puppeteer/lib/cjs/puppeteer/node/install.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../../src/node/install.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,kDAM6B;AAE7B,uEAAyE;AAEzE,gEAAwD;AAExD;;GAEG;AACH,MAAM,iBAAiB,GAAG;IACxB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,iBAAiB;CAClB,CAAC;AAEX;;GAEG;AACI,KAAK,UAAU,eAAe;IACnC,aAAa,EAAE,CAAC;IAEhB,MAAM,aAAa,GAAG,IAAA,sCAAgB,GAAE,CAAC;IACzC,IAAI,aAAa,CAAC,YAAY,EAAE,CAAC;QAC/B,WAAW,CAAC,mDAAmD,CAAC,CAAC;QACjE,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AG,cAAc,CAAC;IAC7C,CAAC;IACD,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,YAAY,CAAC;IACzC,CAAC;AACH,CAAC"}
|
||||
35
node_modules/puppeteer/lib/cjs/puppeteer/puppeteer.d.ts
generated
vendored
Normal file
35
node_modules/puppeteer/lib/cjs/puppeteer/puppeteer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
export type { Protocol } from 'puppeteer-core';
|
||||
export * from 'puppeteer-core/internal/puppeteer-core.js';
|
||||
import { PuppeteerNode } from 'puppeteer-core/internal/node/PuppeteerNode.js';
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
declare const puppeteer: PuppeteerNode;
|
||||
export declare const
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
connect: (options: import("puppeteer-core/internal/puppeteer-core.js").ConnectOptions) => Promise<import("puppeteer-core/internal/puppeteer-core.js").Browser>,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
defaultArgs: (options?: import("puppeteer-core/internal/puppeteer-core.js").BrowserLaunchArgumentOptions | undefined) => string[],
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
executablePath: (channel?: import("puppeteer-core/internal/puppeteer-core.js").ChromeReleaseChannel | undefined) => string,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
launch: (options?: import("puppeteer-core/internal/puppeteer-core.js").PuppeteerLaunchOptions | undefined) => Promise<import("puppeteer-core/internal/puppeteer-core.js").Browser>,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
trimCache: () => Promise<void>;
|
||||
export default puppeteer;
|
||||
//# sourceMappingURL=puppeteer.d.ts.map
|
||||
1
node_modules/puppeteer/lib/cjs/puppeteer/puppeteer.d.ts.map
generated
vendored
Normal file
1
node_modules/puppeteer/lib/cjs/puppeteer/puppeteer.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"puppeteer.d.ts","sourceRoot":"","sources":["../../../src/puppeteer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAE7C,cAAc,2CAA2C,CAAC;AAE1D,OAAO,EAAC,aAAa,EAAC,MAAM,+CAA+C,CAAC;AAM5E;;GAEG;AACH,QAAA,MAAM,SAAS,eAGb,CAAC;AAEH,eAAO;AACL;;GAEG;AACH,OAAO;AACP;;GAEG;AACH,WAAW;AACX;;GAEG;AACH,cAAc;AACd;;GAEG;AACH,MAAM;AACN;;GAEG;AACH,SAAS,qBACE,CAAC;AAEd,eAAe,SAAS,CAAC"}
|
||||
55
node_modules/puppeteer/lib/cjs/puppeteer/puppeteer.js
generated
vendored
Normal file
55
node_modules/puppeteer/lib/cjs/puppeteer/puppeteer.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.trimCache = exports.launch = exports.executablePath = exports.defaultArgs = exports.connect = void 0;
|
||||
__exportStar(require("puppeteer-core/internal/puppeteer-core.js"), exports);
|
||||
const PuppeteerNode_js_1 = require("puppeteer-core/internal/node/PuppeteerNode.js");
|
||||
const getConfiguration_js_1 = require("./getConfiguration.js");
|
||||
const configuration = (0, getConfiguration_js_1.getConfiguration)();
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
const puppeteer = new PuppeteerNode_js_1.PuppeteerNode({
|
||||
isPuppeteerCore: false,
|
||||
configuration,
|
||||
});
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
exports.connect = puppeteer.connect,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
exports.defaultArgs = puppeteer.defaultArgs,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
exports.executablePath = puppeteer.executablePath,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
exports.launch = puppeteer.launch,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
exports.trimCache = puppeteer.trimCache;
|
||||
exports.default = puppeteer;
|
||||
//# sourceMappingURL=puppeteer.js.map
|
||||
1
node_modules/puppeteer/lib/cjs/puppeteer/puppeteer.js.map
generated
vendored
Normal file
1
node_modules/puppeteer/lib/cjs/puppeteer/puppeteer.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"puppeteer.js","sourceRoot":"","sources":["../../../src/puppeteer.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;AAIH,4EAA0D;AAE1D,oFAA4E;AAE5E,+DAAuD;AAEvD,MAAM,aAAa,GAAG,IAAA,sCAAgB,GAAE,CAAC;AAEzC;;GAEG;AACH,MAAM,SAAS,GAAG,IAAI,gCAAa,CAAC;IAClC,eAAe,EAAE,KAAK;IACtB,aAAa;CACd,CAAC,CAAC;AAGD;;GAEG;AACH,eAAO,GAiBL,SAAS;AAhBX;;GAEG;AACH,mBAAW,GAaT,SAAS;AAZX;;GAEG;AACH,sBAAc,GASZ,SAAS;AARX;;GAEG;AACH,cAAM,GAKJ,SAAS;AAJX;;GAEG;AACH,iBAAS,GACP,SAAS,WAAC;AAEd,kBAAe,SAAS,CAAC"}
|
||||
1
node_modules/puppeteer/lib/esm/package.json
generated
vendored
Normal file
1
node_modules/puppeteer/lib/esm/package.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"type": "module"}
|
||||
11
node_modules/puppeteer/lib/esm/puppeteer/getConfiguration.d.ts
generated
vendored
Normal file
11
node_modules/puppeteer/lib/esm/puppeteer/getConfiguration.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import type { Configuration } from 'puppeteer-core';
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const getConfiguration: () => Configuration;
|
||||
//# sourceMappingURL=getConfiguration.d.ts.map
|
||||
1
node_modules/puppeteer/lib/esm/puppeteer/getConfiguration.d.ts.map
generated
vendored
Normal file
1
node_modules/puppeteer/lib/esm/puppeteer/getConfiguration.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"getConfiguration.d.ts","sourceRoot":"","sources":["../../../src/getConfiguration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAC,aAAa,EAAU,MAAM,gBAAgB,CAAC;AA+B3D;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,aA+GnC,CAAC"}
|
||||
122
node_modules/puppeteer/lib/esm/puppeteer/getConfiguration.js
generated
vendored
Normal file
122
node_modules/puppeteer/lib/esm/puppeteer/getConfiguration.js
generated
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { homedir } from 'os';
|
||||
import { join } from 'path';
|
||||
import { cosmiconfigSync } from 'cosmiconfig';
|
||||
function getBooleanEnvVar(name) {
|
||||
const env = process.env[name];
|
||||
if (env === undefined) {
|
||||
return;
|
||||
}
|
||||
switch (env.toLowerCase()) {
|
||||
case '':
|
||||
case '0':
|
||||
case 'false':
|
||||
case 'off':
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
function isSupportedProduct(product) {
|
||||
switch (product) {
|
||||
case 'chrome':
|
||||
case 'firefox':
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const getConfiguration = () => {
|
||||
const result = cosmiconfigSync('puppeteer', {
|
||||
searchStrategy: 'global',
|
||||
}).search();
|
||||
const configuration = result ? result.config : {};
|
||||
configuration.logLevel = (process.env['PUPPETEER_LOGLEVEL'] ??
|
||||
process.env['npm_config_LOGLEVEL'] ??
|
||||
process.env['npm_package_config_LOGLEVEL'] ??
|
||||
configuration.logLevel ??
|
||||
'warn');
|
||||
// Merging environment variables.
|
||||
configuration.defaultProduct = (process.env['PUPPETEER_PRODUCT'] ??
|
||||
process.env['npm_config_puppeteer_product'] ??
|
||||
process.env['npm_package_config_puppeteer_product'] ??
|
||||
configuration.defaultProduct ??
|
||||
'chrome');
|
||||
configuration.executablePath =
|
||||
process.env['PUPPETEER_EXECUTABLE_PATH'] ??
|
||||
process.env['npm_config_puppeteer_executable_path'] ??
|
||||
process.env['npm_package_config_puppeteer_executable_path'] ??
|
||||
configuration.executablePath;
|
||||
// Default to skipDownload if executablePath is set
|
||||
if (configuration.executablePath) {
|
||||
configuration.skipDownload = true;
|
||||
}
|
||||
// Set skipDownload explicitly or from default
|
||||
configuration.skipDownload = Boolean(getBooleanEnvVar('PUPPETEER_SKIP_DOWNLOAD') ??
|
||||
getBooleanEnvVar('npm_config_puppeteer_skip_download') ??
|
||||
getBooleanEnvVar('npm_package_config_puppeteer_skip_download') ??
|
||||
configuration.skipDownload);
|
||||
// Set skipChromeDownload explicitly or from default
|
||||
configuration.skipChromeDownload = Boolean(getBooleanEnvVar('PUPPETEER_SKIP_CHROME_DOWNLOAD') ??
|
||||
getBooleanEnvVar('npm_config_puppeteer_skip_chrome_download') ??
|
||||
getBooleanEnvVar('npm_package_config_puppeteer_skip_chrome_download') ??
|
||||
configuration.skipChromeDownload);
|
||||
// Set skipChromeDownload explicitly or from default
|
||||
configuration.skipChromeHeadlessShellDownload = Boolean(getBooleanEnvVar('PUPPETEER_SKIP_CHROME_HEADLESS_SHELL_DOWNLOAD') ??
|
||||
getBooleanEnvVar('npm_config_puppeteer_skip_chrome_headless_shell_download') ??
|
||||
getBooleanEnvVar('npm_package_config_puppeteer_skip_chrome_headless_shell_download') ??
|
||||
configuration.skipChromeHeadlessShellDownload);
|
||||
// Prepare variables used in browser downloading
|
||||
if (!configuration.skipDownload) {
|
||||
configuration.browserRevision =
|
||||
process.env['PUPPETEER_BROWSER_REVISION'] ??
|
||||
process.env['npm_config_puppeteer_browser_revision'] ??
|
||||
process.env['npm_package_config_puppeteer_browser_revision'] ??
|
||||
configuration.browserRevision;
|
||||
const downloadHost = process.env['PUPPETEER_DOWNLOAD_HOST'] ??
|
||||
process.env['npm_config_puppeteer_download_host'] ??
|
||||
process.env['npm_package_config_puppeteer_download_host'];
|
||||
if (downloadHost && configuration.logLevel === 'warn') {
|
||||
console.warn(`PUPPETEER_DOWNLOAD_HOST is deprecated. Use PUPPETEER_DOWNLOAD_BASE_URL instead.`);
|
||||
}
|
||||
configuration.downloadBaseUrl =
|
||||
process.env['PUPPETEER_DOWNLOAD_BASE_URL'] ??
|
||||
process.env['npm_config_puppeteer_download_base_url'] ??
|
||||
process.env['npm_package_config_puppeteer_download_base_url'] ??
|
||||
configuration.downloadBaseUrl ??
|
||||
downloadHost;
|
||||
configuration.downloadPath =
|
||||
process.env['PUPPETEER_DOWNLOAD_PATH'] ??
|
||||
process.env['npm_config_puppeteer_download_path'] ??
|
||||
process.env['npm_package_config_puppeteer_download_path'] ??
|
||||
configuration.downloadPath;
|
||||
}
|
||||
configuration.cacheDirectory =
|
||||
process.env['PUPPETEER_CACHE_DIR'] ??
|
||||
process.env['npm_config_puppeteer_cache_dir'] ??
|
||||
process.env['npm_package_config_puppeteer_cache_dir'] ??
|
||||
configuration.cacheDirectory ??
|
||||
join(homedir(), '.cache', 'puppeteer');
|
||||
configuration.temporaryDirectory =
|
||||
process.env['PUPPETEER_TMP_DIR'] ??
|
||||
process.env['npm_config_puppeteer_tmp_dir'] ??
|
||||
process.env['npm_package_config_puppeteer_tmp_dir'] ??
|
||||
configuration.temporaryDirectory;
|
||||
configuration.experiments ??= {};
|
||||
// Validate configuration.
|
||||
if (!isSupportedProduct(configuration.defaultProduct)) {
|
||||
throw new Error(`Unsupported product ${configuration.defaultProduct}`);
|
||||
}
|
||||
return configuration;
|
||||
};
|
||||
//# sourceMappingURL=getConfiguration.js.map
|
||||
1
node_modules/puppeteer/lib/esm/puppeteer/getConfiguration.js.map
generated
vendored
Normal file
1
node_modules/puppeteer/lib/esm/puppeteer/getConfiguration.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"getConfiguration.js","sourceRoot":"","sources":["../../../src/getConfiguration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,IAAI,CAAC;AAC3B,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAE1B,OAAO,EAAC,eAAe,EAAC,MAAM,aAAa,CAAC;AAG5C,SAAS,gBAAgB,CAAC,IAAY;IACpC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO;IACT,CAAC;IACD,QAAQ,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC;QAC1B,KAAK,EAAE,CAAC;QACR,KAAK,GAAG,CAAC;QACT,K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0,0 +1,8 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
export {};
|
||||
//# sourceMappingURL=cli.d.ts.map
|
||||
1
node_modules/puppeteer/lib/esm/puppeteer/node/cli.d.ts.map
generated
vendored
Normal file
1
node_modules/puppeteer/lib/esm/puppeteer/node/cli.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../src/node/cli.ts"],"names":[],"mappings":";AAEA;;;;GAIG"}
|
||||
27
node_modules/puppeteer/lib/esm/puppeteer/node/cli.js
generated
vendored
Executable file
27
node_modules/puppeteer/lib/esm/puppeteer/node/cli.js
generated
vendored
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { CLI, Browser } from '@puppeteer/browsers';
|
||||
import { PUPPETEER_REVISIONS } from 'puppeteer-core/internal/revisions.js';
|
||||
import puppeteer from '../puppeteer.js';
|
||||
// TODO: deprecate downloadPath in favour of cacheDirectory.
|
||||
const cacheDir = puppeteer.configuration.downloadPath ??
|
||||
puppeteer.configuration.cacheDirectory;
|
||||
void new CLI({
|
||||
cachePath: cacheDir,
|
||||
scriptName: 'puppeteer',
|
||||
prefixCommand: {
|
||||
cmd: 'browsers',
|
||||
description: 'Manage browsers of this Puppeteer installation',
|
||||
},
|
||||
allowCachePathOverride: false,
|
||||
pinnedBrowsers: {
|
||||
[Browser.CHROME]: PUPPETEER_REVISIONS.chrome,
|
||||
[Browser.FIREFOX]: PUPPETEER_REVISIONS.firefox,
|
||||
[Browser.CHROMEHEADLESSSHELL]: PUPPETEER_REVISIONS['chrome-headless-shell'],
|
||||
},
|
||||
}).run(process.argv);
|
||||
//# sourceMappingURL=cli.js.map
|
||||
1
node_modules/puppeteer/lib/esm/puppeteer/node/cli.js.map
generated
vendored
Normal file
1
node_modules/puppeteer/lib/esm/puppeteer/node/cli.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../../src/node/cli.ts"],"names":[],"mappings":";AAEA;;;;GAIG;AAEH,OAAO,EAAC,GAAG,EAAE,OAAO,EAAC,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAC,mBAAmB,EAAC,MAAM,sCAAsC,CAAC;AAEzE,OAAO,SAAS,MAAM,iBAAiB,CAAC;AAExC,4DAA4D;AAC5D,MAAM,QAAQ,GACZ,SAAS,CAAC,aAAa,CAAC,YAAY;IACpC,SAAS,CAAC,aAAa,CAAC,cAAe,CAAC;AAE1C,KAAK,IAAI,GAAG,CAAC;IACX,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE,WAAW;IACvB,aAAa,EAAE;QACb,GAAG,EAAE,UAAU;QACf,WAAW,EAAE,gDAAgD;KAC9D;IACD,sBAAsB,EAAE,KAAK;IAC7B,cAAc,EAAE;QACd,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC,MAAM;QAC5C,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC,OAAO;QAC9C,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC,uBAAuB,CAAC;KAC5E;CACF,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
||||
10
node_modules/puppeteer/lib/esm/puppeteer/node/install.d.ts
generated
vendored
Normal file
10
node_modules/puppeteer/lib/esm/puppeteer/node/install.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare function downloadBrowser(): Promise<void>;
|
||||
//# sourceMappingURL=install.d.ts.map
|
||||
1
node_modules/puppeteer/lib/esm/puppeteer/node/install.d.ts.map
generated
vendored
Normal file
1
node_modules/puppeteer/lib/esm/puppeteer/node/install.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../../src/node/install.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsBH;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CA6GrD"}
|
||||
132
node_modules/puppeteer/lib/esm/puppeteer/node/install.js
generated
vendored
Normal file
132
node_modules/puppeteer/lib/esm/puppeteer/node/install.js
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { install, Browser, resolveBuildId, makeProgressCallback, detectBrowserPlatform, } from '@puppeteer/browsers';
|
||||
import { PUPPETEER_REVISIONS } from 'puppeteer-core/internal/revisions.js';
|
||||
import { getConfiguration } from '../getConfiguration.js';
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
const supportedProducts = {
|
||||
chrome: 'Chrome',
|
||||
firefox: 'Firefox Nightly',
|
||||
};
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export async function downloadBrowser() {
|
||||
overrideProxy();
|
||||
const configuration = getConfiguration();
|
||||
if (configuration.skipDownload) {
|
||||
logPolitely('**INFO** Skipping browser download as instructed.');
|
||||
return;
|
||||
}
|
||||
const downloadBaseUrl = configuration.downloadBaseUrl;
|
||||
const platform = detectBrowserPlatform();
|
||||
if (!platform) {
|
||||
throw new Error('The current platform is not supported.');
|
||||
}
|
||||
const product = configuration.defaultProduct;
|
||||
const browser = productToBrowser(product);
|
||||
const unresolvedBuildId = configuration.browserRevision || PUPPETEER_REVISIONS[product] || 'latest';
|
||||
const unresolvedShellBuildId = configuration.browserRevision ||
|
||||
PUPPETEER_REVISIONS['chrome-headless-shell'] ||
|
||||
'latest';
|
||||
// TODO: deprecate downloadPath in favour of cacheDirectory.
|
||||
const cacheDir = configuration.downloadPath ?? configuration.cacheDirectory;
|
||||
try {
|
||||
const installationJobs = [];
|
||||
if (configuration.skipChromeDownload) {
|
||||
logPolitely('**INFO** Skipping Chrome download as instructed.');
|
||||
}
|
||||
else {
|
||||
const buildId = await resolveBuildId(browser, platform, unresolvedBuildId);
|
||||
installationJobs.push(install({
|
||||
browser,
|
||||
cacheDir,
|
||||
platform,
|
||||
buildId,
|
||||
downloadProgressCallback: makeProgressCallback(browser, buildId),
|
||||
baseUrl: downloadBaseUrl,
|
||||
})
|
||||
.then(result => {
|
||||
logPolitely(`${supportedProducts[product]} (${result.buildId}) downloaded to ${result.path}`);
|
||||
})
|
||||
.catch(error => {
|
||||
throw new Error(`ERROR: Failed to set up ${supportedProducts[product]} v${buildId}! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.`, {
|
||||
cause: error,
|
||||
});
|
||||
}));
|
||||
}
|
||||
if (browser === Browser.CHROME) {
|
||||
if (configuration.skipChromeHeadlessShellDownload) {
|
||||
logPolitely('**INFO** Skipping Chrome download as instructed.');
|
||||
}
|
||||
else {
|
||||
const shellBuildId = await resolveBuildId(browser, platform, unresolvedShellBuildId);
|
||||
installationJobs.push(install({
|
||||
browser: Browser.CHROMEHEADLESSSHELL,
|
||||
cacheDir,
|
||||
platform,
|
||||
buildId: shellBuildId,
|
||||
downloadProgressCallback: makeProgressCallback(browser, shellBuildId),
|
||||
baseUrl: downloadBaseUrl,
|
||||
})
|
||||
.then(result => {
|
||||
logPolitely(`${Browser.CHROMEHEADLESSSHELL} (${result.buildId}) downloaded to ${result.path}`);
|
||||
})
|
||||
.catch(error => {
|
||||
throw new Error(`ERROR: Failed to set up ${Browser.CHROMEHEADLESSSHELL} v${shellBuildId}! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.`, {
|
||||
cause: error,
|
||||
});
|
||||
}));
|
||||
}
|
||||
}
|
||||
await Promise.all(installationJobs);
|
||||
}
|
||||
catch (error) {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
function productToBrowser(product) {
|
||||
switch (product) {
|
||||
case 'chrome':
|
||||
return Browser.CHROME;
|
||||
case 'firefox':
|
||||
return Browser.FIREFOX;
|
||||
}
|
||||
return Browser.CHROME;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
function logPolitely(toBeLogged) {
|
||||
const logLevel = process.env['npm_config_loglevel'] || '';
|
||||
const logLevelDisplay = ['silent', 'error', 'warn'].indexOf(logLevel) > -1;
|
||||
// eslint-disable-next-line no-console
|
||||
if (!logLevelDisplay) {
|
||||
console.log(toBeLogged);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
function overrideProxy() {
|
||||
// Override current environment proxy settings with npm configuration, if any.
|
||||
const NPM_HTTPS_PROXY = process.env['npm_config_https_proxy'] || process.env['npm_config_proxy'];
|
||||
const NPM_HTTP_PROXY = process.env['npm_config_http_proxy'] || process.env['npm_config_proxy'];
|
||||
const NPM_NO_PROXY = process.env['npm_config_no_proxy'];
|
||||
if (NPM_HTTPS_PROXY) {
|
||||
process.env['HTTPS_PROXY'] = NPM_HTTPS_PROXY;
|
||||
}
|
||||
if (NPM_HTTP_PROXY) {
|
||||
process.env['HTTP_PROXY'] = NPM_HTTP_PROXY;
|
||||
}
|
||||
if (NPM_NO_PROXY) {
|
||||
process.env['NO_PROXY'] = NPM_NO_PROXY;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=install.js.map
|
||||
1
node_modules/puppeteer/lib/esm/puppeteer/node/install.js.map
generated
vendored
Normal file
1
node_modules/puppeteer/lib/esm/puppeteer/node/install.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../../src/node/install.ts"],"names":[],"mappings":"AAAA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ACnB,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAC3E,MAAM,cAAc,GAClB,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAC1E,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAExD,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,eAAe,CAAC;IAC/C,CAAC;IACD,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,cAAc,CAAC;IAC7C,CAAC;IACD,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,YAAY,CAAC;IACzC,CAAC;AACH,CAAC"}
|
||||
35
node_modules/puppeteer/lib/esm/puppeteer/puppeteer.d.ts
generated
vendored
Normal file
35
node_modules/puppeteer/lib/esm/puppeteer/puppeteer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
export type { Protocol } from 'puppeteer-core';
|
||||
export * from 'puppeteer-core/internal/puppeteer-core.js';
|
||||
import { PuppeteerNode } from 'puppeteer-core/internal/node/PuppeteerNode.js';
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
declare const puppeteer: PuppeteerNode;
|
||||
export declare const
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
connect: (options: import("puppeteer-core/internal/puppeteer-core.js").ConnectOptions) => Promise<import("puppeteer-core/internal/puppeteer-core.js").Browser>,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
defaultArgs: (options?: import("puppeteer-core/internal/puppeteer-core.js").BrowserLaunchArgumentOptions | undefined) => string[],
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
executablePath: (channel?: import("puppeteer-core/internal/puppeteer-core.js").ChromeReleaseChannel | undefined) => string,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
launch: (options?: import("puppeteer-core/internal/puppeteer-core.js").PuppeteerLaunchOptions | undefined) => Promise<import("puppeteer-core/internal/puppeteer-core.js").Browser>,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
trimCache: () => Promise<void>;
|
||||
export default puppeteer;
|
||||
//# sourceMappingURL=puppeteer.d.ts.map
|
||||
1
node_modules/puppeteer/lib/esm/puppeteer/puppeteer.d.ts.map
generated
vendored
Normal file
1
node_modules/puppeteer/lib/esm/puppeteer/puppeteer.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"puppeteer.d.ts","sourceRoot":"","sources":["../../../src/puppeteer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAE7C,cAAc,2CAA2C,CAAC;AAE1D,OAAO,EAAC,aAAa,EAAC,MAAM,+CAA+C,CAAC;AAM5E;;GAEG;AACH,QAAA,MAAM,SAAS,eAGb,CAAC;AAEH,eAAO;AACL;;GAEG;AACH,OAAO;AACP;;GAEG;AACH,WAAW;AACX;;GAEG;AACH,cAAc;AACd;;GAEG;AACH,MAAM;AACN;;GAEG;AACH,SAAS,qBACE,CAAC;AAEd,eAAe,SAAS,CAAC"}
|
||||
39
node_modules/puppeteer/lib/esm/puppeteer/puppeteer.js
generated
vendored
Normal file
39
node_modules/puppeteer/lib/esm/puppeteer/puppeteer.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
export * from 'puppeteer-core/internal/puppeteer-core.js';
|
||||
import { PuppeteerNode } from 'puppeteer-core/internal/node/PuppeteerNode.js';
|
||||
import { getConfiguration } from './getConfiguration.js';
|
||||
const configuration = getConfiguration();
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
const puppeteer = new PuppeteerNode({
|
||||
isPuppeteerCore: false,
|
||||
configuration,
|
||||
});
|
||||
export const {
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
connect,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
defaultArgs,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
executablePath,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
launch,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
trimCache, } = puppeteer;
|
||||
export default puppeteer;
|
||||
//# sourceMappingURL=puppeteer.js.map
|
||||
1
node_modules/puppeteer/lib/esm/puppeteer/puppeteer.js.map
generated
vendored
Normal file
1
node_modules/puppeteer/lib/esm/puppeteer/puppeteer.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"puppeteer.js","sourceRoot":"","sources":["../../../src/puppeteer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,cAAc,2CAA2C,CAAC;AAE1D,OAAO,EAAC,aAAa,EAAC,MAAM,+CAA+C,CAAC;AAE5E,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAEvD,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;AAEzC;;GAEG;AACH,MAAM,SAAS,GAAG,IAAI,aAAa,CAAC;IAClC,eAAe,EAAE,KAAK;IACtB,aAAa;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM;AACX;;GAEG;AACH,OAAO;AACP;;GAEG;AACH,WAAW;AACX;;GAEG;AACH,cAAc;AACd;;GAEG;AACH,MAAM;AACN;;GAEG;AACH,SAAS,GACV,GAAG,SAAS,CAAC;AAEd,eAAe,SAAS,CAAC"}
|
||||
7631
node_modules/puppeteer/lib/types.d.ts
generated
vendored
Normal file
7631
node_modules/puppeteer/lib/types.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
133
node_modules/puppeteer/package.json
generated
vendored
Normal file
133
node_modules/puppeteer/package.json
generated
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
{
|
||||
"name": "puppeteer",
|
||||
"version": "21.11.0",
|
||||
"description": "A high-level API to control headless Chrome over the DevTools Protocol",
|
||||
"keywords": [
|
||||
"puppeteer",
|
||||
"chrome",
|
||||
"headless",
|
||||
"automation"
|
||||
],
|
||||
"type": "commonjs",
|
||||
"bin": "./lib/esm/puppeteer/node/cli.js",
|
||||
"main": "./lib/cjs/puppeteer/puppeteer.js",
|
||||
"types": "./lib/types.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./lib/types.d.ts",
|
||||
"import": "./lib/esm/puppeteer/puppeteer.js",
|
||||
"require": "./lib/cjs/puppeteer/puppeteer.js"
|
||||
},
|
||||
"./internal/*": {
|
||||
"import": "./lib/esm/puppeteer/*",
|
||||
"require": "./lib/cjs/puppeteer/*"
|
||||
},
|
||||
"./*": {
|
||||
"import": "./*",
|
||||
"require": "./*"
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/puppeteer/puppeteer/tree/main/packages/puppeteer"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.13.2"
|
||||
},
|
||||
"scripts": {
|
||||
"build:docs": "wireit",
|
||||
"build": "wireit",
|
||||
"clean": "../../tools/clean.mjs",
|
||||
"postinstall": "node install.mjs",
|
||||
"prepack": "wireit"
|
||||
},
|
||||
"wireit": {
|
||||
"prepack": {
|
||||
"command": "tsx ../../tools/cp.ts ../../README.md README.md",
|
||||
"files": [
|
||||
"../../README.md"
|
||||
],
|
||||
"output": [
|
||||
"README.md"
|
||||
]
|
||||
},
|
||||
"build": {
|
||||
"dependencies": [
|
||||
"build:tsc",
|
||||
"build:types"
|
||||
]
|
||||
},
|
||||
"generate:package-json": {
|
||||
"command": "tsx ../../tools/generate_module_package_json.ts lib/esm/package.json",
|
||||
"files": [
|
||||
"../../tools/generate_module_package_json.ts"
|
||||
],
|
||||
"output": [
|
||||
"lib/esm/package.json"
|
||||
]
|
||||
},
|
||||
"build:docs": {
|
||||
"command": "api-extractor run --local --config \"./api-extractor.docs.json\"",
|
||||
"files": [
|
||||
"api-extractor.docs.json",
|
||||
"lib/esm/puppeteer/puppeteer-core.d.ts",
|
||||
"tsconfig.json"
|
||||
],
|
||||
"dependencies": [
|
||||
"build:tsc"
|
||||
]
|
||||
},
|
||||
"build:tsc": {
|
||||
"command": "tsc -b && tsx ../../tools/chmod.ts 755 lib/cjs/puppeteer/node/cli.js lib/esm/puppeteer/node/cli.js",
|
||||
"clean": "if-file-deleted",
|
||||
"dependencies": [
|
||||
"../puppeteer-core:build",
|
||||
"../browsers:build",
|
||||
"generate:package-json"
|
||||
],
|
||||
"files": [
|
||||
"src/**"
|
||||
],
|
||||
"output": [
|
||||
"lib/{cjs,esm}/**",
|
||||
"!lib/esm/package.json"
|
||||
]
|
||||
},
|
||||
"build:types": {
|
||||
"command": "api-extractor run --local && eslint --cache-location .eslintcache --cache --ext=ts --no-ignore --no-eslintrc -c=../../.eslintrc.types.cjs --fix lib/types.d.ts",
|
||||
"files": [
|
||||
"../../.eslintrc.types.cjs",
|
||||
"api-extractor.json",
|
||||
"lib/esm/puppeteer/types.d.ts",
|
||||
"tsconfig.json"
|
||||
],
|
||||
"output": [
|
||||
"lib/types.d.ts"
|
||||
],
|
||||
"dependencies": [
|
||||
"build:tsc"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
"src",
|
||||
"install.mjs",
|
||||
"!*.test.ts",
|
||||
"!*.test.js",
|
||||
"!*.test.d.ts",
|
||||
"!*.test.js.map",
|
||||
"!*.test.d.ts.map",
|
||||
"!*.tsbuildinfo"
|
||||
],
|
||||
"author": "The Chromium Authors",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"cosmiconfig": "9.0.0",
|
||||
"puppeteer-core": "21.11.0",
|
||||
"@puppeteer/browsers": "1.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "18.17.15"
|
||||
}
|
||||
}
|
||||
156
node_modules/puppeteer/src/getConfiguration.ts
generated
vendored
Normal file
156
node_modules/puppeteer/src/getConfiguration.ts
generated
vendored
Normal file
@@ -0,0 +1,156 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {homedir} from 'os';
|
||||
import {join} from 'path';
|
||||
|
||||
import {cosmiconfigSync} from 'cosmiconfig';
|
||||
import type {Configuration, Product} from 'puppeteer-core';
|
||||
|
||||
function getBooleanEnvVar(name: string) {
|
||||
const env = process.env[name];
|
||||
if (env === undefined) {
|
||||
return;
|
||||
}
|
||||
switch (env.toLowerCase()) {
|
||||
case '':
|
||||
case '0':
|
||||
case 'false':
|
||||
case 'off':
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
function isSupportedProduct(product: unknown): product is Product {
|
||||
switch (product) {
|
||||
case 'chrome':
|
||||
case 'firefox':
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const getConfiguration = (): Configuration => {
|
||||
const result = cosmiconfigSync('puppeteer', {
|
||||
searchStrategy: 'global',
|
||||
}).search();
|
||||
const configuration: Configuration = result ? result.config : {};
|
||||
|
||||
configuration.logLevel = (process.env['PUPPETEER_LOGLEVEL'] ??
|
||||
process.env['npm_config_LOGLEVEL'] ??
|
||||
process.env['npm_package_config_LOGLEVEL'] ??
|
||||
configuration.logLevel ??
|
||||
'warn') as 'silent' | 'error' | 'warn';
|
||||
|
||||
// Merging environment variables.
|
||||
configuration.defaultProduct = (process.env['PUPPETEER_PRODUCT'] ??
|
||||
process.env['npm_config_puppeteer_product'] ??
|
||||
process.env['npm_package_config_puppeteer_product'] ??
|
||||
configuration.defaultProduct ??
|
||||
'chrome') as Product;
|
||||
|
||||
configuration.executablePath =
|
||||
process.env['PUPPETEER_EXECUTABLE_PATH'] ??
|
||||
process.env['npm_config_puppeteer_executable_path'] ??
|
||||
process.env['npm_package_config_puppeteer_executable_path'] ??
|
||||
configuration.executablePath;
|
||||
|
||||
// Default to skipDownload if executablePath is set
|
||||
if (configuration.executablePath) {
|
||||
configuration.skipDownload = true;
|
||||
}
|
||||
|
||||
// Set skipDownload explicitly or from default
|
||||
configuration.skipDownload = Boolean(
|
||||
getBooleanEnvVar('PUPPETEER_SKIP_DOWNLOAD') ??
|
||||
getBooleanEnvVar('npm_config_puppeteer_skip_download') ??
|
||||
getBooleanEnvVar('npm_package_config_puppeteer_skip_download') ??
|
||||
configuration.skipDownload
|
||||
);
|
||||
|
||||
// Set skipChromeDownload explicitly or from default
|
||||
configuration.skipChromeDownload = Boolean(
|
||||
getBooleanEnvVar('PUPPETEER_SKIP_CHROME_DOWNLOAD') ??
|
||||
getBooleanEnvVar('npm_config_puppeteer_skip_chrome_download') ??
|
||||
getBooleanEnvVar('npm_package_config_puppeteer_skip_chrome_download') ??
|
||||
configuration.skipChromeDownload
|
||||
);
|
||||
|
||||
// Set skipChromeDownload explicitly or from default
|
||||
configuration.skipChromeHeadlessShellDownload = Boolean(
|
||||
getBooleanEnvVar('PUPPETEER_SKIP_CHROME_HEADLESS_SHELL_DOWNLOAD') ??
|
||||
getBooleanEnvVar(
|
||||
'npm_config_puppeteer_skip_chrome_headless_shell_download'
|
||||
) ??
|
||||
getBooleanEnvVar(
|
||||
'npm_package_config_puppeteer_skip_chrome_headless_shell_download'
|
||||
) ??
|
||||
configuration.skipChromeHeadlessShellDownload
|
||||
);
|
||||
|
||||
// Prepare variables used in browser downloading
|
||||
if (!configuration.skipDownload) {
|
||||
configuration.browserRevision =
|
||||
process.env['PUPPETEER_BROWSER_REVISION'] ??
|
||||
process.env['npm_config_puppeteer_browser_revision'] ??
|
||||
process.env['npm_package_config_puppeteer_browser_revision'] ??
|
||||
configuration.browserRevision;
|
||||
|
||||
const downloadHost =
|
||||
process.env['PUPPETEER_DOWNLOAD_HOST'] ??
|
||||
process.env['npm_config_puppeteer_download_host'] ??
|
||||
process.env['npm_package_config_puppeteer_download_host'];
|
||||
|
||||
if (downloadHost && configuration.logLevel === 'warn') {
|
||||
console.warn(
|
||||
`PUPPETEER_DOWNLOAD_HOST is deprecated. Use PUPPETEER_DOWNLOAD_BASE_URL instead.`
|
||||
);
|
||||
}
|
||||
|
||||
configuration.downloadBaseUrl =
|
||||
process.env['PUPPETEER_DOWNLOAD_BASE_URL'] ??
|
||||
process.env['npm_config_puppeteer_download_base_url'] ??
|
||||
process.env['npm_package_config_puppeteer_download_base_url'] ??
|
||||
configuration.downloadBaseUrl ??
|
||||
downloadHost;
|
||||
|
||||
configuration.downloadPath =
|
||||
process.env['PUPPETEER_DOWNLOAD_PATH'] ??
|
||||
process.env['npm_config_puppeteer_download_path'] ??
|
||||
process.env['npm_package_config_puppeteer_download_path'] ??
|
||||
configuration.downloadPath;
|
||||
}
|
||||
|
||||
configuration.cacheDirectory =
|
||||
process.env['PUPPETEER_CACHE_DIR'] ??
|
||||
process.env['npm_config_puppeteer_cache_dir'] ??
|
||||
process.env['npm_package_config_puppeteer_cache_dir'] ??
|
||||
configuration.cacheDirectory ??
|
||||
join(homedir(), '.cache', 'puppeteer');
|
||||
configuration.temporaryDirectory =
|
||||
process.env['PUPPETEER_TMP_DIR'] ??
|
||||
process.env['npm_config_puppeteer_tmp_dir'] ??
|
||||
process.env['npm_package_config_puppeteer_tmp_dir'] ??
|
||||
configuration.temporaryDirectory;
|
||||
|
||||
configuration.experiments ??= {};
|
||||
|
||||
// Validate configuration.
|
||||
if (!isSupportedProduct(configuration.defaultProduct)) {
|
||||
throw new Error(`Unsupported product ${configuration.defaultProduct}`);
|
||||
}
|
||||
|
||||
return configuration;
|
||||
};
|
||||
32
node_modules/puppeteer/src/node/cli.ts
generated
vendored
Normal file
32
node_modules/puppeteer/src/node/cli.ts
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {CLI, Browser} from '@puppeteer/browsers';
|
||||
import {PUPPETEER_REVISIONS} from 'puppeteer-core/internal/revisions.js';
|
||||
|
||||
import puppeteer from '../puppeteer.js';
|
||||
|
||||
// TODO: deprecate downloadPath in favour of cacheDirectory.
|
||||
const cacheDir =
|
||||
puppeteer.configuration.downloadPath ??
|
||||
puppeteer.configuration.cacheDirectory!;
|
||||
|
||||
void new CLI({
|
||||
cachePath: cacheDir,
|
||||
scriptName: 'puppeteer',
|
||||
prefixCommand: {
|
||||
cmd: 'browsers',
|
||||
description: 'Manage browsers of this Puppeteer installation',
|
||||
},
|
||||
allowCachePathOverride: false,
|
||||
pinnedBrowsers: {
|
||||
[Browser.CHROME]: PUPPETEER_REVISIONS.chrome,
|
||||
[Browser.FIREFOX]: PUPPETEER_REVISIONS.firefox,
|
||||
[Browser.CHROMEHEADLESSSHELL]: PUPPETEER_REVISIONS['chrome-headless-shell'],
|
||||
},
|
||||
}).run(process.argv);
|
||||
184
node_modules/puppeteer/src/node/install.ts
generated
vendored
Normal file
184
node_modules/puppeteer/src/node/install.ts
generated
vendored
Normal file
@@ -0,0 +1,184 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2020 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {
|
||||
install,
|
||||
Browser,
|
||||
resolveBuildId,
|
||||
makeProgressCallback,
|
||||
detectBrowserPlatform,
|
||||
} from '@puppeteer/browsers';
|
||||
import type {Product} from 'puppeteer-core';
|
||||
import {PUPPETEER_REVISIONS} from 'puppeteer-core/internal/revisions.js';
|
||||
|
||||
import {getConfiguration} from '../getConfiguration.js';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
const supportedProducts = {
|
||||
chrome: 'Chrome',
|
||||
firefox: 'Firefox Nightly',
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export async function downloadBrowser(): Promise<void> {
|
||||
overrideProxy();
|
||||
|
||||
const configuration = getConfiguration();
|
||||
if (configuration.skipDownload) {
|
||||
logPolitely('**INFO** Skipping browser download as instructed.');
|
||||
return;
|
||||
}
|
||||
|
||||
const downloadBaseUrl = configuration.downloadBaseUrl;
|
||||
|
||||
const platform = detectBrowserPlatform();
|
||||
if (!platform) {
|
||||
throw new Error('The current platform is not supported.');
|
||||
}
|
||||
|
||||
const product = configuration.defaultProduct!;
|
||||
const browser = productToBrowser(product);
|
||||
|
||||
const unresolvedBuildId =
|
||||
configuration.browserRevision || PUPPETEER_REVISIONS[product] || 'latest';
|
||||
const unresolvedShellBuildId =
|
||||
configuration.browserRevision ||
|
||||
PUPPETEER_REVISIONS['chrome-headless-shell'] ||
|
||||
'latest';
|
||||
|
||||
// TODO: deprecate downloadPath in favour of cacheDirectory.
|
||||
const cacheDir = configuration.downloadPath ?? configuration.cacheDirectory!;
|
||||
|
||||
try {
|
||||
const installationJobs = [];
|
||||
|
||||
if (configuration.skipChromeDownload) {
|
||||
logPolitely('**INFO** Skipping Chrome download as instructed.');
|
||||
} else {
|
||||
const buildId = await resolveBuildId(
|
||||
browser,
|
||||
platform,
|
||||
unresolvedBuildId
|
||||
);
|
||||
installationJobs.push(
|
||||
install({
|
||||
browser,
|
||||
cacheDir,
|
||||
platform,
|
||||
buildId,
|
||||
downloadProgressCallback: makeProgressCallback(browser, buildId),
|
||||
baseUrl: downloadBaseUrl,
|
||||
})
|
||||
.then(result => {
|
||||
logPolitely(
|
||||
`${supportedProducts[product]} (${result.buildId}) downloaded to ${result.path}`
|
||||
);
|
||||
})
|
||||
.catch(error => {
|
||||
throw new Error(
|
||||
`ERROR: Failed to set up ${supportedProducts[product]} v${buildId}! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.`,
|
||||
{
|
||||
cause: error,
|
||||
}
|
||||
);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
if (browser === Browser.CHROME) {
|
||||
if (configuration.skipChromeHeadlessShellDownload) {
|
||||
logPolitely('**INFO** Skipping Chrome download as instructed.');
|
||||
} else {
|
||||
const shellBuildId = await resolveBuildId(
|
||||
browser,
|
||||
platform,
|
||||
unresolvedShellBuildId
|
||||
);
|
||||
|
||||
installationJobs.push(
|
||||
install({
|
||||
browser: Browser.CHROMEHEADLESSSHELL,
|
||||
cacheDir,
|
||||
platform,
|
||||
buildId: shellBuildId,
|
||||
downloadProgressCallback: makeProgressCallback(
|
||||
browser,
|
||||
shellBuildId
|
||||
),
|
||||
baseUrl: downloadBaseUrl,
|
||||
})
|
||||
.then(result => {
|
||||
logPolitely(
|
||||
`${Browser.CHROMEHEADLESSSHELL} (${result.buildId}) downloaded to ${result.path}`
|
||||
);
|
||||
})
|
||||
.catch(error => {
|
||||
throw new Error(
|
||||
`ERROR: Failed to set up ${Browser.CHROMEHEADLESSSHELL} v${shellBuildId}! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.`,
|
||||
{
|
||||
cause: error,
|
||||
}
|
||||
);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
await Promise.all(installationJobs);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
function productToBrowser(product?: Product) {
|
||||
switch (product) {
|
||||
case 'chrome':
|
||||
return Browser.CHROME;
|
||||
case 'firefox':
|
||||
return Browser.FIREFOX;
|
||||
}
|
||||
return Browser.CHROME;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
function logPolitely(toBeLogged: unknown): void {
|
||||
const logLevel = process.env['npm_config_loglevel'] || '';
|
||||
const logLevelDisplay = ['silent', 'error', 'warn'].indexOf(logLevel) > -1;
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
if (!logLevelDisplay) {
|
||||
console.log(toBeLogged);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
function overrideProxy() {
|
||||
// Override current environment proxy settings with npm configuration, if any.
|
||||
const NPM_HTTPS_PROXY =
|
||||
process.env['npm_config_https_proxy'] || process.env['npm_config_proxy'];
|
||||
const NPM_HTTP_PROXY =
|
||||
process.env['npm_config_http_proxy'] || process.env['npm_config_proxy'];
|
||||
const NPM_NO_PROXY = process.env['npm_config_no_proxy'];
|
||||
|
||||
if (NPM_HTTPS_PROXY) {
|
||||
process.env['HTTPS_PROXY'] = NPM_HTTPS_PROXY;
|
||||
}
|
||||
if (NPM_HTTP_PROXY) {
|
||||
process.env['HTTP_PROXY'] = NPM_HTTP_PROXY;
|
||||
}
|
||||
if (NPM_NO_PROXY) {
|
||||
process.env['NO_PROXY'] = NPM_NO_PROXY;
|
||||
}
|
||||
}
|
||||
48
node_modules/puppeteer/src/puppeteer.ts
generated
vendored
Normal file
48
node_modules/puppeteer/src/puppeteer.ts
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
export type {Protocol} from 'puppeteer-core';
|
||||
|
||||
export * from 'puppeteer-core/internal/puppeteer-core.js';
|
||||
|
||||
import {PuppeteerNode} from 'puppeteer-core/internal/node/PuppeteerNode.js';
|
||||
|
||||
import {getConfiguration} from './getConfiguration.js';
|
||||
|
||||
const configuration = getConfiguration();
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
const puppeteer = new PuppeteerNode({
|
||||
isPuppeteerCore: false,
|
||||
configuration,
|
||||
});
|
||||
|
||||
export const {
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
connect,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
defaultArgs,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
executablePath,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
launch,
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
trimCache,
|
||||
} = puppeteer;
|
||||
|
||||
export default puppeteer;
|
||||
8
node_modules/puppeteer/src/tsconfig.cjs.json
generated
vendored
Normal file
8
node_modules/puppeteer/src/tsconfig.cjs.json
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"outDir": "../lib/cjs/puppeteer"
|
||||
}
|
||||
}
|
||||
6
node_modules/puppeteer/src/tsconfig.esm.json
generated
vendored
Normal file
6
node_modules/puppeteer/src/tsconfig.esm.json
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../lib/esm/puppeteer"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user