diff --git a/README.md b/README.md index 1f925cb..3049b60 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ At the moment, the best solution is to install ReLaXed in an empty directory as ``` git clone https://github.com/RelaxedJS/ReLaXed.git . -npm install +export PUPPETEER_CHROMIUM_REVISION=526987 && npm install sudo npm link --unsafe-perm=true ``` diff --git a/package.json b/package.json index a2417c4..93fcc60 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,9 @@ "author": "Zulko", "homepage": "https://github.com/RelaxedJS", "license": "ISC", + "puppeteer": { + "chromium_revision": "526987" + }, "dependencies": { "cheerio": "^1.0.0-rc.2", "chokidar": "^2.0.3", diff --git a/src/index.js b/src/index.js index e23919d..7307a43 100755 --- a/src/index.js +++ b/src/index.js @@ -7,6 +7,10 @@ const { performance } = require('perf_hooks') const path = require('path') const converters = require('./converters.js') +const chromiumRevision = process.env.PUPPETEER_CHROMIUM_REVISION + || process.env.npm_config_puppeteer_chromium_revision + || require('../package.json').puppeteer.chromium_revision + var input, output program @@ -30,8 +34,12 @@ const tempHTML = path.join(inputDir, '_temp.htm') async function main () { console.log('Watching ' + input + ' and its directory tree.') + + const browserFetcher = puppeteer.createBrowserFetcher(); + const revisionInfo = browserFetcher.revisionInfo(chromiumRevision); const browser = await puppeteer.launch({ - headless: true + headless: true, + executablePath: revisionInfo.executablePath }) const page = await browser.newPage() page.on('pageerror', function (err) {