Skip to content

Instantly share code, notes, and snippets.

@velzie
Last active January 11, 2025 14:49
Show Gist options
  • Save velzie/053ffedeaecea1a801a2769ab86ab376 to your computer and use it in GitHub Desktop.
Save velzie/053ffedeaecea1a801a2769ab86ab376 to your computer and use it in GitHub Desktop.
How to keep using adblockers on chrome and chromium

How to keep using adblockers on chrome and chromium

  1. google's manifest v3 has no analouge to the webRequestBlocking API, which is neccesary for (effective) adblockers to work
  2. starting in chrome version 127, the transition to mv3 will start cutting off the use of mv2 extensions alltogether
  3. this will inevitably piss of enterprises when their extensions don't work, so the ExtensionManifestV2Availability key was added and will presumably stay forever after enterprises complain enough

You can use this as a regular user, which will let you keep your mv2 extensions even after they're supposed to stop working

Linux

In a terminal, run:

sudo mkdir -p /etc/opt/chrome/policies/managed /etc/opt/chromium/policies/managed
echo '{ "ExtensionManifestV2Availability": 2 }' | sudo tee /etc/opt/chrome/policies/managed/policy.json /etc/opt/chromium/policies/managed/policy.json

ChromeOS

  • enable developer mode
  • upon rebooting, go into vt2 (shift+ctrl+right arrow function key)
  • log in as root
  • type in /usr/libexec/debugd/helpers/dev_features_rootfs_verification && reboot
  • upon rebooting, go into vt2 again and log in as root
  • run the commands from the linux section

Windows

Open regedit, and create Software\Policies\Google\Chrome\ExtensionManifestV2Availability in HKEY_LOCAL_MACHINE as a dword set to 0x00000002

MacOS

In a terminal, run: defaults write com.google.Chrome ExtensionManifestV2Availability -int 2 defaults write com.google.Chromium ExtensionManifestV2Availability -int 2

(note that i haven't tested this for mac. please let me know if it doesn't work)

@Technetium1
Copy link

@trekshcool You can also save the .reg file I put as the first comment. Double-clicking it will prompt to add the key.

@Leah96xxx Opera does not currently require a flag for override. I've updated my comment to include a link to the keys for other browsers.

@DealsBeam
Copy link

Thanks for this

@ProgrammerIn-wonderland
Copy link

Windows 11 here, there is no google in my HKEY_LOCAL_MACHINE Software\Policies\

Edit: I managed to make the keys/folders uptil Software\Policies\Google\Chrome\ and then tried to make the dword ExtensionManifestV2Availability but the dword does not seem to be able to accept 0x00000002

Edit 2: I removed the 0x and only put in 00000002 and it seems to have worked.

So basically if you dont have those folders make them yourself they are called keys in the new menu and then when you get to \chrome make a dword called ExtensionManifestV2Availability and set it to 00000002.

Please let me know if anything I did here is wrong. Thanks a lot for the guide!

If it was right you'll see it ExtensionManifestV2Availability in chrome://policy

@trekshcool
Copy link

Windows 11 here, there is no google in my HKEY_LOCAL_MACHINE Software\Policies
Edit: I managed to make the keys/folders uptil Software\Policies\Google\Chrome\ and then tried to make the dword ExtensionManifestV2Availability but the dword does not seem to be able to accept 0x00000002
Edit 2: I removed the 0x and only put in 00000002 and it seems to have worked.
So basically if you dont have those folders make them yourself they are called keys in the new menu and then when you get to \chrome make a dword called ExtensionManifestV2Availability and set it to 00000002.
Please let me know if anything I did here is wrong. Thanks a lot for the guide!

If it was right you'll see it ExtensionManifestV2Availability in chrome://policy

Yeah you are right it shows up there. Thanks for the info.

@BinBashBanana
Copy link

On windows you can run reg add HKLM\Software\Policies\Google\Chrome /v ExtensionManifestV2Availability /t REG_DWORD /d 2 /f in cmd

@vulpes2
Copy link

vulpes2 commented Aug 9, 2024

For macOS the value needs to be set as an integer.

Chrome:
defaults write com.google.Chrome ExtensionManifestV2Availability -int 2
Chromium:
defaults write org.chromium.Chromium ExtensionManifestV2Availability -int 2

@velzie
Copy link
Author

velzie commented Aug 9, 2024

@vulpes2 thank you!

@GameDoggo
Copy link

On windows you can run reg add HKLM\Software\Policies\Google\Chrome /v ExtensionManifestV2Availability /t REG_DWORD /d 2 /f in cmd

Thank You! Saved! (I made an account just to thank you btw)

@ultrabear
Copy link

on my Manjaro install using the extra/chromium package, the policy folder was located in /etc/chromium/policies/..., note the lack of opt

@vzvzxv
Copy link

vzvzxv commented Sep 15, 2024

Powershell option from this thread:
Run powershell as admin and then use this command:
$path = "registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome"; New-Item $path -Force; Set-ItemProperty $path -Name ExtensionManifestV2Availability -Value 2

@The-Stolas
Copy link

Thank you!

@enchained
Copy link

This change makes Chrome say "Your browser is managed by your organization" in the settings. It has an impact of disabling browser DNS setting, and maybe something else. Some claimed they had issues restoring browser to unmanaged state even after clearing the registry.

I found an official guide on how to properly clear out the policies and their cache: https://support.google.com/chrome/a/answer/9844476?hl=en

Policy state can also be checked here (after successful modification it says ExtensionManifestV2Availability: 2):
chrome://policy/

@BinBashBanana
Copy link

Try setting "DnsOverHttpsMode": "secure"
Windows command: reg add HKLM\Software\Policies\Google\Chrome /v DnsOverHttpsMode /t REG_SZ /d secure /f

The value "automatic" can also be used instead of "secure".

source

@joe-mojo
Copy link

joe-mojo commented Nov 8, 2024

For Ubuntu : Chromium is packaged by snap, so the right file is /var/snap/chromium/current/policies/managed/policy.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment