@sparticuz/chromium
Advanced tools
Comparing version 119.0.0 to 119.0.1-next.0
@@ -9,2 +9,3 @@ export declare const isValidUrl: (input: string) => boolean; | ||
export declare const isRunningInAwsLambda: () => boolean; | ||
export declare const isRunningInAwsLambdaNode20: () => boolean; | ||
export declare const downloadAndExtract: (url: string) => Promise<string>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.downloadAndExtract = exports.isRunningInAwsLambda = exports.isValidUrl = void 0; | ||
exports.downloadAndExtract = exports.isRunningInAwsLambdaNode20 = exports.isRunningInAwsLambda = exports.isValidUrl = void 0; | ||
const node_fs_1 = require("node:fs"); | ||
@@ -26,7 +26,7 @@ const follow_redirects_1 = require("follow-redirects"); | ||
if (process.env["AWS_EXECUTION_ENV"] && | ||
/^AWS_Lambda_nodejs/.test(process.env["AWS_EXECUTION_ENV"]) === true) { | ||
process.env["AWS_EXECUTION_ENV"].includes("AWS_Lambda_nodejs")) { | ||
return true; | ||
} | ||
else if (process.env["AWS_LAMBDA_JS_RUNTIME"] && | ||
/^nodejs/.test(process.env["AWS_LAMBDA_JS_RUNTIME"]) === true) { | ||
process.env["AWS_LAMBDA_JS_RUNTIME"].includes("nodejs")) { | ||
return true; | ||
@@ -37,2 +37,10 @@ } | ||
exports.isRunningInAwsLambda = isRunningInAwsLambda; | ||
const isRunningInAwsLambdaNode20 = () => { | ||
if (process.env["AWS_EXECUTION_ENV"] && | ||
process.env["AWS_EXECUTION_ENV"].includes("20.x")) { | ||
return true; | ||
} | ||
return false; | ||
}; | ||
exports.isRunningInAwsLambdaNode20 = isRunningInAwsLambdaNode20; | ||
const downloadAndExtract = async (url) => new Promise((resolve, reject) => { | ||
@@ -39,0 +47,0 @@ const getOptions = (0, node_url_1.parse)(url); |
@@ -22,2 +22,3 @@ "use strict"; | ||
"/tmp/aws/lib", | ||
(0, helper_1.isRunningInAwsLambdaNode20)() ? "/tmp/al2023/lib" : undefined, | ||
...process.env["LD_LIBRARY_PATH"].split(":"), | ||
@@ -131,9 +132,9 @@ ]), | ||
const chromiumFlags = [ | ||
"--disable-domain-reliability", | ||
"--disable-print-preview", | ||
"--disable-speech-api", | ||
"--disk-cache-size=33554432", | ||
"--mute-audio", | ||
"--no-default-browser-check", | ||
"--no-pings", | ||
"--disable-domain-reliability", // https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md#background-networking | ||
"--disable-print-preview", // https://source.chromium.org/search?q=lang:cpp+symbol:kDisablePrintPreview&ss=chromium | ||
"--disable-speech-api", // https://source.chromium.org/search?q=lang:cpp+symbol:kDisableSpeechAPI&ss=chromium | ||
"--disk-cache-size=33554432", // https://source.chromium.org/search?q=lang:cpp+symbol:kDiskCacheSize&ss=chromium | ||
"--mute-audio", // https://source.chromium.org/search?q=lang:cpp+symbol:kMuteAudio&ss=chromium | ||
"--no-default-browser-check", // https://source.chromium.org/search?q=lang:cpp+symbol:kNoDefaultBrowserCheck&ss=chromium | ||
"--no-pings", // https://source.chromium.org/search?q=lang:cpp+symbol:kNoPings&ss=chromium | ||
"--single-process", // Needs to be single-process to avoid `prctl(PR_SET_NO_NEW_PRIVS) failed` error | ||
@@ -148,5 +149,5 @@ ]; | ||
const graphicsFlags = [ | ||
"--hide-scrollbars", | ||
"--ignore-gpu-blocklist", | ||
"--in-process-gpu", | ||
"--hide-scrollbars", // https://source.chromium.org/search?q=lang:cpp+symbol:kHideScrollbars&ss=chromium | ||
"--ignore-gpu-blocklist", // https://source.chromium.org/search?q=lang:cpp+symbol:kIgnoreGpuBlocklist&ss=chromium | ||
"--in-process-gpu", // https://source.chromium.org/search?q=lang:cpp+symbol:kInProcessGPU&ss=chromium | ||
"--window-size=1920,1080", // https://source.chromium.org/search?q=lang:cpp+symbol:kWindowSize&ss=chromium | ||
@@ -159,7 +160,7 @@ ]; | ||
const insecureFlags = [ | ||
"--allow-running-insecure-content", | ||
"--disable-setuid-sandbox", | ||
"--disable-site-isolation-trials", | ||
"--disable-web-security", | ||
"--no-sandbox", | ||
"--allow-running-insecure-content", // https://source.chromium.org/search?q=lang:cpp+symbol:kAllowRunningInsecureContent&ss=chromium | ||
"--disable-setuid-sandbox", // https://source.chromium.org/search?q=lang:cpp+symbol:kDisableSetuidSandbox&ss=chromium | ||
"--disable-site-isolation-trials", // https://source.chromium.org/search?q=lang:cpp+symbol:kDisableSiteIsolation&ss=chromium | ||
"--disable-web-security", // https://source.chromium.org/search?q=lang:cpp+symbol:kDisableWebSecurity&ss=chromium | ||
"--no-sandbox", // https://source.chromium.org/search?q=lang:cpp+symbol:kNoSandbox&ss=chromium | ||
"--no-zygote", // https://source.chromium.org/search?q=lang:cpp+symbol:kNoZygote&ss=chromium | ||
@@ -240,2 +241,5 @@ ]; | ||
promises.push(lambdafs_1.default.inflate(`${input}/aws.tar.br`)); | ||
if ((0, helper_1.isRunningInAwsLambdaNode20)()) { | ||
promises.push(lambdafs_1.default.inflate(`${input}/al2023.tar.br`)); | ||
} | ||
} | ||
@@ -242,0 +246,0 @@ // Await all extractions |
{ | ||
"name": "@sparticuz/chromium", | ||
"version": "119.0.0", | ||
"version": "119.0.1-next.0", | ||
"description": "Chromium Binary for Serverless Platforms", | ||
@@ -46,6 +46,6 @@ "keywords": [ | ||
"@types/follow-redirects": "^1.14.4", | ||
"@types/node": "^18.18.9", | ||
"@types/node": "^18.18.11", | ||
"@types/tar-fs": "^2.0.4", | ||
"clean-modules": "^3.0.4", | ||
"typescript": "^5.2.2" | ||
"typescript": "^5.3.2" | ||
}, | ||
@@ -52,0 +52,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60362611
13
540
1
18
4