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

Feature request: Auto update option for the extension #2477

Open
dave90dave opened this issue Nov 27, 2023 · 15 comments
Open

Feature request: Auto update option for the extension #2477

dave90dave opened this issue Nov 27, 2023 · 15 comments

Comments

@dave90dave
Copy link

Hi,

Since Adnauseam is banned from the chrome store, it is unpractical to update the extension manually every time,
Also are users probably not check very often for new extension updates manually.

Wherefore, I would really to like suggest an automatic extension update functionality.
Is there already such functionality being developed at this time?

I also hope that the AdNauseam extension becomes better accessable for users to install soon, because for most users it is inpractical to install the extension for chrome using developer mode.

Regards
Dave

@dhowe
Copy link
Owner

dhowe commented Nov 28, 2023

Thanks @dave90dave is there an existing extension that does auto-update from outside the chrome store (that we could use as a model)?

@dave90dave
Copy link
Author

dave90dave commented Dec 2, 2023

Well as far as I know there are not a lot chrome extensions like that.
Most extensions do use the chrome webstore API's to update their plugins, and since the Chrome's security model generally prevents extensions from updating themselves without going through the Chrome Web Store, it is likely that a working update script needs still to be written.

Since Adnauseam is only available outside the chrome web store, it seems that the most fluent way for updating would be writing a script that checks for the latest version periodically, to download the new extension from something like a external web server.

I also would like to recommend you the following:

  • In the near future, the Google Chrome Store might be subject to the DSA (Digital Services Act) and the DMA (Digital Markets Act) in Europe. Those laws prevent 'gatekeepers' (like Google) from applying unfair practices that might lead to unfair competition. The DSA and DMA start working around next year.

According to the DMA, paragraph 5, gatekeepers (like Chrome web store) are required to:

  • allow end users to access and use, through its core platform services, content, subscriptions,
    features or other items, by using the software application of a business user, including where those end users acquired such items from the relevant business user without using the core platform services of the gatekeeper

This promotes user choice and prevents gatekeepers from limiting access to certain services. So if you would like to get Adnauseam back into the chrome store again, you might consider filing a complaint when the DMA starts to work next year.

There is a chance that if you file a notice of objection to Google, grounded on those laws, that they might be required to reëxamine the extension, and probably are required to enable it again in the web store (at least in Europe).

It might be worth the try.

@mneunomne
Copy link
Collaborator

From what I was able to research, auto-update for extensions not supported on google web store is currently only possible when using Chrome Enterprise Policies, which are Chrome browsers custumised to be used within an organization.

https://developer.chrome.com/docs/apps/autoupdate/

If you are hosting a CRX file on a web server and using enterprise policies to push it to managed devices, keep reading. You should also read Hosting and Packaging

Previously when off-store extensions were supported, it was possible to have the native binaries and the extension be updated in lock step. However, extensions hosted on the Chrome Web Store are updated via the Chrome update mechanism which developers do not control. Extension developers should be careful about updating extensions that have a dependency on the native binary (for example, legacy extensions using NPAPI).

And about entreprise policies:

As enterprises adopt Chrome Browser and ChromeOS, they often require added controls and configurations to meet their productivity and security needs. This can be achieved through the management of Chrome Enterprise policies. Chrome Enterprise policies give IT admins the power to configure Chrome for their organization or business. You can manage browsers on-premise for Windows or Mac/Linux, or manage browsers for all desktop platforms using Chrome Browser Cloud Management.

But it all seems rather unclear to me. I think we should contact them directly about this.

@dave90dave
Copy link
Author

If auto-update from the browser is not possible, maybe an idea could be, that you can install an auto updater application (.exe file), that places organisation like policies on the local pc, and that enforces the periodic update of the extension?
Maybe an easy installer application from AdNauseam with an auto-updater feature by enforcing organisation policy's on the local computer might be a working solution to this?

@dhowe
Copy link
Owner

dhowe commented Dec 5, 2023

This might also be something to consider rolling ourselves, if its correct that no one has done similar. What steps would be required for a simple, possibly interactive, update mechanism ?

  • check current version against (verified) newest released version (perhaps on github)
  • download newest release
  • transfer settings/vault (needed?)
  • install over current
  • ?

Could this be done from within the extension (or via specific page-visits), rather than via app or exe?

@dave90dave
Copy link
Author

Well, it's not possible for a Google Chrome extension to directly overwrite existing files on a user's system. Chrome extensions operate within a secure sandbox environment to prevent security vulnerabilities and unauthorized access to user data.

Extensions primarily have access to web-based resources and can interact with web pages through the Document Object Model (DOM). They are limited in their ability to interact with the user's file system for security reasons. Extensions can use the chrome.fileSystem API to interact with files, but they can't directly overwrite files on a user's system.
Therefore, using a external application to keep the extension up-to-date is probably imminent.

Since the extension is being installed manually, it might be useful to create a windows-services that checks the extension updates periodically, and overwrites the old extension somehow.

@dave90dave
Copy link
Author

You'll need:

  • a versioning syste
  • an update server
  • the client should check the current version once in a while
  • when availible, it should update the app (not overwriting the user data)
  • and probably needs to reboot the browser after a update (or waiting until the browser is being closed by the user to avoid bugs and conflicts during the update)

The data stored should be backed-up too, just in case a update fails.
I expect that the browser might give a pop-up after updating, with the question to re-enable the extension. So that's also something to consider.

@dhowe
Copy link
Owner

dhowe commented Dec 12, 2023

I don't think a separate app is something we have the resources to support at this point. I'm more interested in an interactive mechanism within the addon, as mentioned above. For users who have this enabled, it might do something like:

  • periodically check the current release version
  • when out-of-date, alert the user and bring them to a download page for the new version
  • guide them through the steps to update
  • or the user could choose 'not now' to be reminded again later

At very least users will know when they are an out-of-date, which is not the case now

@mneunomne
Copy link
Collaborator

@dhowe I made this simple shell script that checks online for the latest non-prerelease and if not updated, download and substitute the folder. I guess this can be adapted for some kind of auto-update function for chromium users.

#!/bin/bash

# Path to the adnauseam.chromium directory
EXTENSION_DIR="adnauseam.chromium"

# Path to the manifest.json file
MANIFEST_FILE="$EXTENSION_DIR/manifest.json"

# Check if the directory exists
if [ -d "$EXTENSION_DIR" ]; then
    # Get the current version from the manifest file
    CURRENT_VERSION=$(jq -r .version "$MANIFEST_FILE")
    CURRENT_VERSION="v$CURRENT_VERSION"
    echo "Current version: $CURRENT_VERSION"

    # Replace URL with the actual URL you want to use
    URL="https://api.github.com/repos/dhowe/AdNauseam/releases/latest"

    # Get the latest release information using curl and jq
    LATEST_RELEASE=$(curl -s "$URL" | jq -r '.tag_name')

    # Check if the latest version is different from the current version
    if [ "$LATEST_RELEASE" != "$CURRENT_VERSION" ]; then
        echo "Updating AdNauseam extension..."

        # Download and extract the latest release
        curl -L -o "$EXTENSION_DIR.zip" "https://github.com/dhowe/AdNauseam/releases/download/$LATEST_RELEASE/adnauseam.chromium.zip"
        unzip -q "$EXTENSION_DIR.zip" -d "./"
        rm "$EXTENSION_DIR.zip"

        echo "Update complete. Installed version: $LATEST_RELEASE"
    else
        echo "AdNauseam is already up to date. Installed version: $CURRENT_VERSION"
    fi
else
    echo "AdNauseam extension directory not found. Please make sure it is installed."
fi

@dhowe
Copy link
Owner

dhowe commented Jan 16, 2024

@mneunomne thanks for this -- how do you imagine it being used ?

@Mikaela
Copy link

Mikaela commented Feb 28, 2024

It looks like Microsoft isn't blocking Chromium or Chrome from using its update server so the following enterprise policy will at least result to the extension being installed and I don't see why it wouldn't keep getting updated as long as Microsoft won't block other browsers:

{
  "ExtensionSettings": {
      "mlojlfildnehdpnlmpkeiiglhhkofhpb": {
      "installation_mode": "normal_installed",
      "override_update_url": true,
      "toolbar_pin": "force_pinned",
      "update_url": "https://edge.microsoft.com/extensionwebstorebase/v1/crx"
      }
  }
}

The enterprise profile locations are:

  • Chromium: /etc/opt/chromium/policies/managed/
  • Brave: /etc/brave/policies/managed/
  • Vivaldi: /etc/chromium/policies/managed/
  • Google Chrome: /etc/opt/chrome/policies/managed/
  • Microsoft Edge: /etc/opt/edge/policies/managed/

And the json can be named whatever as long as it ends to .json, the only restrictions I have learned in a month of on-off playing around with browser policies are banner about policy being managed by organization and that the setting can only appear in one file at a time (in other words no specifying ExtensionSettings{} in multiple policies). Oh and DoH locks itself unless a policy says "DnsOverHttpsMode": "automatic".

@dhowe
Copy link
Owner

dhowe commented Feb 29, 2024

@mneunomne can you look into this -- we should do it anyway for Edge users, but would be a nice workaround for Chrome (thanks @Mikaela)

@mneunomne
Copy link
Collaborator

Thanks @Mikaela I will test it myself on edge on my computer and understand how far we can go with it.

@dave90dave
Copy link
Author

dave90dave commented Mar 13, 2024

Hello,

I've been away from some time, but I might have a better suggestion.
Although, this will only work within the European Union.

Since this month, a new regulation was entered into force, in the EU called: Digital Markets Act

It is now possible to appeal the decision of google to take down the Adnauseam extenstion from the chrome webstore.
The Digital Markets Act requires Google (and other large companies) to safeguard the human rights in their systems (Freedom of speech/press)

If you want to reinstate the extension in the Chrome Webstore, this might be the way.
Please let me know if you want more information to get Adnauseam in the Chrome Webstore again.

@Mikaela
Copy link

Mikaela commented May 24, 2024

uBlockOrigin/uBlock-issues#2977 (reply in thread) might also be of interest here.

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

No branches or pull requests

4 participants