Re: Selenium, Firefox-Profiel and Boolean Values.

15 views
Skip to first unread message

Daniel Gempesaw

unread,
Feb 22, 2016, 10:40:30 AM2/22/16
to Steffen Rumberger, selenium-re...@googlegroups.com

Hi Steffen,

No worries about your English, it’s very good! :)

Unfortunately, it appears this is a bug in webdriver as of 2.46.0. According to the SeleniumHQ project on Github, apparently “starting firefox in normal mode ignores the javascript.enabled property,” and “starting firefox in -s mode would respect the property, but the browser immediately crashes”:

https://github.com/seleniumhq/selenium/issues/635#issuecomment-118049422

As a result, the javascript.enabled is hardcoded/forced to be true, ignoring any user preferences:

https://github.com/SeleniumHQ/selenium/blob/master/javascript/firefox-driver/webdriver.json#L35

Sorry for the bad news! As a workaround, they basically suggest to figure out what javascript you wish to avoid and run your own javascript to disable it, which isn’t a general solution. But, I don’t think there’s anything we can do from our side.

Good luck,

Daniel Gempesaw


On Sat, Feb 20, 2016 at 6:25 AM Steffen Rumberger <in...@sdf-eu.org> wrote:
Hi,

first thinks first: iam a german guy and hope u can read my englisch.

it seems setting boolean values like javascript.enabled in a
Selenium::Firefox::Profile does not work.

take a look at my code:
my $ff_profile = Selenium::Firefox::Profile->new;
$ff_profile->set_preference(
     'javascript.enabled' => JSON::false,
     'network.proxy.type' => "5",
);

my $driver = Selenium::Firefox->new(
     startup_timeout => $startup_timeout,
     firefox_profile => $ff_profile,
);

but if i open about config the value ist not changed:

$driver->get('about:config');
sleep 60*60; Keep about:config open

javascript.enabled is true anyway...

Yours,
Inne
Reply all
Reply to author
Forward
0 new messages