uBlockOrigin / uBlock-issues

This is the community-maintained issue tracker for uBlock Origin
https://github.com/gorhill/uBlock
936 stars 79 forks source link

Add more options to `trusted-click-element` #2917

Open D4niloMR opened 11 months ago

D4niloMR commented 11 months ago

Prerequisites

I tried to reproduce the issue when...

Description

Some details: https://github.com/AdguardTeam/AdguardFilters/commit/cb4900805ad9972c99cee421bacf825906c49ef5

This isn't be the best solution, but it can provide a quick and easy fix, to later properly fix it.

The skippable primevideo ad may be fixable by others filters, but the main goal is the potential of trusted-click-element

Based on this documentacion and in my own usage, trusted-click-element works fine for primevideo skip ad, but after 10 seconds the scriptlet stop, or if click the element 1 time, so it will either skip 1 ad only or skip none because you waited more than 10 seconds to choose a movie/serie.

With the "expected behavior" below, can be used more reliably to click on timer: https://github.com/uBlockOrigin/uAssets/pull/20314

A specific URL where the issue occurs.

https://www.primevideo.com/region/na/detail/0F7QZ8SNFP7NSGO3UW77XTFI5F/ref=atv_dp_atf_prime_sd_mv_resume_t1ADAAAAAA0wg0?autoplay=1&t=0

Steps to Reproduce

  1. On https://www.primevideo.com/region/na/storefront/
  2. Choose a recommended movie.
  3. Skippable ad on your face.

Expected behavior

trusted-click-element being able to click on "skip" n times without stopping.

New options:

, stay, 1 to stay indefinitily until element is clicked.

And something like , clicks, numberofclickshere to the , stay, 1

Examples: , stay, 1, clicks, 3 to stay indefinitily until element is clicked three times , stay, 1, clicks, 0 stay indefinitily even after clicking in the element. (Forever)

Actual behavior

Just click "Skip" once and within 10 seconds.

uBO version

1.52.3rc16

Browser name and version

Firefox 119

Operating System and version

Windows 10 19045

BlazeFTL commented 11 months ago

Definitely Would Be Great... Clicking On A Element 3-4 Times With A Delay + Delay Count Starting After Page Loads Completely

GunGunGun commented 11 months ago

+1, as this will be one of the better way to solve Youtube's anti-adblock by clicking Skip instead of blocking their code.

This is a few examples of clicking to skip Youtube:

  1. https://raw.githubusercontent.com/0x48piraj/fadblock/master/src/safari/js/fadblock.user.js
  2. https://greasyfork.org/en/scripts/386925-youtube-ad-cleaner-include-non-skippable-ads-works
  3. https://greasyfork.org/en/scripts/459541-youtube%E5%8E%BB%E5%B9%BF%E5%91%8A-youtube-ad-blocker/
peace2000 commented 11 months ago

I think it would be good idea to have an option like "stay active until the element is actually clicked".

Another reason is that adding a delay doesn't always work properly on different pc's. I have noticed on consent.youtube.com that in the last page where consent options are configured and accepted, the accept button might not be clicked. On my faster pc, I had no issues but on my slower, old pc clicking the last button didn't always work. (I had to switch the YT solution to a different one: https://github.com/uBlockOrigin/uAssets/commit/f9ee52c3a14ed555119cf0e8cfefd7a63d868723)

Probably it would be ok if the delay would be big enough, but filter author can't really know what delay works universally for all pc's and across different browsers. Adding a huge delay "just in case" causes the dialog to be visually visible for too long time for every one and it's a bad solution.

On Slack, there was a discussion about chrono24.com GDPR dialog. For @ryanbr and @stephenhawk8054 100 ms delay was ok, but for @JobcenterTycoon, 1000 ms was needed. On my end, 100ms works sometimes... to be on the safe side to click the GDPR dialog properly https://github.com/uBlockOrigin/uAssets/commit/02f1d7117f2c9939a7ec69908cf0046cad3038c5 1000ms was added. (chrono24.com could luckily be workarounded by hiding the dialog via cosmetic filtering, but still, it's not optimal way as clicker shouldn't need to rely on cosmetic hiding.)