From 7ee122acc5d2bd2ce957f79046bd781de9f3d5c8 Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Mon, 24 Jul 2017 15:44:42 -0700 Subject: [PATCH] pass --enable-extensions on from manual-chrome-launcher --- chrome-launcher/manual-chrome-launcher.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chrome-launcher/manual-chrome-launcher.js b/chrome-launcher/manual-chrome-launcher.js index 45071fb82e24..be649de9a539 100755 --- a/chrome-launcher/manual-chrome-launcher.js +++ b/chrome-launcher/manual-chrome-launcher.js @@ -6,10 +6,11 @@ * * Assuming Lighthouse is installed globally or `npm link`ed, use via: * chrome-debug - * Optionally pass additional a port, chrome flags and/or a URL + * Optionally enable extensions or pass a port, additional chrome flags, and/or a URL * chrome-debug --port=9222 * chrome-debug http://goat.com * chrome-debug --show-paint-rects + * chrome-debug --enable-extensions */ require('./compiled-check.js')('chrome-launcher.js'); @@ -19,6 +20,7 @@ const args = process.argv.slice(2); let chromeFlags; let startingUrl; let port; +let enableExtensions; if (args.length) { chromeFlags = args.filter(flag => flag.startsWith('--')); @@ -26,11 +28,14 @@ if (args.length) { const portFlag = chromeFlags.find(flag => flag.startsWith('--port=')); port = portFlag && portFlag.replace('--port=', ''); + enableExtensions = !!chromeFlags.find(flag => flag === '--enable-extensions'); + startingUrl = args.find(flag => !flag.startsWith('--')); } launch({ startingUrl, port, + enableExtensions, chromeFlags, }).then(v => console.log(`✨ Chrome debugging port: ${v.port}`));