-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1704 from jpwhite4/chromium111
Add helper script that runs chromium.
- Loading branch information
Showing
10 changed files
with
1,300 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"env": { | ||
"node": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 2018 | ||
}, | ||
"rules": { | ||
"no-console": "off" | ||
}, | ||
"globals": { | ||
"document": "readonly" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env node | ||
const puppeteer = require('puppeteer-core'); | ||
const args = require('yargs').argv; | ||
|
||
(async () => { | ||
const browser = await puppeteer.launch({ | ||
executablePath: args['path-to-chrome'], | ||
args: ['--no-sandbox', '--disable-extensions', '--disable-setuid-sandbox'] | ||
}); | ||
const page = await browser.newPage(); | ||
|
||
if (args['window-size']) { | ||
let dimensions = args['window-size'].split(','); | ||
await page.setViewport({ | ||
width: parseInt(dimensions[0], 10), | ||
height: parseInt(dimensions[1], 10), | ||
deviceScaleFactor: 1 | ||
}); | ||
} | ||
|
||
await page.goto('file://' + args['input-file']); | ||
|
||
const innerHtml = await page.evaluate(() => document.querySelector('.highcharts-container').innerHTML); | ||
|
||
console.log(JSON.stringify(innerHtml)); | ||
|
||
await browser.close(); | ||
})(); |
Oops, something went wrong.