Skip to content

[πŸš€ Feature]: Language bindings for Firefox Prefs JS APIΒ #14266

@MatzFan

Description

@MatzFan

Feature and motivation

I would like to be able to get the value of a preference set in about:config dynamically. These are set when instantiating a driver via Options[:prefs] values). I'd also like to be able to dynamically set a preference.

The JS API for Firefox prefs seems straightforward. I do note that Firefox CDP is being deprecated IFO BiDi, could someone confirm whether this JS API is part of that scope or not?

Usage example

From your own Ruby tests I see here that you get a preference value like so, by passing a JS string to the Driver#execute_script method.

dir  = driver.execute_script("return Services.prefs.getStringPref('browser.download.dir')")

Something like this would be much better:

driver.pref['browser.download.dir']
# => ""

And the equivalent to set a pref value:

driver.pref['browser.download.dir'] = 'foo/bar'
driver.pref['browser.download.dir']
# => "/foo/bar"

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!I-enhancementSomething could be better

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions