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: Added ability to set custom preferences in firefox #16

Merged
merged 1 commit into from
Nov 27, 2013
Merged

feat: Added ability to set custom preferences in firefox #16

merged 1 commit into from
Nov 27, 2013

Conversation

axemclion
Copy link

Added the ability for firefox to take in custom preferences.

I am working on https://github.com/axemclion/karma-telemetry and I needed to pass in dom.send_after_paint_to_content for measuring first paint time and dom.disable_open_during_load to enable the tests to open in a new window. For now, I had to copy the code to create a new launcher, but it would be awesome if I could simply pass these preferences in to firefox.

Tried to model this after the karma-chrome-launcher _getOptions function.

Tested this on Windows with the following cases

  • Default Firefox browsers works (no custom launcher)
  • Custom launcher with no preferences works
  • Custom launcher with {base: 'firefox', 'prefs': {} } works
  • Custom launcher with {base: 'firefox', 'prefs': {'dom.send_after_paint_to_content' : true} } works

return PREFS;
}
for (var key in prefs) {
PREFS += 'user_pref("' + key + '", ' + JSON.stringify(prefs[key]) + ');\n';
Copy link
Contributor

Choose a reason for hiding this comment

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

This is mutating the global constant, so it will affect other FF launchers.
Change it to use a local variable instead.

@vojtajina
Copy link
Contributor

This is great @axemclion !

Can you please make the one change I mentioned in the comment and please re-base it on the top of the latest master, so that I can merge it in. Thanks a bunch.

@axemclion
Copy link
Author

Fixed the comment. Added a results object.

@vojtajina
Copy link
Contributor

@axemclion Thanks! Can you also rebase it on the latest master, so that I can easily merge it in?

@axemclion
Copy link
Author

Rebased on the latest master.

vojtajina added a commit that referenced this pull request Nov 27, 2013
feat: Added ability to set custom preferences in firefox
@vojtajina vojtajina merged commit 67f329f into karma-runner:master Nov 27, 2013
@vojtajina
Copy link
Contributor

Thanks @axemclion !

@axemclion axemclion mentioned this pull request Dec 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants