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

uBlock does not load adminSettings at first run #1547

Closed
8 tasks done
Fehler12 opened this issue Apr 6, 2021 · 5 comments
Closed
8 tasks done

uBlock does not load adminSettings at first run #1547

Fehler12 opened this issue Apr 6, 2021 · 5 comments
Labels
bug Something isn't working fixed issue has been addressed

Comments

@Fehler12
Copy link

Fehler12 commented Apr 6, 2021

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

when installing uBlock Origin by GPO into Chrome on Windows 10, the custom config of uBlock is not recognized at the first start. When the browser gets closed and started again the settings are there.

A specific URL where the issue occurs

www.google.com

Steps to Reproduce

Prerequesites:
I have two policies configured. One for automatically installing uBlock origin (it may be necessary to join the Windows 10 PC into a domain for using this) and the other one for giving uBlock a config:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallForcelist
Name of key: 1
Type: REG_SZ
Value: cjpalhdlnbpafiamejdnhcphjbkeiagm

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\3rdparty\Extensions\cjpalhdlnbpafiamejdnhcphjbkeiagm\policy
Name of key: adminSettings
Type: REG_SZ
Value: {"timeStamp":1617739675266,"version":"1.34.0","userSettings":{"importedLaists":[],"popupPanelSections":15},"selectedFilterLists":["user-filters","assets.json","public_suffix_list.dat","ublock-badlists","ublock-filters","ublock-badware","ublock-privacy","ublock-abuse","ublock-unbreak","easylist","easyprivacy","urlhaus-1","plowe-0","DEU-0"],"hiddenSettings":{},"whitelist":["about-scheme","chrome-extension-scheme","chrome-scheme","edge-scheme","moz-extension-scheme","opera-scheme","vivaldi-scheme","wyciwyg-scheme"],"dynamicFilteringString":"behind-the-scene * * noop\nbehind-the-scene * inline-script noop\nbehind-the-scene * 1p-script noop\nbehind-the-scene * 3p-script noop\nbehind-the-scene * 3p-frame noop\nbehind-the-scene * image noop\nbehind-the-scene * 3p noop","urlFilteringString":"","hostnameSwitchesString":"no-large-media: behind-the-scene false","userFilters":"wikipedia.org##.nag-trigger\nwikipedia.org###centralNotice\nwikipedia.de###WMDE-Banner-Container\nwww.youtube.com###dialog\nwww.youtube.com##.opened\nwww.youtube.com##ytd-popup-container\n"}

In order to simulate a new install do the following:

1.) Goto %LocalAppData%\Google and delete the folder Chrome
2.) Start Chrome. The folder will be recreated and Chrome will reinstall the profile with the ublock origin but without the given config (e.g. my filter is empty)
3.) Close Chrome
3.1) Reboot the machine (optional)
4.) Start Chrome. Now the settings are there

Another way to reproduce is the following:
1.) Goto %LocalAppData%\Google and delete the folder Chrome
2.) Start Chrome. The folder will be recreated and Chrome will reinstall the profile with the ublock origin but without the given config (e.g. my filter is empty)
3.) Open the uBlock Config tab and click on "restore default settings"
Now the correct config gets loaded and applied.

Expected behavior:

I would expect the custom config (from the second registry key) to be active at the very first start of Google Chrome, when the Plugin gets automatically installed without any further interaction.

Actual behavior:

The config seems to be recongnized at the second start or when the default config gets manually loaded (alternative way). Maybe the Plugin checks if there is an adminConfig-Entry every time Chrome starts but not when it gets installed.

Your environment

  • uBlock Origin version: 1.34.0
  • Browser Name and version: Google Chrome 89.0.4389.114
  • Operating System and version: Windows 10 Version 20H2
@uBlock-user uBlock-user added the something to address something to address label Apr 7, 2021
@gorhill
Copy link
Member

gorhill commented Apr 7, 2021

uBO reads admin config using the browser.storage.managed API, and consequently it shouldn't make a difference whether it's read at install time or not. I don't have Windows, I won't be able to reproduce as detailed. Also, the content of your adminSettings string does not look correct, i.e. there is no such setting as importedLaists, and public_suffix_list.dat should never be listed as a selected filter lists. Empty or unmodified properties should not appear in there, i.e. hiddenSettings, whitelist, etc.

@Fehler12
Copy link
Author

Fehler12 commented Apr 7, 2021

Hi, at first thank you for your reply. I've resettet the uBlock settings and added the addtitional filters again.
The importetLaists seemd to be a typo (by copy and paste) however the public_suffix_list.dat is still there so I assume that either this is a correct info or there is an bug with the default config on windows.

Is there anything I can do to further troubleshoot the problem? My assumption is that uBlock does not check the parameter adminSettings on first setup.

@gorhill
Copy link
Member

gorhill commented Apr 7, 2021

I will try to find the time to investigate all what I can reproduce (though on linux) tomorrow, I will report my findings. Whoever else is also welcome to do so and share gheir findings.

@Ronbinn
Copy link

Ronbinn commented Apr 16, 2021

I can reproduce this on linux (Debian Bullseye and Ubuntu Focal). If I put this on
/etc/opt/chrome/policies/managed/policies.json

 "3rdparty":
 {
   "extensions":
   {
     "cjpalhdlnbpafiamejdnhcphjbkeiagm":
     {
       "adminSettings": "{\"timeStamp\":1618561470188,\"version\":\"1.34.0\",\"userSettings\":{\"externalLists\":\"https://www.i-dont-care-about-cookies.eu/abp/\",\"importedLists\":[\"https://www.i-dont-care-about-cookies.eu/abp/\"]},\"selectedFilterLists\":[\"user-filters\",\"ublock-filters\",\"ublock-badware\",\"ublock-privacy\",\"ublock-abuse\",\"ublock-unbreak\",\"easylist\",\"easyprivacy\",\"urlhaus-1\",\"plowe-0\",\"spa-1\",\"spa-0\",\"https://www.i-dont-care-about-cookies.eu/abp/\"],\"hiddenSettings\":{},\"whitelist\":[\"about-scheme\",\"chrome-extension-scheme\",\"chrome-scheme\",\"edge-scheme\",\"moz-extension-scheme\",\"opera-scheme\",\"vivaldi-scheme\",\"wyciwyg-scheme\"],\"dynamicFilteringString\":\"behind-the-scene * * noop\\nbehind-the-scene * inline-script noop\\nbehind-the-scene * 1p-script noop\\nbehind-the-scene * 3p-script noop\\nbehind-the-scene * 3p-frame noop\\nbehind-the-scene * image noop\\nbehind-the-scene * 3p noop\",\"urlFilteringString\":\"\",\"hostnameSwitchesString\":\"no-large-media: behind-the-scene false\",\"userFilters\":\"\"}"
     }
   }
 }

First run doesn't load configuration, but second run does. If I add this option to the json file

 "ForceEphemeralProfiles": true,

Configuration is never loaded

gorhill added a commit to gorhill/uBlock that referenced this issue Jun 12, 2021
Related issue:
- uBlockOrigin/uBlock-issues#1547

The approach used to fix the issue was confirmed working
in the following related issue:
- uBlockOrigin/uBlock-issues#1608 (comment)
@gorhill gorhill closed this as completed Jun 12, 2021
@uBlock-user uBlock-user added bug Something isn't working fixed issue has been addressed and removed something to address something to address labels Jun 12, 2021
@anulman
Copy link

anulman commented Jul 13, 2021

@gorhill — bad news. I have user reports that, if Chromium reloads after crashing, lastVersion !== 0 so the extension doesn't reload itself.

It's possible—looking likely—that the crash happened on deploy. I notice uBlock is setting lastVersion at script start; what if we defer setting it until after the Promise.all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

5 participants