-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract chrome-launcher to a standalone thing. (#2245)
* Also extract default flags to standalone entity.
- Loading branch information
Showing
19 changed files
with
356 additions
and
50 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
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,6 @@ | ||
--- | ||
BasedOnStyle: Google | ||
Language: JavaScript | ||
ColumnLimit: 100 | ||
ReflowComments: false | ||
SpacesBeforeTrailingComments: 1 |
File renamed without changes.
File renamed without changes.
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 @@ | ||
'use strict' | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
module.exports = function(filename) { | ||
if (!fs.existsSync(path.join(__dirname, filename))) { | ||
console.log( | ||
'Oops! Looks like the chrome-launcher files needs to be compiled. Please run:'); | ||
console.log(' yarn install; yarn build;'); | ||
console.log('More at: https://github.com/GoogleChrome/lighthouse#develop'); | ||
process.exit(1); | ||
} | ||
} |
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,19 @@ | ||
export const DEFAULT_FLAGS = [ | ||
// Disable built-in Google Translate service | ||
'--disable-translate', | ||
// Disable all chrome extensions entirely | ||
'--disable-extensions', | ||
// Disable various background network services, including extension updating, | ||
// safe browsing service, upgrade detector, translate, UMA | ||
'--disable-background-networking', | ||
// Disable fetching safebrowsing lists, likely redundant due to disable-background-networking | ||
'--safebrowsing-disable-auto-update', | ||
// Disable syncing to a Google account | ||
'--disable-sync', | ||
// Disable reporting to UMA, but allows for collection | ||
'--metrics-recording-only', | ||
// Disable installation of default apps on first run | ||
'--disable-default-apps', | ||
// Skip first run wizards | ||
'--no-first-run', | ||
]; |
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 |
---|---|---|
|
@@ -30,4 +30,3 @@ const chromeInstance = new ChromeLauncher({ | |
|
||
chromeInstance.prepare(); | ||
chromeInstance.run(); | ||
|
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,20 @@ | ||
{ | ||
"name": "chrome-launcher", | ||
"private": true, | ||
"main": "chrome-launcher.js", | ||
"scripts": { | ||
"build": "tsc", | ||
"dev": "tsc -w", | ||
"test": "mocha --reporter dot test/**/*-test.js", | ||
"test-formatting": "test/check-formatting.sh", | ||
"format": "clang-format -i -style=file *.ts" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^3.2.0", | ||
"typescript": "2.2.1", | ||
"clang-format": "^1.0.50" | ||
}, | ||
"dependencies": { | ||
"@types/node": "6.0.66" | ||
} | ||
} |
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,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
check_formatting () | ||
{ | ||
diff -u <(cat $1) <(./node_modules/.bin/clang-format -style=file $1) &>/dev/null | ||
if [ $? -eq 1 ] | ||
then | ||
echo "Error: formatting is required for *.ts files:" | ||
echo " cd chrome-launcher" | ||
echo " yarn format" | ||
exit 1 | ||
fi | ||
} | ||
|
||
check_formatting "*.ts" |
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,19 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "es6", | ||
"noImplicitAny": true, | ||
"inlineSourceMap": true, | ||
"noEmitOnError": false, | ||
"strictNullChecks": true, | ||
"noImplicitReturns": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true | ||
}, | ||
"exclude": [ | ||
"node_modules" | ||
], | ||
"include": [ | ||
"*.ts" | ||
] | ||
} |
Oops, something went wrong.