From 71b2f8ae1d8f0e275cbcd052a46aecb4a29c9240 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Thu, 12 Apr 2018 10:10:45 +0800 Subject: [PATCH] Use an ENV to trigger `--remote-debugging-port` instead. --- vendor/assets/javascripts/run-qunit.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/vendor/assets/javascripts/run-qunit.js b/vendor/assets/javascripts/run-qunit.js index 5a55fe0479..58e986ad5f 100644 --- a/vendor/assets/javascripts/run-qunit.js +++ b/vendor/assets/javascripts/run-qunit.js @@ -18,15 +18,19 @@ const CDP = require('chrome-remote-interface'); (function() { function launchChrome() { - return chromeLauncher.launch({ - // Uncomment this to enable `--remote-debugging-port` - // port: 9222, + const options = { chromeFlags: [ '--disable-gpu', '--headless', '--no-sandbox' ] - }); + } + + if (process.env.REMOTE_DEBUG) { + options.port = 9222; + } + + return chromeLauncher.launch(options); } launchChrome().then(chrome => {