Skip to content

Commit

Permalink
refactor: Append binaryArgs instead of prepend
Browse files Browse the repository at this point in the history
  • Loading branch information
denar90 committed Mar 28, 2019
1 parent 117553b commit 28cb262
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/extension-runners/firefox-desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,21 +217,27 @@ export class FirefoxDesktopExtensionRunner {
startUrl,
firefoxApp,
firefoxClient,
args = [],
args,
} = this.params;

const binaryArgs = [];

if (browserConsole) {
args.push('-jsconsole');
binaryArgs.push('-jsconsole');
}
if (startUrl) {
const urls = Array.isArray(startUrl) ? startUrl : [startUrl];
for (const url of urls) {
args.push('--url', url);
binaryArgs.push('--url', url);
}
}

if (args) {
binaryArgs.push(...args);
}

this.runningInfo = await firefoxApp.run(this.profile, {
firefoxBinary, args,
firefoxBinary, args: binaryArgs,
});

this.runningInfo.firefox.on('close', () => {
Expand Down

0 comments on commit 28cb262

Please sign in to comment.