Skip to content
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

AdminSettings for uBlock are not working anymore in Firefox #1057

Closed
8 tasks done
BenKu82 opened this issue May 20, 2020 · 14 comments
Closed
8 tasks done

AdminSettings for uBlock are not working anymore in Firefox #1057

BenKu82 opened this issue May 20, 2020 · 14 comments
Labels
Firefox specific to Firefox fixed issue has been addressed

Comments

@BenKu82
Copy link

BenKu82 commented May 20, 2020

Prerequisites

  • I verified that this is not a filter issue
  • This is not a support issue or a question
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue
    • Your issue may already be reported.
  • I tried to reproduce the issue when...
    • uBlock Origin is the only extension
    • uBlock Origin with default lists/settings
    • using a new, unmodified browser profile
  • I am running the latest version of uBlock Origin
  • I checked the documentation to understand that the issue I report is not a normal behavior

Description

In Issue gorhill/uBlock#2986 is a Solution documented, but it does not work anymore.

A specific URL where the issue occurs

[A specific URL is MANDATORY for issue happening on a web page, even if it happens "everywhere"]

Steps to Reproduce

  1. Creating File "[email protected]" containing:
{
 "name": "[email protected]",
 "description": "ignored",
 "type": "storage",
 "data": {
    "adminSettings": {"autoUpdate":true,"netWhitelist":"about-scheme\nbehind-the-scene\nchrome-extension-scheme\nchrome-scheme\nlocalhost\nloopconversation.about-scheme\nopera-scheme\nEXAMPLE.COM"}
   
		}
		
}
  1. Creating Registry-Entry
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\ManagedStorage\[email protected]]
@="C:\\Program Files\\Mozilla Firefox\\browser\\extensions\\[email protected]"
  1. Starting Firefox

Expected behavior:

EXAMPLE.COM has to be entered in the uBlock-Whitelist

Actual behavior:

Nothing

Your environment

  • uBlock Origin version: v1.25.0
  • Browser Name and version: Mozilla Firefox 68.8.0esr
  • Operating System and version: MS Windows 10 1809
@gwarser
Copy link

gwarser commented May 20, 2020

I'm pretty sure this must be double escaped string:

"adminSettings": {"autoUpdate":true,"netWhitelist":"

->

"adminSettings": "{\"userFilters\":\"www.test.de##sc

Use this tool to encode properly: http://raymondhill.net/ublock/adminSetting.html and use "as a JSON string value"

@uBlock-user uBlock-user added Firefox specific to Firefox something to address something to address labels May 20, 2020
@BenKu82
Copy link
Author

BenKu82 commented May 20, 2020

I tested it with the tool, too. But it does not work, too.

@gwarser
Copy link

gwarser commented May 20, 2020

Works for me on Linux

image

It failed for me few times - just make sure JSON is valid, is properly escaped and is correctly quoted.

@gorhill
Copy link
Member

gorhill commented May 20, 2020

Your [email protected] worked on my side. Note that double escaping is no longer needed so the following worked for me:

{
    "name": "[email protected]",
    "description": "_",
    "type": "storage",
    "data": {
        "adminSettings": {
            "autoUpdate": true,
            "netWhitelist": "about-scheme\nbehind-the-scene\nchrome-extension-scheme\nchrome-scheme\nlocalhost\nloopconversation.about-scheme\nopera-scheme\nEXAMPLE.COM"
        }
    }
}

@gorhill
Copy link
Member

gorhill commented May 20, 2020

There is an issue actually, I see EXAMPLE.COM but it's commented out.

Edit 1: never mind, it's commented out because it is considered invalid, it's properly added when converted to lowercase. However, autoUpdate: true is not being enforced, I need to investigate why.

Edit 2: Ok autoUpdate is not being enforced because it needs to be a property of userSettings, just as it is in the backup file. So all is ok here finally.

Note that I am on linux, I do not have access to a Windows computer.

@gorhill
Copy link
Member

gorhill commented May 20, 2020

uBlock Origin version: v1.25.0

Sorry, I don't think this version supported not double-encoding; still the double encoded JSON worked for me:

"{\"autoUpdate\":true,\"netWhitelist\":\"about-scheme\\nbehind-the-scene\\nchrome-extension-scheme\\nchrome-scheme\\nlocalhost\\nloopconversation.about-scheme\\nopera-scheme\\nEXAMPLE.COM\"}"

@BenKu82
Copy link
Author

BenKu82 commented May 21, 2020

I don´t know, what is wrong, but all your solutions does not work on my test systems.
@gorhill: I used your last string like this (copy and paste failure before):

{
    "name": "[email protected]",
    "description": "_",
    "type": "storage",
    "data": {
        "adminSettings": {
            "autoUpdate": true,
            "netWhitelist": "about-scheme\nbehind-the-scene\nchrome-extension-scheme\nchrome-scheme\nlocalhost\nloopconversation.about-scheme\nopera-scheme\nexmple.com\nexample2.com"
        }
    }
}

And my registry entry looks like this:

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\ManagedStorage]
"[email protected]"="@=C:\\temp\\[email protected]"

@gwarser
Copy link

gwarser commented May 21, 2020

Please use proper code formatting. We cannot distinguish between formatting errors and possible encoding issues.

https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax#quoting-code

@gorhill
Copy link
Member

gorhill commented May 21, 2020

Your json text is invalid, see with https://jsonlint.com/. My string did not have this error.

@BenKu82
Copy link
Author

BenKu82 commented May 25, 2020

Is the Syntax of the Registry-Entry correct?


[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\ManagedStorage]
"[email protected]"="@=C:\\temp\\[email protected]"

PS: I corrected my entry before.

@gwarser
Copy link

gwarser commented May 25, 2020

We are both on Linux, so we cannot test this. Looking at examples it's wrong.

[email protected] is a "directory" and @ means "default" key.

@BenKu82
Copy link
Author

BenKu82 commented May 26, 2020

Is there an other way to deploy a whitelist?
Where does uBlock save manual whitelist entries?

@gorhill
Copy link
Member

gorhill commented May 26, 2020

uBO has no access to the file system, settings are saved through an API, and Firefox decides how settings are saved.

@BenKu82
Copy link
Author

BenKu82 commented May 26, 2020

The solution was the key named [email protected] instead of a value. My fault.
The path to the file is simply in the default value.
Thank´s @gorhill and @gwarser

@BenKu82 BenKu82 closed this as completed May 26, 2020
@uBlock-user uBlock-user added fixed issue has been addressed and removed something to address something to address labels May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Firefox specific to Firefox fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

4 participants