-
Notifications
You must be signed in to change notification settings - Fork 86
Firefox managed storage properties other than adminSettings not applying #2067
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
Comments
Same using browser.storage.managed.get(['toOverwrite'], function(result) {
console.log(typeof result.toOverwrite)}) |
Firefox preferences appear to not work because of uBlockOrigin/uBlock-issues#2067
I don't have Windows but what you are doing does not match the MDN documentation. |
I think that's just a case of the docs being outdated - there's a couple of examples of this approach being used by other extensions, and currently works with uBlock for configuring
|
The other thing I observe is that you set It's supposed to be an object, so should it not be |
Mozilla say this is expected, and I've now got configuring Firefox via the registry working properly by changing the settings to |
Firefox preferences appear to not work because of uBlockOrigin/uBlock-issues#2067
Prerequisites
I tried to reproduce the issue when...
Description
When configuring uBlock's managed storage properties for Firefox, properties other than
adminSettings
aren't being applied, but they're applied properly in Chrome and Edge. I'm using the Windows registry, but have tested quickly using a json and I think the same thing is happening.I believe the issue is Firefox is escaping the properties and causing them to be read as strings rather than objects, as
typeof (await vAPI.adminStorage.get(['toOverwrite'])).toOverwrite
isstring
in Firefox butobject
in Chrome and Edge.adminSettings
works asJSON.parse()
is used on it, but not on the other properties, so the fix is probably moreif ( typeof json === 'string' && json !== '' ) {data = JSON.parse(json);}
like https://github.com/gorhill/uBlock/blob/ab6a59daf8bd183cbaf9f07d22f9d432d4adfc44/src/js/storage.js#L1392The properties are also shown escaped on
about:policies
in Firefox even if they are not escaped in the registry (but not escaped onchrome://policy
oredge://policy
) suggesting Firefox is escaping them, but I've not been able to find anything saying this if this is expected.A specific URL where the issue occurs
https://github.com
Steps to Reproduce
Configure an admin policy other than
adminSettings
, egtoOverwrite
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\3rdparty\Extensions\[email protected]] "toOverwrite"="{\"trustedSiteDirectives\": [\"example.com\",\"example.org\"]}"
Start Firefox
Expected behavior
Settings are applied, in this example trusted sites are set to example.com and example.org
Actual behavior
Settings are applied, in this example trusted sites are not set
uBlock Origin version
1.41.8
Browser name and version
Firefox 98.0.2
Operating System and version
Windows Server 2019 17763.737
The text was updated successfully, but these errors were encountered: