
Product
Rubygems Ecosystem Support Now Generally Available
Socket's Rubygems ecosystem support is moving from beta to GA, featuring enhanced security scanning to detect supply chain threats beyond traditional CVEs in your Ruby dependencies.
puppeteer-chromium-resolver
Advanced tools
Tool to resolve puppeteer and chromium faster, detect local installed chromium, download chromium with custom mirror host, cache chromium revision out of node_modules, test chromium headless being launchable.
Tool to resolve puppeteer and chromium faster, detect local installed chromium, download chromium with custom mirror host, cache chromium revision out of node_modules, test chromium headless being launchable.
npm i puppeteer-chromium-resolver
const PCR = require("puppeteer-chromium-resolver");
const options = {};
const stats = await PCR(options);
const browser = await stats.puppeteer.launch({
headless: false,
args: ["--no-sandbox"],
executablePath: stats.executablePath
}).catch(function(error) {
console.log(error);
});
const page = await browser.newPage();
await page.goto("https://www.npmjs.com/package/puppeteer-chromium-resolver");
await browser.close();
const PCR = require("puppeteer-chromium-resolver");
const options = {};
const stats = PCR.getStats(options);
if (stats) {
stats.puppeteer.launch({
headless: false,
args: ["--no-sandbox"],
executablePath: stats.executablePath
}).then(function(browser){
//...
}).catch(function(error) {
console.log(error);
});
}
const options = {
// the chromium revision to use
// default is puppeteer.PUPPETEER_REVISIONS.chromium
// or you can use PUPPETEER_REVISION environment variable
revision: '',
// additional path to detect local chromium copy (separate with a comma if multiple paths)
detectionPath: '',
// custom path to download chromium to local, require dir permission: 0o777
// default is user home dir
downloadPath: '',
// the folder name for chromium snapshots (maybe there are multiple versions)
folderName: '.chromium-browser-snapshots',
// the stats file name, cache stats info for latest installation
statsName: '.pcr-stats.json',
// default hosts are ['https://storage.googleapis.com']
// or you can use PUPPETEER_DEFAULT_HOST environment variable
hosts: [],
cacheRevisions: 2,
retry: 3,
silent: false
};
see lib/options.js
{
// ...
"pcr": {
"revision": "1138907"
}
}
Property | Type | |
---|---|---|
revision | String | current chromium revision |
executablePath | String | chromium executable path |
chromiumVersion | String | chromium version |
launchable | Boolean | chromium launchable |
puppeteerVersion | String | puppeteer version |
puppeteer | Object | puppeteer module |
see test/test.js
PUPPETEER_SKIP_DOWNLOAD=true
(async () => {
const PCR = require("puppeteer-chromium-resolver");
const puppeteer = require("puppeteer");
const stats = await PCR({});
//update global env
process.env.PUPPETEER_EXECUTABLE_PATH = stats.executablePath;
//or specify executablePath
const browser = await puppeteer.launch({
executablePath: stats.executablePath,
headless: false
});
})();
# Install dependencies:
yum install -y alsa-lib.x86_64 \
atk.x86_64 \
cups-libs.x86_64 \
gtk3.x86_64 \
ipa-gothic-fonts \
libXcomposite.x86_64 \
libXcursor.x86_64 \
libXdamage.x86_64 \
libXext.x86_64 \
libXi.x86_64 \
libXrandr.x86_64 \
libXScrnSaver.x86_64 \
libXtst.x86_64 \
pango.x86_64 \
xorg-x11-fonts-100dpi \
xorg-x11-fonts-75dpi \
xorg-x11-fonts-cyrillic \
xorg-x11-fonts-misc \
xorg-x11-fonts-Type1 \
xorg-x11-utils
# After installing dependencies you need to update nss library:
yum update nss -y
sudo apt-get install -y ca-certificates fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils
more https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
FAQs
Tool to resolve puppeteer and chromium faster, detect local installed chromium, download chromium with custom mirror host, cache chromium revision out of node_modules, test chromium headless being launchable.
We found that puppeteer-chromium-resolver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rubygems ecosystem support is moving from beta to GA, featuring enhanced security scanning to detect supply chain threats beyond traditional CVEs in your Ruby dependencies.
Research
The Socket Research Team investigates a malicious npm package that appears to be an Advcash integration but triggers a reverse shell during payment success, targeting servers handling transactions.
Security Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.