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

Firefox driver 2.46.0 regression - unable to set to non-js #635

Closed
radek1st opened this Issue Jun 9, 2015 · 13 comments

Comments

Projects
None yet
7 participants
@radek1st

radek1st commented Jun 9, 2015

Setting:
profile.setPreference("javascript.enabled", false);
doesn't have any effect when using Firefox 38.0.5

It works correctly on 2.45.0.

@lukeis

This comment has been minimized.

Show comment
Hide comment
@lukeis

lukeis Jun 9, 2015

Member

reproducible python script:

from selenium import webdriver as w
fp = w.FirefoxProfile()
fp.set_preference("javascript.enabled", False)
d = w.Firefox(firefox_profile=fp)
d.get('about:config')

click the button and search for javascript.enabled and notice it's set to True.

Firefox 38.0.5 selenium 2.46.0

Member

lukeis commented Jun 9, 2015

reproducible python script:

from selenium import webdriver as w
fp = w.FirefoxProfile()
fp.set_preference("javascript.enabled", False)
d = w.Firefox(firefox_profile=fp)
d.get('about:config')

click the button and search for javascript.enabled and notice it's set to True.

Firefox 38.0.5 selenium 2.46.0

@barancev

This comment has been minimized.

Show comment
Hide comment
@barancev

barancev Jun 9, 2015

Member

I suspect I know why we used to pre-run Firefox with -silent option.
But now it fails...

Member

barancev commented Jun 9, 2015

I suspect I know why we used to pre-run Firefox with -silent option.
But now it fails...

@lukeis

This comment has been minimized.

Show comment
Hide comment
@lukeis

lukeis Jun 9, 2015

Member

we're unlikely to fix this though.... running without javascript enabled may have unintended other consequences on the Driver.

Running HtmlUnit without javascript enabled is an alternative.

Member

lukeis commented Jun 9, 2015

we're unlikely to fix this though.... running without javascript enabled may have unintended other consequences on the Driver.

Running HtmlUnit without javascript enabled is an alternative.

@radek1st

This comment has been minimized.

Show comment
Hide comment
@radek1st

radek1st Jun 9, 2015

Hi, unlikely to fix it shortly (for next release) or unlikely to fix it ever? Cheers

radek1st commented Jun 9, 2015

Hi, unlikely to fix it shortly (for next release) or unlikely to fix it ever? Cheers

@barancev

This comment has been minimized.

Show comment
Hide comment
@barancev

barancev Jun 9, 2015

Member

"Fixed" by commit 28e4d9c
Fail fast solution.

Member

barancev commented Jun 9, 2015

"Fixed" by commit 28e4d9c
Fail fast solution.

@barancev barancev closed this Jun 9, 2015

@moritzp

This comment has been minimized.

Show comment
Hide comment
@moritzp

moritzp Jul 2, 2015

Gosh this just cost us half a day to figure out... Is there a workaround? This really hurts :(

moritzp commented Jul 2, 2015

Gosh this just cost us half a day to figure out... Is there a workaround? This really hurts :(

@ddavison

This comment has been minimized.

Show comment
Hide comment
@ddavison

ddavison Jul 2, 2015

Member

@moritzp it's been implemented, but not published yet. until it is - you can download the latest jar that has the fix in it

Member

ddavison commented Jul 2, 2015

@moritzp it's been implemented, but not published yet. until it is - you can download the latest jar that has the fix in it

@radek1st

This comment has been minimized.

Show comment
Hide comment
@radek1st

radek1st Jul 2, 2015

@ddavison by saying it has a fix in it do you mean that "javascript.enabled" flag is hardcoded and switching off javascript is no longer possible?

radek1st commented Jul 2, 2015

@ddavison by saying it has a fix in it do you mean that "javascript.enabled" flag is hardcoded and switching off javascript is no longer possible?

@ddavison

This comment has been minimized.

Show comment
Hide comment
@ddavison

ddavison Jul 2, 2015

Member

to answer that question, i'll refer you to @barancev :)

Member

ddavison commented Jul 2, 2015

to answer that question, i'll refer you to @barancev :)

@barancev

This comment has been minimized.

Show comment
Hide comment
@barancev

barancev Jul 2, 2015

Member

I'd like to apply a proper fix if someone has one :)

This issue caused by the change 6fc17a0 that fixed much more critical issue -- total inability to start Firefox 38+.

We can create a user.js file with javascript.enabled = true, but Firefox ignores this preference (and only this!) being run in normal mode, without -s option. At the same time, -s option crashes the browser.

Why Firefox ignores this preference? I don't know. How to pass it to the actual profile? I don't know too. The only workaround I can imagine now is running browser with a pre-defined profile.

Member

barancev commented Jul 2, 2015

I'd like to apply a proper fix if someone has one :)

This issue caused by the change 6fc17a0 that fixed much more critical issue -- total inability to start Firefox 38+.

We can create a user.js file with javascript.enabled = true, but Firefox ignores this preference (and only this!) being run in normal mode, without -s option. At the same time, -s option crashes the browser.

Why Firefox ignores this preference? I don't know. How to pass it to the actual profile? I don't know too. The only workaround I can imagine now is running browser with a pre-defined profile.

@dhruvbhatia

This comment has been minimized.

Show comment
Hide comment
@dhruvbhatia

dhruvbhatia Jul 18, 2015

This also seems to apply for the permissions.default.image flag, which is used to disable images.

Firefox is ignoring any user defined value.

This also seems to apply for the permissions.default.image flag, which is used to disable images.

Firefox is ignoring any user defined value.

@moritzp

This comment has been minimized.

Show comment
Hide comment
@moritzp

moritzp Jul 27, 2015

Mm using pre-defined profiles comes with a lot of downsides... We have a bunch of devs running tests locally and tons of vms for ci. All of them would need the profile etc... That'd be some serious pain too.

moritzp commented Jul 27, 2015

Mm using pre-defined profiles comes with a lot of downsides... We have a bunch of devs running tests locally and tons of vms for ci. All of them would need the profile etc... That'd be some serious pain too.

@fotinakis

This comment has been minimized.

Show comment
Hide comment
@fotinakis

fotinakis Sep 2, 2016

Here is a workaround for disabling JavaScript in Firefox via an addon, which works with Firefox 45 and selenium-webdriver 2.53.4: http://stackoverflow.com/a/39301760/128597

Here is a workaround for disabling JavaScript in Firefox via an addon, which works with Firefox 45 and selenium-webdriver 2.53.4: http://stackoverflow.com/a/39301760/128597

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