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

Merged
merged 1 commit into from Nov 27, 2013

Conversation

Projects
None yet
2 participants
@axemclion

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
@vojtajina

View changes

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

This comment has been minimized.

@vojtajina

vojtajina Nov 22, 2013

Contributor

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

@vojtajina

vojtajina Nov 22, 2013

Contributor

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

@vojtajina

This comment has been minimized.

Show comment
Hide comment
@vojtajina

vojtajina Nov 22, 2013

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.

Contributor

vojtajina commented Nov 22, 2013

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

This comment has been minimized.

Show comment
Hide comment
@axemclion

axemclion Nov 23, 2013

Fixed the comment. Added a results object.

Fixed the comment. Added a results object.

@vojtajina

This comment has been minimized.

Show comment
Hide comment
@vojtajina

vojtajina Nov 24, 2013

Contributor

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

Contributor

vojtajina commented Nov 24, 2013

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

@axemclion

This comment has been minimized.

Show comment
Hide comment
@axemclion

axemclion Nov 25, 2013

Rebased on the latest master.

Rebased on the latest master.

vojtajina added a commit that referenced this pull request Nov 27, 2013

Merge pull request #16 from axemclion/master
feat: Added ability to set custom preferences in firefox

@vojtajina vojtajina merged commit 67f329f into karma-runner:master Nov 27, 2013

@vojtajina

This comment has been minimized.

Show comment
Hide comment
@vojtajina

vojtajina Nov 27, 2013

Contributor

Thanks @axemclion !

Contributor

vojtajina commented Nov 27, 2013

Thanks @axemclion !

@axemclion axemclion referenced this pull request Dec 27, 2013

Open

Allow custom flags #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment