Add UrlbarPrefs.set()
Categories
(Firefox :: Address Bar, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox75 | --- | fixed |
People
(Reporter: adw, Assigned: mak)
References
Details
Attachments
(1 file)
We might want to add a UrlbarPrefs.setPref
function (or setIntPref
, etc.). We have getPref
, which should not be passed the browser.urlbar
pref name prefix. But since we don't have a setPref
, we have to use the prefs service directly, where we do need to use the browser.urlbar
prefix. That inconsistency can contribute to bugs like bug 1614656.
Comment 1•5 years ago
|
||
I'd recommend a simple API, mirroring getPref
, with a similar type checking/ switching implementation as Preferences.jsm has. My 2cts :)
Assignee | ||
Comment 2•5 years ago
|
||
UrlbarPrefs is shaped after Map, thus it should just be .set(key, value); it should only be able to set known prefs, and the type of the pref can be extracted from the default value that is defined in its internal table. Thus it should throw for an unknown pref or a non-coherent type for the passed-in value.
Reporter | ||
Comment 3•5 years ago
|
||
Yes, I was thinking along those lines too.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 4•5 years ago
|
||
Comment 6•5 years ago
|
||
Backed out changeset cf410c350fe7 for causing xpcshell failures in test_UrlbarPrefs.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/5d0ed72bfb1f0706c1b2f1011aa31b724f1fef09
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=291404289&repo=autoland&lineNumber=6482
Assignee | ||
Updated•5 years ago
|
Comment 8•5 years ago
|
||
bugherder |
Description
•