@depup/puppeteer 24.40.0-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +33 -0
  2. package/changes.json +18 -0
  3. package/install.mjs +43 -0
  4. package/lib/cjs/puppeteer/getConfiguration.d.ts +11 -0
  5. package/lib/cjs/puppeteer/getConfiguration.d.ts.map +1 -0
  6. package/lib/cjs/puppeteer/getConfiguration.js +126 -0
  7. package/lib/cjs/puppeteer/getConfiguration.js.map +1 -0
  8. package/lib/cjs/puppeteer/node/cli.d.ts +8 -0
  9. package/lib/cjs/puppeteer/node/cli.d.ts.map +1 -0
  10. package/lib/cjs/puppeteer/node/cli.js +51 -0
  11. package/lib/cjs/puppeteer/node/cli.js.map +1 -0
  12. package/lib/cjs/puppeteer/node/install.d.ts +10 -0
  13. package/lib/cjs/puppeteer/node/install.d.ts.map +1 -0
  14. package/lib/cjs/puppeteer/node/install.js +122 -0
  15. package/lib/cjs/puppeteer/node/install.js.map +1 -0
  16. package/lib/cjs/puppeteer/puppeteer.d.ts +38 -0
  17. package/lib/cjs/puppeteer/puppeteer.d.ts.map +1 -0
  18. package/lib/cjs/puppeteer/puppeteer.js +56 -0
  19. package/lib/cjs/puppeteer/puppeteer.js.map +1 -0
  20. package/lib/esm/package.json +1 -0
  21. package/lib/esm/puppeteer/getConfiguration.d.ts +11 -0
  22. package/lib/esm/puppeteer/getConfiguration.d.ts.map +1 -0
  23. package/lib/esm/puppeteer/getConfiguration.js +122 -0
  24. package/lib/esm/puppeteer/getConfiguration.js.map +1 -0
  25. package/lib/esm/puppeteer/node/cli.d.ts +8 -0
  26. package/lib/esm/puppeteer/node/cli.d.ts.map +1 -0
  27. package/lib/esm/puppeteer/node/cli.js +46 -0
  28. package/lib/esm/puppeteer/node/cli.js.map +1 -0
  29. package/lib/esm/puppeteer/node/install.d.ts +10 -0
  30. package/lib/esm/puppeteer/node/install.d.ts.map +1 -0
  31. package/lib/esm/puppeteer/node/install.js +119 -0
  32. package/lib/esm/puppeteer/node/install.js.map +1 -0
  33. package/lib/esm/puppeteer/puppeteer.d.ts +38 -0
  34. package/lib/esm/puppeteer/puppeteer.d.ts.map +1 -0
  35. package/lib/esm/puppeteer/puppeteer.js +40 -0
  36. package/lib/esm/puppeteer/puppeteer.js.map +1 -0
  37. package/lib/types.d.ts +80 -0
  38. package/package.json +171 -0
  39. package/src/getConfiguration.ts +166 -0
  40. package/src/node/cli.ts +61 -0
  41. package/src/node/install.ts +167 -0
  42. package/src/puppeteer.ts +47 -0
  43. package/src/tsconfig.cjs.json +8 -0
  44. package/src/tsconfig.esm.json +6 -0
@@ -0,0 +1,122 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google Inc.
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { homedir } from 'node:os';
7
+ import { join } from 'node:path';
8
+ import { cosmiconfigSync } from 'cosmiconfig';
9
+ function getBooleanEnvVar(name) {
10
+ const env = process.env[name];
11
+ if (env === undefined) {
12
+ return;
13
+ }
14
+ switch (env.toLowerCase()) {
15
+ case '':
16
+ case '0':
17
+ case 'false':
18
+ case 'off':
19
+ return false;
20
+ default:
21
+ return true;
22
+ }
23
+ }
24
+ /**
25
+ * @internal
26
+ */
27
+ function isSupportedBrowser(product) {
28
+ switch (product) {
29
+ case 'chrome':
30
+ case 'firefox':
31
+ return true;
32
+ default:
33
+ return false;
34
+ }
35
+ }
36
+ /**
37
+ * @internal
38
+ */
39
+ function getDefaultBrowser(browser) {
40
+ // Validate configuration.
41
+ if (browser && !isSupportedBrowser(browser)) {
42
+ throw new Error(`Unsupported browser ${browser}`);
43
+ }
44
+ switch (browser) {
45
+ case 'firefox':
46
+ return 'firefox';
47
+ default:
48
+ return 'chrome';
49
+ }
50
+ }
51
+ /**
52
+ * @internal
53
+ */
54
+ function getLogLevel(logLevel) {
55
+ switch (logLevel) {
56
+ case 'silent':
57
+ return 'silent';
58
+ case 'error':
59
+ return 'error';
60
+ default:
61
+ return 'warn';
62
+ }
63
+ }
64
+ function getBrowserSetting(browser, configuration, defaultConfig = {}) {
65
+ if (configuration.skipDownload) {
66
+ return {
67
+ skipDownload: true,
68
+ };
69
+ }
70
+ const browserSetting = {};
71
+ const browserEnvName = browser.replaceAll('-', '_').toUpperCase();
72
+ browserSetting.version =
73
+ process.env[`PUPPETEER_${browserEnvName}_VERSION`] ??
74
+ configuration[browser]?.version ??
75
+ defaultConfig.version;
76
+ browserSetting.downloadBaseUrl =
77
+ process.env[`PUPPETEER_${browserEnvName}_DOWNLOAD_BASE_URL`] ??
78
+ configuration[browser]?.downloadBaseUrl ??
79
+ defaultConfig.downloadBaseUrl;
80
+ browserSetting.skipDownload =
81
+ getBooleanEnvVar(`PUPPETEER_${browserEnvName}_SKIP_DOWNLOAD`) ??
82
+ getBooleanEnvVar(`PUPPETEER_SKIP_${browserEnvName}_DOWNLOAD`) ??
83
+ configuration[browser]?.skipDownload ??
84
+ defaultConfig.skipDownload;
85
+ return browserSetting;
86
+ }
87
+ /**
88
+ * @internal
89
+ */
90
+ export const getConfiguration = () => {
91
+ const result = cosmiconfigSync('puppeteer', {
92
+ searchStrategy: 'global',
93
+ }).search();
94
+ const configuration = result ? { ...result.config } : {};
95
+ configuration.logLevel = getLogLevel(process.env['PUPPETEER_LOGLEVEL'] ?? configuration.logLevel);
96
+ // Merging environment variables.
97
+ configuration.defaultBrowser = getDefaultBrowser(process.env['PUPPETEER_BROWSER'] ?? configuration.defaultBrowser);
98
+ configuration.executablePath =
99
+ process.env['PUPPETEER_EXECUTABLE_PATH'] ?? configuration.executablePath;
100
+ // Default to skipDownload if executablePath is set
101
+ if (configuration.executablePath) {
102
+ configuration.skipDownload = true;
103
+ }
104
+ // Set skipDownload explicitly or from default
105
+ configuration.skipDownload =
106
+ getBooleanEnvVar('PUPPETEER_SKIP_DOWNLOAD') ?? configuration.skipDownload;
107
+ // Prepare variables used in browser downloading
108
+ configuration.chrome = getBrowserSetting('chrome', configuration);
109
+ configuration['chrome-headless-shell'] = getBrowserSetting('chrome-headless-shell', configuration);
110
+ configuration.firefox = getBrowserSetting('firefox', configuration, {
111
+ skipDownload: true,
112
+ });
113
+ configuration.cacheDirectory =
114
+ process.env['PUPPETEER_CACHE_DIR'] ??
115
+ configuration.cacheDirectory ??
116
+ join(homedir(), '.cache', 'puppeteer');
117
+ configuration.temporaryDirectory =
118
+ process.env['PUPPETEER_TMP_DIR'] ?? configuration.temporaryDirectory;
119
+ configuration.experiments ??= {};
120
+ return configuration;
121
+ };
122
+ //# sourceMappingURL=getConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getConfiguration.js","sourceRoot":"","sources":["../../../src/getConfiguration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/B,OAAO,EAAC,eAAe,EAAC,MAAM,aAAa,CAAC;AAS5C,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;AACH,SAAS,iBAAiB,CAAC,O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AI;KACnB,CAAC,CAAC;IAEH,aAAa,CAAC,cAAc;QAC1B,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;YAClC,aAAa,CAAC,cAAc;YAC5B,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;IAEzC,aAAa,CAAC,kBAAkB;QAC9B,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,aAAa,CAAC,kBAAkB,CAAC;IAEvE,aAAa,CAAC,WAAW,KAAK,EAAE,CAAC;IAEjC,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @license
4
+ * Copyright 2023 Google Inc.
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../src/node/cli.ts"],"names":[],"mappings":";AAEA;;;;GAIG"}
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @license
4
+ * Copyright 2023 Google Inc.
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */
7
+ import { CLI, Browser } from '@puppeteer/browsers';
8
+ import { PUPPETEER_REVISIONS } from 'puppeteer-core/internal/revisions.js';
9
+ import { packageVersion } from 'puppeteer-core/internal/util/version.js';
10
+ import puppeteer from '../puppeteer.js';
11
+ const cacheDir = puppeteer.configuration
12
+ .cacheDirectory;
13
+ void new CLI({
14
+ cachePath: cacheDir,
15
+ scriptName: 'puppeteer',
16
+ version: packageVersion,
17
+ prefixCommand: {
18
+ cmd: 'browsers',
19
+ description: 'Manage browsers of this Puppeteer installation',
20
+ },
21
+ allowCachePathOverride: false,
22
+ pinnedBrowsers: {
23
+ [Browser.CHROME]: {
24
+ buildId: puppeteer.configuration.chrome?.version ||
25
+ PUPPETEER_REVISIONS['chrome'] ||
26
+ 'latest',
27
+ skipDownload: puppeteer.configuration.chrome
28
+ ?.skipDownload ?? false,
29
+ },
30
+ [Browser.FIREFOX]: {
31
+ buildId: puppeteer.configuration.firefox
32
+ ?.version ||
33
+ PUPPETEER_REVISIONS['firefox'] ||
34
+ 'latest',
35
+ skipDownload: puppeteer.configuration.firefox
36
+ ?.skipDownload ?? true,
37
+ },
38
+ [Browser.CHROMEHEADLESSSHELL]: {
39
+ buildId: puppeteer.configuration['chrome-headless-shell']?.version ||
40
+ PUPPETEER_REVISIONS['chrome-headless-shell'] ||
41
+ 'latest',
42
+ skipDownload: puppeteer.configuration['chrome-headless-shell']?.skipDownload ?? false,
43
+ },
44
+ },
45
+ }).run(process.argv);
46
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
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;AAEjD,OAAO,EAAC,mBAAmB,EAAC,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAC,cAAc,EAAC,MAAM,yCAAyC,CAAC;AAEvE,OAAO,SAAS,MAAM,iBAAiB,CAAC;AAExC,MAAM,QAAQ,GAAI,SAAsC,CAAC,aAAa;KACnE,cAAe,CAAC;AAEnB,KAAK,IAAI,GAAG,CAAC;IACX,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE,WAAW;IACvB,OAAO,EAAE,cAAc;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;YAChB,OAAO,EACJ,SAAsC,CAAC,aAAa,CAAC,MAAM,EAAE,OAAO;gBACrE,mBAAmB,CAAC,QAAQ,CAAC;gBAC7B,QAAQ;YACV,YAAY,EACT,SAAsC,CAAC,aAAa,CAAC,MAAM;gBAC1D,EAAE,YAAY,IAAI,KAAK;SAC5B;QACD,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YACjB,OAAO,EACJ,SAAsC,CAAC,aAAa,CAAC,OAAO;gBAC3D,EAAE,OAAO;gBACX,mBAAmB,CAAC,SAAS,CAAC;gBAC9B,QAAQ;YACV,YAAY,EACT,SAAsC,CAAC,aAAa,CAAC,OAAO;gBAC3D,EAAE,YAAY,IAAI,IAAI;SAC3B;QACD,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAE;YAC7B,OAAO,EACJ,SAAsC,CAAC,aAAa,CACnD,uBAAuB,CACxB,EAAE,OAAO;gBACV,mBAAmB,CAAC,uBAAuB,CAAC;gBAC5C,QAAQ;YACV,YAAY,EACT,SAAsC,CAAC,aAAa,CACnD,uBAAuB,CACxB,EAAE,YAAY,IAAI,KAAK;SAC3B;KACF;CACF,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 Google Inc.
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /**
7
+ * @internal
8
+ */
9
+ export declare function downloadBrowsers(): Promise<void>;
10
+ //# sourceMappingURL=install.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../../src/node/install.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA2DH;;GAEG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAkEtD"}
@@ -0,0 +1,119 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 Google Inc.
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { install, Browser, resolveBuildId, detectBrowserPlatform, } from '@puppeteer/browsers';
7
+ import { PUPPETEER_REVISIONS } from 'puppeteer-core/internal/revisions.js';
8
+ import { getConfiguration } from '../getConfiguration.js';
9
+ async function downloadBrowser({ browser, configuration, cacheDir, platform, }) {
10
+ const unresolvedBuildId = configuration?.version || PUPPETEER_REVISIONS[browser] || 'latest';
11
+ const baseUrl = configuration?.downloadBaseUrl;
12
+ const buildId = await resolveBuildId(browser, platform, unresolvedBuildId);
13
+ try {
14
+ const result = await install({
15
+ browser,
16
+ cacheDir,
17
+ platform,
18
+ buildId,
19
+ downloadProgressCallback: 'default',
20
+ baseUrl,
21
+ buildIdAlias: buildId !== unresolvedBuildId ? unresolvedBuildId : undefined,
22
+ });
23
+ logPolitely(`${browser} (${result.buildId}) downloaded to ${result.path}`);
24
+ }
25
+ catch (error) {
26
+ throw new Error(`ERROR: Failed to set up ${browser} v${buildId}! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.`, {
27
+ cause: error,
28
+ });
29
+ }
30
+ }
31
+ /**
32
+ * @internal
33
+ */
34
+ export async function downloadBrowsers() {
35
+ overrideProxy();
36
+ const configuration = getConfiguration();
37
+ if (configuration.skipDownload) {
38
+ logPolitely('**INFO** Skipping downloading browsers as instructed.');
39
+ return;
40
+ }
41
+ const platform = detectBrowserPlatform();
42
+ if (!platform) {
43
+ throw new Error('The current platform is not supported.');
44
+ }
45
+ const cacheDir = configuration.cacheDirectory;
46
+ const installationJobs = [];
47
+ if (configuration.chrome?.skipDownload) {
48
+ logPolitely('**INFO** Skipping Chrome download as instructed.');
49
+ }
50
+ else {
51
+ const browser = Browser.CHROME;
52
+ installationJobs.push(downloadBrowser({
53
+ browser,
54
+ configuration: configuration[browser] ?? {},
55
+ cacheDir,
56
+ platform,
57
+ }));
58
+ }
59
+ if (configuration['chrome-headless-shell']?.skipDownload) {
60
+ logPolitely('**INFO** Skipping Chrome download as instructed.');
61
+ }
62
+ else {
63
+ const browser = Browser.CHROMEHEADLESSSHELL;
64
+ installationJobs.push(downloadBrowser({
65
+ browser,
66
+ configuration: configuration[browser] ?? {},
67
+ cacheDir,
68
+ platform,
69
+ }));
70
+ }
71
+ if (configuration.firefox?.skipDownload) {
72
+ logPolitely('**INFO** Skipping Firefox download as instructed.');
73
+ }
74
+ else {
75
+ const browser = Browser.FIREFOX;
76
+ installationJobs.push(downloadBrowser({
77
+ browser,
78
+ configuration: configuration[browser] ?? {},
79
+ cacheDir,
80
+ platform,
81
+ }));
82
+ }
83
+ try {
84
+ await Promise.all(installationJobs);
85
+ }
86
+ catch (error) {
87
+ console.error(error);
88
+ process.exit(1);
89
+ }
90
+ }
91
+ /**
92
+ * @internal
93
+ */
94
+ function logPolitely(toBeLogged) {
95
+ const logLevel = process.env['npm_config_loglevel'] || '';
96
+ const logLevelDisplay = ['silent', 'error', 'warn'].indexOf(logLevel) > -1;
97
+ if (!logLevelDisplay) {
98
+ console.log(toBeLogged);
99
+ }
100
+ }
101
+ /**
102
+ * @internal
103
+ */
104
+ function overrideProxy() {
105
+ // Override current environment proxy settings with npm configuration, if any.
106
+ const NPM_HTTPS_PROXY = process.env['npm_config_https_proxy'] || process.env['npm_config_proxy'];
107
+ const NPM_HTTP_PROXY = process.env['npm_config_http_proxy'] || process.env['npm_config_proxy'];
108
+ const NPM_NO_PROXY = process.env['npm_config_no_proxy'];
109
+ if (NPM_HTTPS_PROXY) {
110
+ process.env['HTTPS_PROXY'] = NPM_HTTPS_PROXY;
111
+ }
112
+ if (NPM_HTTP_PROXY) {
113
+ process.env['HTTP_PROXY'] = NPM_HTTP_PROXY;
114
+ }
115
+ if (NPM_NO_PROXY) {
116
+ process.env['NO_PROXY'] = NPM_NO_PROXY;
117
+ }
118
+ }
119
+ //# sourceMappingURL=install.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install.js","sourceRoot":"","sources":["../../../../src/node/install.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,OAAO,EACP,OAAO,EACP,cAAc,EACd,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EAAC,mBAAmB,EAAC,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAC,gBAAgB,E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core';
7
+ import { PuppeteerNode } from 'puppeteer-core';
8
+ /**
9
+ * @public
10
+ */
11
+ declare const puppeteer: PuppeteerNode;
12
+ export declare const
13
+ /**
14
+ * @public
15
+ */
16
+ connect: (options: import("puppeteer-core").ConnectOptions) => Promise<import("puppeteer-core").Browser>,
17
+ /**
18
+ * @public
19
+ */
20
+ defaultArgs: (options?: import("puppeteer-core").LaunchOptions) => string[],
21
+ /**
22
+ * @public
23
+ */
24
+ executablePath: {
25
+ (channel: import("puppeteer-core").ChromeReleaseChannel): string;
26
+ (options: import("puppeteer-core").LaunchOptions): string;
27
+ (): string;
28
+ },
29
+ /**
30
+ * @public
31
+ */
32
+ launch: (options?: import("puppeteer-core").LaunchOptions) => Promise<import("puppeteer-core").Browser>,
33
+ /**
34
+ * @public
35
+ */
36
+ trimCache: () => Promise<void>;
37
+ export default puppeteer;
38
+ //# sourceMappingURL=puppeteer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"puppeteer.d.ts","sourceRoot":"","sources":["../../../src/puppeteer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAM7C;;GAEG;AAEH,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"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2017 Google Inc.
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export * from 'puppeteer-core';
7
+ import { PuppeteerNode } from 'puppeteer-core';
8
+ import { getConfiguration } from './getConfiguration.js';
9
+ const configuration = getConfiguration();
10
+ /**
11
+ * @public
12
+ */
13
+ // @ts-expect-error using internal API.
14
+ const puppeteer = new PuppeteerNode({
15
+ isPuppeteerCore: false,
16
+ configuration,
17
+ });
18
+ export const {
19
+ /**
20
+ * @public
21
+ */
22
+ connect,
23
+ /**
24
+ * @public
25
+ */
26
+ defaultArgs,
27
+ /**
28
+ * @public
29
+ */
30
+ executablePath,
31
+ /**
32
+ * @public
33
+ */
34
+ launch,
35
+ /**
36
+ * @public
37
+ */
38
+ trimCache, } = puppeteer;
39
+ export default puppeteer;
40
+ //# sourceMappingURL=puppeteer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"puppeteer.js","sourceRoot":"","sources":["../../../src/puppeteer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AAEvD,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;AAEzC;;GAEG;AACH,uCAAuC;AACvC,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"}
package/lib/types.d.ts ADDED
@@ -0,0 +1,80 @@
1
+ import { Browser } from 'puppeteer-core';
2
+ import { ChromeReleaseChannel } from 'puppeteer-core';
3
+ import { ConnectOptions } from 'puppeteer-core';
4
+ import { LaunchOptions } from 'puppeteer-core';
5
+ import { PuppeteerNode } from 'puppeteer-core';
6
+
7
+ /**
8
+ * @public
9
+ */
10
+ export declare const
11
+ /**
12
+ * @public
13
+ */
14
+ /**
15
+ * @public
16
+ */
17
+ connect: (options: ConnectOptions) => Promise<Browser>;
18
+
19
+ /**
20
+ * @public
21
+ */
22
+ export declare const
23
+ /**
24
+ * @public
25
+ */
26
+ /**
27
+ * @public
28
+ */
29
+ defaultArgs: (options?: LaunchOptions) => string[];
30
+
31
+ /**
32
+ * @public
33
+ */
34
+ export declare const
35
+ /**
36
+ * @public
37
+ */
38
+ /**
39
+ * @public
40
+ */
41
+ executablePath: {
42
+ (channel: ChromeReleaseChannel): string;
43
+ (options: LaunchOptions): string;
44
+ (): string;
45
+ };
46
+
47
+ /**
48
+ * @public
49
+ */
50
+ export declare const
51
+ /**
52
+ * @public
53
+ */
54
+ /**
55
+ * @public
56
+ */
57
+ launch: (options?: LaunchOptions) => Promise<Browser>;
58
+
59
+ /**
60
+ * @public
61
+ */
62
+ declare const puppeteer: PuppeteerNode;
63
+ export default puppeteer;
64
+
65
+ /**
66
+ * @public
67
+ */
68
+ export declare const
69
+ /**
70
+ * @public
71
+ */
72
+ /**
73
+ * @public
74
+ */
75
+ trimCache: () => Promise<void>;
76
+
77
+
78
+ export * from "puppeteer-core";
79
+
80
+ export { }
package/package.json ADDED
@@ -0,0 +1,171 @@
1
+ {
2
+ "name": "@depup/puppeteer",
3
+ "version": "24.40.0-depup.0",
4
+ "description": "A high-level API to control headless Chrome over the DevTools Protocol (with updated dependencies)",
5
+ "keywords": [
6
+ "puppeteer",
7
+ "depup",
8
+ "updated-dependencies",
9
+ "security",
10
+ "latest",
11
+ "patched",
12
+ "chrome",
13
+ "headless",
14
+ "automation"
15
+ ],
16
+ "type": "commonjs",
17
+ "bin": "./lib/cjs/puppeteer/node/cli.js",
18
+ "main": "./lib/cjs/puppeteer/puppeteer.js",
19
+ "module": "./lib/esm/puppeteer/puppeteer.js",
20
+ "types": "./lib/types.d.ts",
21
+ "exports": {
22
+ ".": {
23
+ "types": "./lib/types.d.ts",
24
+ "import": "./lib/esm/puppeteer/puppeteer.js",
25
+ "require": "./lib/cjs/puppeteer/puppeteer.js"
26
+ },
27
+ "./internal/*": {
28
+ "import": "./lib/esm/puppeteer/*",
29
+ "require": "./lib/cjs/puppeteer/*"
30
+ },
31
+ "./*": {
32
+ "import": "./*",
33
+ "require": "./*"
34
+ }
35
+ },
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "https://github.com/puppeteer/puppeteer/tree/main/packages/puppeteer"
39
+ },
40
+ "engines": {
41
+ "node": ">=18"
42
+ },
43
+ "scripts": {
44
+ "build:docs": "wireit",
45
+ "build": "wireit",
46
+ "clean": "../../tools/clean.mjs"
47
+ },
48
+ "wireit": {
49
+ "prepack": {
50
+ "command": "node --experimental-strip-types ../../tools/cp.ts ../../README.md README.md",
51
+ "files": [
52
+ "../../README.md"
53
+ ],
54
+ "output": [
55
+ "README.md"
56
+ ]
57
+ },
58
+ "build": {
59
+ "dependencies": [
60
+ "build:tsc",
61
+ "build:types",
62
+ "generate:package-json"
63
+ ]
64
+ },
65
+ "generate:package-json": {
66
+ "command": "node --experimental-strip-types ../../tools/generate_module_package_json.ts lib/esm/package.json",
67
+ "files": [
68
+ "../../tools/generate_module_package_json.ts"
69
+ ],
70
+ "dependencies": [
71
+ "build:tsc"
72
+ ],
73
+ "output": [
74
+ "lib/esm/package.json"
75
+ ]
76
+ },
77
+ "build:docs": {
78
+ "command": "api-extractor run --local --config \"./api-extractor.docs.json\"",
79
+ "files": [
80
+ "api-extractor.docs.json",
81
+ "lib/esm/puppeteer/puppeteer.docs.d.ts",
82
+ "tsconfig.json"
83
+ ],
84
+ "dependencies": [
85
+ "build:tsc"
86
+ ]
87
+ },
88
+ "build:tsc": {
89
+ "command": "tsc -b && node --experimental-strip-types ../../tools/chmod.ts 755 lib/cjs/puppeteer/node/cli.js lib/esm/puppeteer/node/cli.js",
90
+ "clean": "if-file-deleted",
91
+ "dependencies": [
92
+ "../puppeteer-core:build",
93
+ "../browsers:build"
94
+ ],
95
+ "files": [
96
+ "src/**"
97
+ ],
98
+ "output": [
99
+ "lib/{cjs,esm}/**",
100
+ "!lib/esm/package.json"
101
+ ]
102
+ },
103
+ "build:types": {
104
+ "command": "api-extractor run --local && eslint --cache-location .eslintcache --cache --no-ignore --no-config-lookup -c=../../eslint.types.config.mjs --fix lib/types.d.ts",
105
+ "files": [
106
+ "../../eslint.types.config.mjs",
107
+ "api-extractor.json",
108
+ "lib/esm/puppeteer/types.d.ts",
109
+ "tsconfig.json"
110
+ ],
111
+ "output": [
112
+ "lib/types.d.ts"
113
+ ],
114
+ "dependencies": [
115
+ "build:tsc"
116
+ ]
117
+ }
118
+ },
119
+ "files": [
120
+ "lib",
121
+ "src",
122
+ "install.mjs",
123
+ "!*.test.ts",
124
+ "!*.test.js",
125
+ "!*.test.d.ts",
126
+ "!*.test.js.map",
127
+ "!*.test.d.ts.map",
128
+ "!*.docs.ts",
129
+ "!*.docs.js",
130
+ "!*.docs.d.ts",
131
+ "!*.docs.js.map",
132
+ "!*.docs.d.ts.map",
133
+ "!*.tsbuildinfo",
134
+ "changes.json",
135
+ "README.md"
136
+ ],
137
+ "author": "The Chromium Authors",
138
+ "license": "Apache-2.0",
139
+ "dependencies": {
140
+ "@puppeteer/browsers": "2.13.0",
141
+ "chromium-bidi": "^15.0.0",
142
+ "cosmiconfig": "^9.0.1",
143
+ "devtools-protocol": "^0.0.1601756",
144
+ "puppeteer-core": "24.40.0",
145
+ "typed-query-selector": "^2.12.1"
146
+ },
147
+ "devDependencies": {
148
+ "@types/node": "^18.17.15"
149
+ },
150
+ "depup": {
151
+ "changes": {
152
+ "chromium-bidi": {
153
+ "from": "14.0.0",
154
+ "to": "^15.0.0"
155
+ },
156
+ "cosmiconfig": {
157
+ "from": "^9.0.0",
158
+ "to": "^9.0.1"
159
+ },
160
+ "devtools-protocol": {
161
+ "from": "0.0.1581282",
162
+ "to": "^0.0.1601756"
163
+ }
164
+ },
165
+ "depsUpdated": 3,
166
+ "originalPackage": "puppeteer",
167
+ "originalVersion": "24.40.0",
168
+ "processedAt": "2026-03-19T16:27:31.311Z",
169
+ "smokeTest": "passed"
170
+ }
171
+ }