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

Add new scriptlet — 'href-sanitizer' #327

Closed
MasterKia opened this issue Jun 14, 2023 · 2 comments
Closed

Add new scriptlet — 'href-sanitizer' #327

MasterKia opened this issue Jun 14, 2023 · 2 comments

Comments

@MasterKia
Copy link
Contributor

Related uBO scriptlet:
https://github.com/uBlockOrigin/uBlock-issues/wiki/Resources-Library#href-sanitizerjs-


Related issues/commits:
uBlockOrigin/uBlock-issues#2531

gorhill/uBlock@e123256

gorhill/uBlock@56e1d92


It can be used to replace some click tracking links with the actual link.
The most notable case is https://www.mozilla.org/en-US/firefox/browsers/mobile/android/ where the "Get it on Google play" button has app.adjust.com tracking link.


Usage so far in uBO lists:

! https://github.com/uBlockOrigin/uBlock-issues/issues/2531#issuecomment-1512373333
mozilla.org##+js(href-sanitizer, a[href^="https://app.adjust.com/"][href*="?redirect="], ?redirect)

! https://www.androidauthority.com/third-party-reddit-apps-statement-3332238/ redirect links
androidauthority.com##+js(href-sanitizer, a[href^="https://androidauth.wpengine.com/wp-json/api/advanced_redirect?ref="], ?ref)

! https://www.pcgamingwiki.com/wiki/Grand_Theft_Auto_V
pcgamingwiki.com##+js(href-sanitizer, a[href^="https://www.dpbolvw.net/click-"][href*="?url="], ?url)
pcgamingwiki.com##+js(href-sanitizer, a[href^="https://greenmangaming.sjv.io/c/"][href*="?u="], ?u)

! https://azrom.net/rom-oppo-a71-cph1717-cph1801-official-firmware-all-repair-file/ timer
azrom.net##+js(href-sanitizer, a[href^="https://azrom.net/"][href*="?url="], ?url)
@Dimsday
Copy link

Dimsday commented Sep 14, 2023

Also example:

! https://vk.com/away.php?to=https%3A%2F%2Fdodo-space.ru%2F ->https://dodo-space.ru/
vk.com##+js(href-sanitizer, a[href^="https://vk.com/away.php"][href*="?to=], ?to)

@slavaleleka slavaleleka added the Feature request Adding new feature label Nov 2, 2023
@adguard-bot adguard-bot assigned 105th and unassigned maximtop Jan 12, 2024
@adguard-bot adguard-bot assigned slavaleleka and unassigned 105th Feb 8, 2024
adguard pushed a commit that referenced this issue Feb 26, 2024
Squashed commit of the following:

commit e9d5477
Author: Adam Wróblewski <adam@adguard.com>
Date:   Thu Feb 22 19:57:27 2024 +0100

    Run observeDOMChanges after DOMContentLoaded

commit 303f529
Author: Adam Wróblewski <adam@adguard.com>
Date:   Thu Feb 22 15:02:01 2024 +0100

    Add addEventListener
    Add isSanitizableAnchor helper
    Use forEach
    Rename elem to elementSelector

commit 218e93a
Merge: be5c6d4 46c3183
Author: Adam Wróblewski <adam@adguard.com>
Date:   Thu Feb 22 08:33:21 2024 +0100

    Merge branch 'master' into feature/AG-23175

commit be5c6d4
Author: Adam Wróblewski <adam@adguard.com>
Date:   Thu Feb 22 08:31:23 2024 +0100

    Add logging for modified href

commit d5cb510
Author: Adam Wróblewski <adam@adguard.com>
Date:   Wed Feb 21 13:12:21 2024 +0100

    Allow only http: and https: protocol

commit 73d2c5a
Author: Maxim Topciu <mtopciu@adguard.com>
Date:   Wed Feb 21 14:26:58 2024 +0300

    Add return type

commit bae2b30
Author: Maxim Topciu <mtopciu@adguard.com>
Date:   Wed Feb 21 14:26:21 2024 +0300

    Update JSDoc

commit d77d01f
Merge: db038c2 b273341
Author: Adam Wróblewski <adam@adguard.com>
Date:   Tue Feb 20 20:36:41 2024 +0100

    Merge branch 'master' into feature/AG-23175

commit db038c2
Author: Adam Wróblewski <adam@adguard.com>
Date:   Tue Feb 20 20:17:56 2024 +0100

    Remove types from JSDoc

commit a478c30
Author: Adam Wróblewski <adam@adguard.com>
Date:   Mon Feb 19 20:14:12 2024 +0100

    Convert to TypeScript

commit cc713da
Author: Slava Leleka <v.leleka@adguard.com>
Date:   Mon Feb 19 19:11:12 2024 +0300

    Use toLowerCase() method

commit f95464a
Author: Slava Leleka <v.leleka@adguard.com>
Date:   Mon Feb 19 19:10:10 2024 +0300

    Update test

commit 4712087
Author: Slava Leleka <v.leleka@adguard.com>
Date:   Mon Feb 19 19:09:36 2024 +0300

    Update description

commit 76005cf
Author: Slava Leleka <v.leleka@adguard.com>
Date:   Mon Feb 19 19:09:14 2024 +0300

    Update description

commit 357639d
Author: Slava Leleka <v.leleka@adguard.com>
Date:   Mon Feb 19 19:08:43 2024 +0300

    Remove unnecessary eslint-enable

commit d894ccd
Author: Slava Leleka <v.leleka@adguard.com>
Date:   Mon Feb 19 19:08:22 2024 +0300

    Remove unnecessary eslint-disable

commit e06873b
Author: Slava Leleka <v.leleka@adguard.com>
Date:   Mon Feb 19 19:04:36 2024 +0300

    Update description

    Change unreleased to unknown

commit fab542b
Author: Adam Wróblewski <adam@adguard.com>
Date:   Fri Feb 16 14:32:37 2024 +0100

    Add href-sanitizer scriptlet
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

6 participants