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

Convert "$rewrite=abp-resource" into "$redirect" #857

Closed
5 tasks done
DandelionSprout opened this issue Jan 14, 2020 · 13 comments
Closed
5 tasks done

Convert "$rewrite=abp-resource" into "$redirect" #857

DandelionSprout opened this issue Jan 14, 2020 · 13 comments
Labels
enhancement New feature or request fixed issue has been addressed

Comments

@DandelionSprout
Copy link

DandelionSprout commented Jan 14, 2020

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...
    • [N/A] uBlock Origin is the only extension
    • [N/A] uBlock Origin with default lists/settings
    • [N/A] using a new, unmodified browser profile
  • I am running the latest version of uBlock Origin (Nano 1.0.0.135)
  • I checked the documentation to understand that the issue I report is not a normal behavior

Description

Three relatively important lists (EasyList, Liste FR, ABP Anti-Circumvention), two of which are included in uBO, have begun to write entries based on $rewrite=abp-resource, which is quite obviously based on uBO and AdGuard's $redirect but is not supported by uBO. I therefore suppose that converting $rewrite=abp-resource entries into their $redirect equivalents could be something to do.

Although https://help.eyeo.com/adblockplus/how-to-write-filters#rewrite lists 9 internal resources, only 2 are known by me to be used in any lists ever made (excluding the ABP-specific version of my Nordic list), namely blank-mp3 and blank-js.

Comprehensive listing of all $rewrite=abp-resource entries I could find in major lists:

EasyList:
||slacker.com^*/getspot/?spotid=$media,rewrite=abp-resource:blank-mp3,domain=slacker.com

Liste FR:
||delivery.tf1.fr/pub$media,rewrite=abp-resource:blank-mp3,domain=tf1.fr
||dnl-adv-ssl.tf1.fr^$media,rewrite=abp-resource:blank-mp3,domain=tf1.fr
||loadshare.org/custom/$media,$rewrite=abp-resource:blank-mp3,domain=01fmovies.com [sic; I've reported that entry's use of two $'s to the Lanik forum.]
||static.6cloud.fr^*.mp4$media,rewrite=abp-resource:blank-mp3,domain=6play.fr
||tf1.fr/assets/js/build/lib/ad$rewrite=abp-resource:blank-js,domain=tf1.fr

ABP Anti-Circumvention:
||glomex.com^$media,rewrite=abp-resource:blank-mp3,domain=player.glomex.com
||adform.net/banners/scripts/adx.js$domain=delfi.lt,rewrite=abp-resource:blank-js

My presumption for how such conversions could work:

  • blank-textnoop.txt
  • blank-css → Has no direct equivalent. Possibly noop.txt.
  • blank-jsnoop.js
  • blank-htmlnoop.html
  • blank-mp3noop-0.1s.mp3
  • 1x1-transparent-gif1x1.gif
  • 2x2-transparent-png2x2.png
  • 3x2-transparent-png3x2.png
  • 32x32-transparent-png32x32.png

As this issue report is specifically about extension-internal resources, I'm pretty sure it's not a duplicate of #46.

A specific URL where the issue occurs

N/A

Steps to Reproduce

  1. Download Nano Adblocker, as it has a syntax checker that uBO doesn't have.
  2. Check out Liste FR from within that extension.
  3. Ctrl+F your way down to the $rewrite=abp-resource entries.
  4. See that they're marked in bright red, which means that Nano and uBO thinks of the entry as invalid.

Expected behavior:

That the entries are not marked in red in Nano's list syntax checker.

Actual behavior:

That the entries are treated as invalid.

Your environment

  • uBlock Origin version: Nano Adblocker 1.0.0.135 + Nano Defender 15.0.0.180
  • Browser Name and version: Chrome 79.0.3945.117 64-bit
  • Operating System and version: Windows 10 November 2019 Update
@uBlock-user uBlock-user added the enhancement New feature or request label Jan 14, 2020
@gorhill
Copy link
Member

gorhill commented Jan 14, 2020

Three relatively important lists (EasyList, Liste FR, ABP Anti-Circumvention), two of which are included in uBO

"ABP Anti-Circumvention" should never ever be added to uBO, it's specifically made for ABP and is likely to break uBO in bad ways -- it was never designed for any other blocker than ABP (and its subsidiaries blockers).

We must make sure to make it known that this list should never be used in uBO; opening an issue of compatibility with "ABP Anti-Circumvention" suggests that the list should be used in uBO, which is opposite of the official advice.

That said, I agree that uBO should try to increase compatibility with EasyList and Liste FR.

@vlaszlo
Copy link

vlaszlo commented Jan 14, 2020

We must make sure to make it known that this list should never be used in uBO; opening an issue of compatibility with "ABP Anti-Circumvention" suggests that the list should be used in uBO, which is opposite of the official advice.

A first step there would be to notify the maintainer(s) of FilterLists to remove the uBO (and possibly Nano Adblocker) compatibility icons from their listings of the ABP Anti-Circumvention filter lists.

@uBlock-user
Copy link
Contributor

/cc @collinbarrett

@DandelionSprout
Copy link
Author

DandelionSprout commented Jan 15, 2020

Speaking by virtue of being the main infobase updater on that site, I'll agree to mark that list as ABP- and AdBlock-only, but I'll do it on the grounds of Anti-Circumvention's extensive use of #$# scriptlets and :-abp-properties, and not necessarily for you guys' reasons.

@krystian3w
Copy link

krystian3w commented Jan 18, 2020

ABP do not have important so few rewrite newer works if any added exception @@ in the past.


ABP also no need type blocked of request?

||tf1.fr/assets/js/build/lib/ad$rewrite=abp-resource:blank-js,domain=tf1.fr

above no have media / object / script / xhr etc.

@DandelionSprout
Copy link
Author

DandelionSprout commented Feb 1, 2020

I've also noticed that it'd be plausibly feasible to convert $webrtc (of which there's a lot of entries in EasyList and EasyList-hosted lists) into ##+js(nowebrtc), but I'm unsure if that's a matter for a separate issue report or not.

@krystian3w
Copy link

krystian3w commented Feb 1, 2020

Better new - ABP can use regex/wildcard for webrtc (?) - uBO for domains / TLD only (?).

! no possible convert
/bitcon.(js|aspx?)/$webrtc

⬇️

! unknown domain if no have before `$` or `domain=`
...##+js(nowebrtc)

⬇️

! invalid regex (redirect reject this) and type of block request
/bitcon.(js|aspx?)/$all,redirect=nowebrtc.js

@uBlockOrigin uBlockOrigin deleted a comment from prateekrastogi May 5, 2020
gorhill added a commit to gorhill/uBlock that referenced this issue Dec 9, 2020
Related issue:
- uBlockOrigin/uBlock-issues#857

The recognized resources are:
- abp-resource:blank-mp3
- abp-resource:blank-js

ABP's tokens are excluded from auto-complete so as to not
get in the way of uBO's filter list maintainers.
@gorhill
Copy link
Member

gorhill commented Dec 9, 2020

I did add compatibility, but frankly it does not feel like an accomplishment which benefit uBO and rather like a feeling of having wasted time on a non issue given that none of the cases provided is an issue for uBO ever since uBO has replaced Liste FR with AdGuard Français.

@gorhill gorhill closed this as completed Dec 9, 2020
@uBlock-user uBlock-user added the fixed issue has been addressed label Dec 9, 2020
@DandelionSprout
Copy link
Author

DandelionSprout commented Dec 9, 2020

This will make it easier for e.g. EasyList, EasyList Spanish, EasyList Italy, and other officially ABP-affiliated lists to add these kind of entries to their lists, so I am firmly confident that your efforts were not wasted.

It's currently an open question how many such lists that would add such entries now, however.

@krystian3w
Copy link

krystian3w commented Dec 9, 2020

Maybe depend how old ABP must be supported by EasyList projects - if any very old ABP 1.0 / 1.1 & 2.0 maybe rare of lists start use rewrite for ABP users if works exception and cosmetic hide ad-reinsertion.

@gorhill
Copy link
Member

gorhill commented Dec 9, 2020

I don't understand how this would make it easier for ABP-affiliated list maintainers -- surely uBO was not preventing them from making use of whatever ABP-specific options they wanted to use? For example, they do not shy away from using :-abp-properties() even if uBO is not recognizing that filter option.

@gorhill
Copy link
Member

gorhill commented Dec 9, 2020

Additionally, the reason ABP-affiliated maintainers are not using rewrite= as much as they would is probably because of an implementation flaw in ABP: https://gitlab.com/eyeo/adblockplus/adblockpluscore/-/issues/241.

If a block filter is found before a rewrite= filter, the rewrite= will never be applied, and maintainers have no control over that internal behavior of ABP's filtering engine.

@DandelionSprout
Copy link
Author

Okay, those are admittedly good points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

6 participants
@gorhill @vlaszlo @uBlock-user @DandelionSprout @krystian3w and others