Tons of Solutions Engineering work done today for the rest of the CS team! Headway, Howard Hanna, Engels, Brighton, etc. Also completed Datasnippers auth flow and worked on Anthology's script. Cloned Anthology's courses (900..) and will clone Full Story on Monday.
This commit is contained in:
257
Scripts/node_modules/puppeteer/README.md
generated
vendored
Normal file
257
Scripts/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) 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).
|
||||
|
||||
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('.search-box__input', 'automate beyond recorder');
|
||||
|
||||
// Wait and click on first result
|
||||
const searchResultSelector = '.search-box__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).
|
||||
33
Scripts/node_modules/puppeteer/install.mjs
generated
vendored
Executable file
33
Scripts/node_modules/puppeteer/install.mjs
generated
vendored
Executable file
@ -0,0 +1,33 @@
|
||||
#!/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.
|
||||
*/
|
||||
|
||||
try {
|
||||
const {downloadBrowser} = await (async () => {
|
||||
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);
|
||||
}
|
||||
})();
|
||||
downloadBrowser();
|
||||
} catch (error) {
|
||||
console.warn('Browser download failed', error);
|
||||
}
|
||||
11
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/getConfiguration.d.ts
generated
vendored
Normal file
11
Scripts/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
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/getConfiguration.d.ts.map
generated
vendored
Normal file
1
Scripts/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;AAe3D;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,aAyFnC,CAAC"}
|
||||
99
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/getConfiguration.js
generated
vendored
Normal file
99
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/getConfiguration.js
generated
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
"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");
|
||||
/**
|
||||
* @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').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(process.env['PUPPETEER_SKIP_DOWNLOAD'] ??
|
||||
process.env['npm_config_puppeteer_skip_download'] ??
|
||||
process.env['npm_package_config_puppeteer_skip_download'] ??
|
||||
configuration.skipDownload);
|
||||
// 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
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/getConfiguration.js.map
generated
vendored
Normal file
1
Scripts/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;;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,CAAC,CAAC,MAAM,EAAE,CAAC;IACrD,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,o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AM,IAAI,KAAK,CAAC,uBAAuB,aAAa,CAAC,cAAc,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AAzFW,QAAA,gBAAgB,oBAyF3B"}
|
||||
8
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/node/cli.d.ts
generated
vendored
Normal file
8
Scripts/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
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/node/cli.d.ts.map
generated
vendored
Normal file
1
Scripts/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"}
|
||||
31
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/node/cli.js
generated
vendored
Executable file
31
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/node/cli.js
generated
vendored
Executable file
@ -0,0 +1,31 @@
|
||||
#!/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,
|
||||
},
|
||||
}).run(process.argv);
|
||||
//# sourceMappingURL=cli.js.map
|
||||
1
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/node/cli.js.map
generated
vendored
Normal file
1
Scripts/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;KAC/C;CACF,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
||||
10
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/node/install.d.ts
generated
vendored
Normal file
10
Scripts/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
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/node/install.d.ts.map
generated
vendored
Normal file
1
Scripts/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,CA8CrD"}
|
||||
96
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/node/install.js
generated
vendored
Normal file
96
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/node/install.js
generated
vendored
Normal file
@ -0,0 +1,96 @@
|
||||
"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 buildId = await (0, browsers_1.resolveBuildId)(browser, platform, unresolvedBuildId);
|
||||
// TODO: deprecate downloadPath in favour of cacheDirectory.
|
||||
const cacheDir = configuration.downloadPath ?? configuration.cacheDirectory;
|
||||
try {
|
||||
const result = await (0, browsers_1.install)({
|
||||
browser,
|
||||
cacheDir,
|
||||
platform,
|
||||
buildId,
|
||||
downloadProgressCallback: (0, browsers_1.makeProgressCallback)(browser, buildId),
|
||||
baseUrl: downloadBaseUrl,
|
||||
});
|
||||
logPolitely(`${supportedProducts[product]} (${result.buildId}) downloaded to ${result.path}`);
|
||||
}
|
||||
catch (error) {
|
||||
console.error(`ERROR: Failed to set up ${supportedProducts[product]} r${buildId}! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.`);
|
||||
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
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/node/install.js.map
generated
vendored
Normal file
1
Scripts/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,OAAO;IACT,CAAC;IAED,MAAM,eAAe,GAAG,aAAa,CAAC,e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js/puppeteer/puppeteer.d.ts
generated
vendored
Normal file
35
Scripts/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
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/puppeteer.d.ts.map
generated
vendored
Normal file
1
Scripts/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
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/puppeteer.js
generated
vendored
Normal file
55
Scripts/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
Scripts/node_modules/puppeteer/lib/cjs/puppeteer/puppeteer.js.map
generated
vendored
Normal file
1
Scripts/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
Scripts/node_modules/puppeteer/lib/esm/package.json
generated
vendored
Normal file
1
Scripts/node_modules/puppeteer/lib/esm/package.json
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"type": "module"}
|
||||
11
Scripts/node_modules/puppeteer/lib/esm/puppeteer/getConfiguration.d.ts
generated
vendored
Normal file
11
Scripts/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
Scripts/node_modules/puppeteer/lib/esm/puppeteer/getConfiguration.d.ts.map
generated
vendored
Normal file
1
Scripts/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;AAe3D;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,aAyFnC,CAAC"}
|
||||
95
Scripts/node_modules/puppeteer/lib/esm/puppeteer/getConfiguration.js
generated
vendored
Normal file
95
Scripts/node_modules/puppeteer/lib/esm/puppeteer/getConfiguration.js
generated
vendored
Normal file
@ -0,0 +1,95 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2023 Google Inc.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
import { homedir } from 'os';
|
||||
import { join } from 'path';
|
||||
import { cosmiconfigSync } from 'cosmiconfig';
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
function isSupportedProduct(product) {
|
||||
switch (product) {
|
||||
case 'chrome':
|
||||
case 'firefox':
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const getConfiguration = () => {
|
||||
const result = cosmiconfigSync('puppeteer').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(process.env['PUPPETEER_SKIP_DOWNLOAD'] ??
|
||||
process.env['npm_config_puppeteer_skip_download'] ??
|
||||
process.env['npm_package_config_puppeteer_skip_download'] ??
|
||||
configuration.skipDownload);
|
||||
// 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
Scripts/node_modules/puppeteer/lib/esm/puppeteer/getConfiguration.js.map
generated
vendored
Normal file
1
Scripts/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,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CAAC,YAAY,CAAC;IAC/B,CAAC;IAED,aAAa,CAAC,cAAc;QAC1B,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;YAClC,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC;YAC7C,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC;YACrD,aAAa,CAAC,cAAc;YAC5B,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;IACzC,aAAa,CAAC,kBAAkB;QAC9B,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,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"}
|
||||
8
Scripts/node_modules/puppeteer/lib/esm/puppeteer/node/cli.d.ts
generated
vendored
Normal file
8
Scripts/node_modules/puppeteer/lib/esm/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
Scripts/node_modules/puppeteer/lib/esm/puppeteer/node/cli.d.ts.map
generated
vendored
Normal file
1
Scripts/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"}
|
||||
26
Scripts/node_modules/puppeteer/lib/esm/puppeteer/node/cli.js
generated
vendored
Executable file
26
Scripts/node_modules/puppeteer/lib/esm/puppeteer/node/cli.js
generated
vendored
Executable file
@ -0,0 +1,26 @@
|
||||
#!/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,
|
||||
},
|
||||
}).run(process.argv);
|
||||
//# sourceMappingURL=cli.js.map
|
||||
1
Scripts/node_modules/puppeteer/lib/esm/puppeteer/node/cli.js.map
generated
vendored
Normal file
1
Scripts/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;KAC/C;CACF,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
||||
10
Scripts/node_modules/puppeteer/lib/esm/puppeteer/node/install.d.ts
generated
vendored
Normal file
10
Scripts/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
Scripts/node_modules/puppeteer/lib/esm/puppeteer/node/install.d.ts.map
generated
vendored
Normal file
1
Scripts/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,CA8CrD"}
|
||||
92
Scripts/node_modules/puppeteer/lib/esm/puppeteer/node/install.js
generated
vendored
Normal file
92
Scripts/node_modules/puppeteer/lib/esm/puppeteer/node/install.js
generated
vendored
Normal file
@ -0,0 +1,92 @@
|
||||
/**
|
||||
* @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 buildId = await resolveBuildId(browser, platform, unresolvedBuildId);
|
||||
// TODO: deprecate downloadPath in favour of cacheDirectory.
|
||||
const cacheDir = configuration.downloadPath ?? configuration.cacheDirectory;
|
||||
try {
|
||||
const result = await install({
|
||||
browser,
|
||||
cacheDir,
|
||||
platform,
|
||||
buildId,
|
||||
downloadProgressCallback: makeProgressCallback(browser, buildId),
|
||||
baseUrl: downloadBaseUrl,
|
||||
});
|
||||
logPolitely(`${supportedProducts[product]} (${result.buildId}) downloaded to ${result.path}`);
|
||||
}
|
||||
catch (error) {
|
||||
console.error(`ERROR: Failed to set up ${supportedProducts[product]} r${buildId}! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.`);
|
||||
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
Scripts/node_modules/puppeteer/lib/esm/puppeteer/node/install.js.map
generated
vendored
Normal file
1
Scripts/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;;;;GAIG;AAEH,OAAO,EACL,OAAO,EACP,OAAO,EACP,cAAc,EACd,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,qBAA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AAC,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
Scripts/node_modules/puppeteer/lib/esm/puppeteer/puppeteer.d.ts
generated
vendored
Normal file
35
Scripts/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
Scripts/node_modules/puppeteer/lib/esm/puppeteer/puppeteer.d.ts.map
generated
vendored
Normal file
1
Scripts/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
Scripts/node_modules/puppeteer/lib/esm/puppeteer/puppeteer.js
generated
vendored
Normal file
39
Scripts/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
Scripts/node_modules/puppeteer/lib/esm/puppeteer/puppeteer.js.map
generated
vendored
Normal file
1
Scripts/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"}
|
||||
7623
Scripts/node_modules/puppeteer/lib/types.d.ts
generated
vendored
Normal file
7623
Scripts/node_modules/puppeteer/lib/types.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
133
Scripts/node_modules/puppeteer/package.json
generated
vendored
Normal file
133
Scripts/node_modules/puppeteer/package.json
generated
vendored
Normal file
@ -0,0 +1,133 @@
|
||||
{
|
||||
"name": "puppeteer",
|
||||
"version": "21.7.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.js",
|
||||
"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": "8.3.6",
|
||||
"puppeteer-core": "21.7.0",
|
||||
"@puppeteer/browsers": "1.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "18.17.15"
|
||||
}
|
||||
}
|
||||
118
Scripts/node_modules/puppeteer/src/getConfiguration.ts
generated
vendored
Normal file
118
Scripts/node_modules/puppeteer/src/getConfiguration.ts
generated
vendored
Normal file
@ -0,0 +1,118 @@
|
||||
/**
|
||||
* @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';
|
||||
|
||||
/**
|
||||
* @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').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(
|
||||
process.env['PUPPETEER_SKIP_DOWNLOAD'] ??
|
||||
process.env['npm_config_puppeteer_skip_download'] ??
|
||||
process.env['npm_package_config_puppeteer_skip_download'] ??
|
||||
configuration.skipDownload
|
||||
);
|
||||
|
||||
// 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;
|
||||
};
|
||||
31
Scripts/node_modules/puppeteer/src/node/cli.ts
generated
vendored
Normal file
31
Scripts/node_modules/puppeteer/src/node/cli.ts
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
#!/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,
|
||||
},
|
||||
}).run(process.argv);
|
||||
121
Scripts/node_modules/puppeteer/src/node/install.ts
generated
vendored
Normal file
121
Scripts/node_modules/puppeteer/src/node/install.ts
generated
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
/**
|
||||
* @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 buildId = await resolveBuildId(browser, platform, unresolvedBuildId);
|
||||
// TODO: deprecate downloadPath in favour of cacheDirectory.
|
||||
const cacheDir = configuration.downloadPath ?? configuration.cacheDirectory!;
|
||||
|
||||
try {
|
||||
const result = await install({
|
||||
browser,
|
||||
cacheDir,
|
||||
platform,
|
||||
buildId,
|
||||
downloadProgressCallback: makeProgressCallback(browser, buildId),
|
||||
baseUrl: downloadBaseUrl,
|
||||
});
|
||||
|
||||
logPolitely(
|
||||
`${supportedProducts[product]} (${result.buildId}) downloaded to ${result.path}`
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(
|
||||
`ERROR: Failed to set up ${supportedProducts[product]} r${buildId}! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.`
|
||||
);
|
||||
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
Scripts/node_modules/puppeteer/src/puppeteer.ts
generated
vendored
Normal file
48
Scripts/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
Scripts/node_modules/puppeteer/src/tsconfig.cjs.json
generated
vendored
Normal file
8
Scripts/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
Scripts/node_modules/puppeteer/src/tsconfig.esm.json
generated
vendored
Normal file
6
Scripts/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