From 5add88805b2a7c38e77bc79adcf71f79df655447 Mon Sep 17 00:00:00 2001 From: Daniel Westendorf Date: Tue, 14 Jan 2020 16:49:54 -0700 Subject: [PATCH] Add support for specifying the starting URL Some JS API's check the http referer when used (Google Maps JS API, for example). Specify the `STARTING_URL` as an env variable to set ensure these requests function as expected. --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 235d42a..daabeb3 100644 --- a/index.js +++ b/index.js @@ -9,8 +9,9 @@ const webServer = new Server({ console.log('Starting Google Chrome') ChromeLauncher.launch({ - chromeFlags: ['--headless', '--disable-gpu', '--disable-dev-shm-usage', '--no-sandbox', '--hide-scrollbars'], - port: 9222 + chromeFlags: ['--disable-gpu', '--disable-dev-shm-usage', '--no-sandbox', '--hide-scrollbars'], + port: 9222, + startingUrl: (process.env.STARTING_URL || 'about:blank') }).then((chrome) => { console.log(`Chrome debugging port running on ${chrome.port}`)