AdNauseam icon indicating copy to clipboard operation
AdNauseam copied to clipboard

Ensure auto-updates on Chrome (consistent appId)

Open dhowe opened this issue 2 years ago • 14 comments

To enable automatic updates (via https://rednoise.org/adnauseam/updates.xml) we need to ensure that the same id is used for each newly released version. The ID (for the current version 3.13.1) on Chrome should be mbfbgdonmnbmjjhhfoinempobihojlao.

I've added it to the manifest.json, but we need a workflow that ensures any new releases have this id

dhowe avatar May 30 '22 08:05 dhowe

Its essential that we have auto-update for chrome users

dhowe avatar Jul 26 '22 17:07 dhowe

see also: https://dangphongvanthanh.wordpress.com/2017/02/14/keep-chrome-extension-id-same-during-development/

dhowe avatar Jul 30 '22 20:07 dhowe

Tried this approach but still i am not succeding in using the generated .pem in the build process that we currently have, maybe there is something outdated in our building script:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --pack-extension=dist/build/adnauseam.chromium --pack-extension-key=/Users/albertoharres/AdNauseam/private_key.pem

Found some useful information here as well: https://stackoverflow.com/questions/21497781/how-to-change-chrome-packaged-app-id-or-why-do-we-need-key-field-in-the-manifest

mneunomne avatar Jul 31 '22 22:07 mneunomne

I tried to make this work by generating the .pem and fixing this part of the code that doesn't make much sense at the moment:

https://github.com/dhowe/AdNauseam/blob/4875b49bd51bb4db689a187890f8ae0ed76191db/tools/make-artifacts.sh#L49-L57

CHROME_PEM variable is actually never defined and it always just blank. I tried changing it to the actual private-key path but still doesn't work. Seems like there is something simple that I am missing, or perhaps I am understanding something wrongly.

mneunomne avatar Aug 03 '22 08:08 mneunomne

CHROME_PEM needs to be defined as an environment variable, containing the path to the private key file

dhowe avatar Aug 03 '22 17:08 dhowe

Fixed after @dhowe latests changes, our chrome appid is:

dkoaabhijcomjinndlgbmfnmnjnmdeeb

mneunomne avatar Aug 17 '22 10:08 mneunomne

we need to test that auto-update is working for the next release (can this be done or do we have to wait until next-next)?

dhowe avatar Aug 17 '22 19:08 dhowe

I believe we can do it if we update the online .xml file yes.

mneunomne avatar Aug 17 '22 19:08 mneunomne

Latest stable release (v3.15.1) seems to have mismatched appId again

Screenshot of extension page with appIds (Including betas) [Brave Nightly v1.47.46 / Chromium 107.0.5304.91] Screenshot of extension page with appIds

JunkiEDM avatar Nov 08 '22 13:11 JunkiEDM

@JunkiEDM did you installed it with .crx file? It seems that chromium extensions don't accept them anymore. the correct way of installing in chromium browsers is by "load unpacked" option.

By installing it with "load unpacking", the appid remains consistent:

dkoaabhijcomjinndlgbmfnmnjnmdeeb

mneunomne avatar Nov 08 '22 14:11 mneunomne

It seems that auto-update might not be possible anymore since we can't install AdNauseam using the .crx file.

https://stackoverflow.com/questions/49948829/are-unpacked-chrome-extensions-automatically-updated

No, chrome would not auto-update the unpacked extension(that is in developer mode). Whenever you load an unpacked extension, you get a unique app id which will be different from the one that is hosted on chrome web store or any other server. The update manifest returned by the server, which is the xml document required for updates, references this app id which would now be different. Therefore updates will not happen.

Only way to achieve this is this workaround on Windows OS a contributor has shared with us: https://github.com/dhowe/AdNauseam/wiki/Install-AdNauseam-in-Chrome-on-Windows

Besides this, our appid is consistent when making the signed build.

@dhowe Next steps would be to get the final confirmation on this, and update our documentation regarding the auto-update if it is not possible anymore.

mneunomne avatar Nov 14 '22 16:11 mneunomne

Only way to achieve this is this workaround on Windows OS a contributor has shared with us: https://github.com/dhowe/AdNauseam/wiki/Install-AdNauseam-in-Chrome-on-Windows

The policies for ExtensionInstallBlacklist and ExtensionIntstallWhitelist have been changed to ExtensionInstallAllowlist and ExtensionInstallBlocklist.

See: https://cloud.google.com/docs/chrome-enterprise/policies/?policy=ExtensionInstallAllowlist and https://cloud.google.com/docs/chrome-enterprise/policies/?policy=ExtensionInstallBlocklist and add ExtensionInstallSources

Create a new string value for this key called “1” (or any number higher than what is already there) set it to https://objects.githubusercontent.com/* to allow extension installs crx from github releases AdNauseam

candrapersada avatar Dec 12 '22 17:12 candrapersada

The policies for ExtensionInstallBlacklist and ExtensionIntstallWhitelist have been changed to ExtensionInstallAllowlist and ExtensionInstallBlocklist.

See: cloud.google.com/docs/chrome-enterprise/policies/?policy=ExtensionInstallAllowlist and cloud.google.com/docs/chrome-enterprise/policies/?policy=ExtensionInstallBlocklist and add ExtensionInstallSources

Create a new string value for this key called “1” (or any number higher than what is already there) set it to https://objects.githubusercontent.com/* to allow extension installs crx from github releases AdNauseam

This appears to have worked for me. I was having an issue where Chrome was removing this extension on every browser restart but after adding these two keys that is no longer happening.

CardcaptorRLH85 avatar Dec 19 '22 20:12 CardcaptorRLH85

Installing extensions via CRX is still possible in Chrome, Edge, Brave, and Vivaldi, but like previous comments mention, require registry edits to not be disabled automatically. Some extensions I've found that provide *.reg files for automatic updates are libredirect, Translate Web Pages, and TTV LOL PRO. For other chromium browsers it seems like no registry edits are needed, but might not auto-update. chromium-web-store also has some examples for auto-update support on their repo.

JunkiEDM avatar May 14 '23 03:05 JunkiEDM