Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing files for new screenshot infra
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
- Loading branch information
Showing
7 changed files
with
361 additions
and
3 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,10 @@ | ||
.. title: Version 8 | ||
.. slug: v8 | ||
.. date: 1970-01-01 00:00:00 UTC | ||
.. category: version_page | ||
.. post-list:: | ||
:sort: slug_sortable | ||
:tags: v8 | ||
:post_type: pages | ||
:template: theme_list.tmpl |
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,2 @@ | ||
#!/bin/bash | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 npm i --save puppeteer |
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,45 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const puppeteer = require('puppeteer'); | ||
|
||
// Simple error checking | ||
var arg_count = process.argv.length - 1; | ||
if (arg_count < 4 || arg_count > 5) { | ||
console.log('Usage: take_screenshot.js HTML_FILE WIDTH HEIGHT IMAGE_PATH'); | ||
process.exit(1); | ||
} | ||
|
||
var executablePath = ''; | ||
|
||
var pathsToTest = [ | ||
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', | ||
'/usr/bin/chromium-browser', | ||
'/usr/bin/google-chrome', | ||
'/usr/bin/google-chrome-dev', | ||
'/usr/bin/chromium' | ||
]; | ||
var pathFound = false; | ||
|
||
for (var i = 0; i < pathsToTest.length; i++) { | ||
var executablePath = pathsToTest[i]; | ||
if (fs.existsSync(executablePath)) { | ||
pathFound = true; | ||
break; | ||
} | ||
} | ||
|
||
if (!pathFound) { | ||
console.log('Chrome(ium) not found. Please add it to take-screenshot.js.'); | ||
process.exit(1); | ||
} | ||
|
||
(async () => { | ||
const browser = await puppeteer.launch({executablePath: executablePath}); | ||
const page = await browser.newPage(); | ||
|
||
await page.goto('file://' + path.resolve(process.argv[2])); | ||
await page.setViewport({width: parseInt(process.argv[3]), height: parseInt(process.argv[4])}); | ||
await page.screenshot({path: process.argv[5], type: 'png', fullPage: true}); | ||
|
||
await browser.close(); | ||
})(); |
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 @@ | ||
../../v8/bootstrap3 |
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 @@ | ||
../v8 |