From 66a809e2829225d91ac2f6365533666e6d1749df Mon Sep 17 00:00:00 2001 From: Jonathan Garbee Date: Tue, 15 Nov 2016 09:15:17 -0500 Subject: [PATCH] Allow user to provide location when starting Firefox. (#1201) --- bin/firefox-driver.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/bin/firefox-driver.js b/bin/firefox-driver.js index f288b3001f..724dc0ac65 100755 --- a/bin/firefox-driver.js +++ b/bin/firefox-driver.js @@ -5,9 +5,14 @@ const By = webdriver.By; const until = webdriver.until; const Key = webdriver.Key; const minimist = require("minimist"); +const url = require('url'); + const args = minimist(process.argv.slice(2), -{ boolean: ["start", "tests", "websocket"] }); +{ + boolean: ["start", "tests", "websocket"], + string: ["location"], +}); const isWindows = /^win/.test(process.platform); const shouldStart = args.start; @@ -58,7 +63,14 @@ function start() { if (shouldStart) { const driver = start(); - driver.get("http://localhost:7999/todomvc"); + let location = url.parse('about:blank'); + if (args.location) { + location = url.parse(args.location); + } + if (location.protocol === null) { + location.protocol = 'http:'; + } + driver.get(url.format(location)); setInterval(() => {}, 100); }