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

Improve 'trusted-click-element' — add delay between multiple selectors clicks #284

Closed
piquark6046 opened this issue Jan 23, 2023 · 7 comments

Comments

@piquark6046
Copy link
Member

piquark6046 commented Jan 23, 2023

Expected Behavior

The following scriptlet rule works well like separated scriptlet rules.

thestrad.com#%#//scriptlet('trusted-click-element', '#notice .bottom-row button[title="Options"], .footer-policy button[title="Reject All"]')

Actual Behavior

Only the following separated scriptlet rules work as expected:

thestrad.com#%#//scriptlet('trusted-click-element', '#notice .bottom-row button[title="Options"]')
thestrad.com#%#//scriptlet('trusted-click-element', '.footer-policy button[title="Reject All"]')

Environment

  • Operating System: Ubuntu 22.10
  • Web Browser: Mozilla Firefox Developer Edition 110.0b4
  • Type of AdGuard Product: AdGuard Browser Extension (Standalone, 4.1.53)

Additional Information

@piquark6046 piquark6046 added the bug Something isn't working label Jan 23, 2023
@adguard-bot adguard-bot assigned zzebrum and unassigned zzebrum Jan 23, 2023
@stanislav-atr
Copy link
Contributor

Looks like static delay between clicks is required here, @slavaleleka what do you think?

@Alex-302
Copy link
Member

Another case:
https://www.3sat.de/kultur/musik/klavierabend-yuja-wang-100.html

After applying the single scriptlet, scrolling is not unblocked

3sat.de#%#//scriptlet('trusted-click-element', '#onetrust-button-group > button#onetrust-pc-btn-handler, .ot-pc-refuse-all-handler')

Before check, disable all flters and clear site's data.

All good, when used two rules instead of one. A small/configurable delay between clicks is required.

@adguard-bot adguard-bot changed the title Multiple selectors in trusted-click-element do not work Multiple selectors in 'trusted-click-element' do not work Jan 26, 2023
@piquark6046 piquark6046 changed the title Multiple selectors in 'trusted-click-element' do not work Add delay between multiple selectors in 'trusted-click-element' Jan 27, 2023
@piquark6046 piquark6046 changed the title Add delay between multiple selectors in 'trusted-click-element' Add delay between multiple selectors in trusted-click-element Jan 27, 2023
@Alex-302
Copy link
Member

Alex-302 commented Feb 6, 2023

Another case (check without Annoyances filters):
AdguardTeam/AdguardFilters#142120
Need a delay before click action.

Details

image

@adguard-bot adguard-bot changed the title Add delay between multiple selectors in trusted-click-element Add delay between multiple selectors in 'trusted-click-element' Feb 21, 2023
@maximtop
Copy link
Contributor

Another case from @Alex-302
https://www.spiegel.de/panorama/gesellschaft/peking-kuriose-felsenvilla-auf-wohnturm-aengstigt-anwohner-a-916184.html
player is blocked, rules applied can be seen in the filtering log

adguard pushed a commit that referenced this issue Mar 15, 2023
#284

Squashed commit of the following:

commit 229478a
Author: Adam Wróblewski <adam@adguard.com>
Date:   Wed Mar 15 10:19:40 2023 +0100

    Update changelog

commit b529e2e
Author: Adam Wróblewski <adam@adguard.com>
Date:   Tue Mar 14 17:24:30 2023 +0100

    Update changelog

commit 6d4ac3a
Author: Adam Wróblewski <adam@adguard.com>
Date:   Tue Mar 14 11:55:32 2023 +0100

    Update changelog

commit 1fafd31
Merge: 15ba0aa de45d19
Author: Adam Wróblewski <adam@adguard.com>
Date:   Tue Mar 14 11:45:24 2023 +0100

    Merge branch 'master' into fix/AG-19107

commit 15ba0aa
Author: Slava Leleka <v.leleka@adguard.com>
Date:   Tue Mar 14 13:39:25 2023 +0300

    Add a link to the issue

commit 6054ef1
Author: Adam Wróblewski <adam@adguard.com>
Date:   Mon Mar 13 14:41:38 2023 +0100

    Add constant for static delay
    Simplify comment

commit 7e3c3cf
Author: Adam Wróblewski <adam@adguard.com>
Date:   Mon Mar 6 19:06:12 2023 +0100

    Revert changes in description

commit b343b13
Author: Adam Wróblewski <adam@adguard.com>
Date:   Mon Mar 6 18:40:48 2023 +0100

    Add static delay between clicks
    Simplify variable
    Add unit dimensions in the variable name

commit 727e00a
Author: Adam Wróblewski <adam@adguard.com>
Date:   Sun Mar 5 18:44:09 2023 +0100

    Add ability to set a delay between clicks
    Fix issue with disconnect
@adguard-bot adguard-bot changed the title Add delay between multiple selectors in 'trusted-click-element' Improve 'trusted-click-element' — add delay between multiple selectors clicks Apr 14, 2023
@AdamWr
Copy link
Member

AdamWr commented Apr 14, 2023

Issue with disconnect (#284 (comment), #284 (comment)) has been fixed and static delay between multiple clicks has been added (in scriptlets library 1.9.7, which is not supported by any product yet, if I'm right).

Regarding first issue - #284 (comment)
Situation looks like this:

  1. Cookie notice is loaded in iframe and there is first element, it's clicked, all is fine
  2. After the first element is clicked, then new iframe is loaded, in this iframe there is only second element
    This second element is not clicked, because in this new iframe first element doesn't exist, and strict sequence is required in scriptlet, so in such cases using 2 rules are preferable.

@Alex-302
Copy link
Member

@AdamWr > static delay between multiple clicks has been added

What exactly?

@AdamWr
Copy link
Member

AdamWr commented Apr 14, 2023

150 ms

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

8 participants