AdguardTeam / AdguardBrowserExtension

AdGuard browser extension
https://adguard.com/
GNU General Public License v3.0
3.1k stars 331 forks source link

Compatibility with uBlock Origin's "!#if env_mobile" syntax #2146

Open MasterKia opened 2 years ago

MasterKia commented 2 years ago

Related issue: https://github.com/AdguardTeam/AdguardBrowserExtension/issues/1971

I remember @ameshkov saying that "AdGuard is aiming to have full compatibility with uBO's extended syntax to make life easier for filterlist maintainers", but it turns out that's not the case.

As described here, uBO supports !#if env_mobile condition but AdGuard ignores anything in between the !#if env_mobile block. For now I just got rid of the "env_mobile" but it might become problematic in future.

Reproduced in Firefox Mobile using AdGuard add-on 4.0.204.

cc @DandelionSprout @maximtop

maximtop commented 2 years ago

Hi, Ok, we will take a look.

krystian3w commented 2 years ago

Maybe dropped due no exist folder "extension/mobile/firefox" on adtidy.

MasterKia commented 1 year ago

For now I've resorted to using !#if (adguard_app_android || adguard_app_ios) which is inaccurate since it can't target mobile Firefox users who use the AdGuard add-on.

krystian3w commented 1 year ago

Yandex Mobile and Kiwi Mobile may also support install crx MV2/MV3 extension.

Along the way, something ungoogled-Chromium also tried to make computer extensions work, but they rather withdrew support (even as someone made a long manual on how to install and update).

Still supposedly some other browser with some CRX support came to Google Play.

ameshkov commented 1 year ago

Note, that we'll also need this in CoreLibs.

krystian3w commented 1 year ago

I am curious uBo !#if env_firefox works properly when using Windows/macOS/Android apps (assuming that any interference will skuct that the corruption is reproducible in Chromium and Safari)?

ameshkov commented 1 year ago

It's ignored, pre-processor directives are applied when the rules are downloaded, and not in runtime when AG does content filtering.

sysfu commented 2 months ago

Yandex Mobile and Kiwi Mobile may also support install crx MV2/MV3 extension.

Along the way, something ungoogled-Chromium also tried to make computer extensions work, but they rather withdrew support (even as someone made a long manual on how to install and update).

Still supposedly some other browser with some CRX support came to Google Play.

So to be clear, it's no longer possible to install Adguard extension on ungoogled Chromium, and hasn't been for over year?

if so that's a bummer.

github-actions[bot] commented 1 day ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

MasterKia commented 1 day ago

Bump

ameshkov commented 1 day ago

This is a bit more complicated then it may look like at first considering that the browser extension come with some initial pre-baked filter lists.

The changes that needs to be done to fully:

  1. The easy part: add env_mobile dynamically when the extension runs on mobile.

But there are two more complicated steps that also make sense and need to be filed as separate tasks linked to this issue:

  1. FiltersCompiler should somehow ignore env_mobile and let it inside filter lists (so that these were interpreted by the ad blockers themselves) -- unlike what it usually does when it expands all pre-processor directives.
  2. We may also want to use this in iOS / Android so they need to be changed and pass that flag to FLM (when they start using it).