Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adds binaryArgs to pass additional flags to Firefox binary #1563

Merged
merged 10 commits into from
Mar 29, 2019
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# OSX
.DS_Store
.idea
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems unrelated.


# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
Expand Down
3 changes: 3 additions & 0 deletions src/cmd/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export type CmdRunParams = {|
sourceDir: string,
startUrl?: Array<string>,
target?: Array<string>,
binaryArgs?: Array<string>,

// Android CLI options.
adbBin?: string,
Expand Down Expand Up @@ -77,6 +78,7 @@ export default async function run(
adbPort,
adbDevice,
firefoxApk,
binaryArgs,
}: CmdRunParams,
{
buildExtension = defaultBuildExtension,
Expand Down Expand Up @@ -107,6 +109,7 @@ export default async function run(
extensions: [{sourceDir, manifestData}],
keepProfileChanges,
startUrl,
binaryArgs,
desktopNotifications,
};

Expand Down
1 change: 1 addition & 0 deletions src/extension-runners/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export type ExtensionRunnerParams = {|
profilePath?: string,
keepProfileChanges: boolean,
startUrl: ?string | ?Array<string>,
binaryArgs?: Array<string>,

// Common injected dependencies.
desktopNotifications: typeof defaultDesktopNotifications,
Expand Down
3 changes: 1 addition & 2 deletions src/extension-runners/firefox-desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,9 @@ export class FirefoxDesktopExtensionRunner {
startUrl,
firefoxApp,
firefoxClient,
binaryArgs = [],
} = this.params;

const binaryArgs = [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this version of the PR the arguments are still prepended instead of appended. Restore the binaryArgs variable and use binaryArgs.push(...args); before passing it to firefoxApp.run.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, looks like I misunderstood you. Does it look fine now - 28cb262?


if (browserConsole) {
binaryArgs.push('-jsconsole');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhm... I'm thinking that it may be better to append the additional arguments that the user may be passing to a web-ext run command (instead of prepending them before the ones added internally by web-ext itself).

@Rob--W what do you think about it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appending rather than prepending sounds good to me.

}
Expand Down