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

Fix 'trusted-click-element' — element was removed and added again before it was clicked #391

Closed
Alex-302 opened this issue Dec 21, 2023 · 2 comments

Comments

@Alex-302
Copy link
Member

For example - with iubenda.com consent management platform:
https://tecnologia.libero.it/fotone-altissima-energia-piu-potente-registrato-arrivato-terra-mette-crisi-scienziati-80320
https://coolsoft.altervista.org/en/virtualmidisynth

coolsoft.altervista.org#%#//scriptlet('trusted-click-element', '.iubenda-cs-customize-btn') works an opens options. But the scriptlet cannot click the Reject All button. It works with #iubFooterBtn.

@Sergey-Lyapin
Copy link

Sergey-Lyapin commented Feb 21, 2024

The scriptlet also doesn't work at virginaustralia.com, for example these scritplets don't work:

virginaustralia.com#%#//scriptlet('trusted-click-element', '#cookieAcceptanceBtn', '', '1000')
virginaustralia.com#%#//scriptlet('trusted-click-element', '#cookieAcceptanceBtn')

@adguard-bot adguard-bot changed the title trusted-click-element does not work on some sites Fix 'trusted-click-element' — does not work on some sites Oct 7, 2024
@slavaleleka slavaleleka added the bug Something isn't working label Oct 7, 2024
@adguard-bot adguard-bot changed the title Fix 'trusted-click-element' — does not work on some sites Fix 'trusted-click-element' — scriptlet does not work on some sites Oct 7, 2024
@adguard-bot adguard-bot assigned jellizaveta and unassigned maximtop Oct 7, 2024
@adguard-bot adguard-bot changed the title Fix 'trusted-click-element' — scriptlet does not work on some sites Fix 'trusted-click-element' — scriptlet doesn't work on some sites Nov 22, 2024
@ameshkov ameshkov assigned AdamWr and unassigned ameshkov and AdamWr Nov 22, 2024
@adguard-bot adguard-bot assigned slavaleleka and unassigned AdamWr Nov 22, 2024
@AdamWr
Copy link
Member

AdamWr commented Nov 22, 2024

Regarding coolsoft.altervista.org, maybe it's already fixed?
The rule like this:

coolsoft.altervista.org#%#//scriptlet('trusted-click-element', '.iubenda-cs-customize-btn, .purposes-content .iub-consent-buttons .iub-btn-reject, #iubenda-iframe-popup button#iubFooterBtn')

works fine on my end.
By the way, after clicking on the Reject all button, it's necessary to click on the Save and continue otherwise modal will be not closed.


Regarding virginaustralia.com, it looks like the problem is that when element is clicked "too fast", then event listener is not registered yet.
Another problem (when delay is used) is that website removes this button and add it again, but it seems that scriptlet keeps reference to removed button and tries to click it, but element it's not in the DOM.
As a temporary workaround rule like this:

virginaustralia.com#%#//scriptlet('trusted-click-element', '#cookieAcceptanceBtn[class*="__button--"]')

can be used.

@adguard-bot adguard-bot assigned AdamWr and unassigned slavaleleka Nov 22, 2024
@adguard-bot adguard-bot changed the title Fix 'trusted-click-element' — scriptlet doesn't work on some sites Fix 'trusted-click-element' — scriptlet does not work on some sites Nov 22, 2024
@adguard-bot adguard-bot changed the title Fix 'trusted-click-element' — scriptlet does not work on some sites Fix 'trusted-click-element' — element was removed and added again before it was clicked Nov 25, 2024
adguard pushed a commit that referenced this issue Nov 28, 2024
…again before it was clicked. #391

Squashed commit of the following:

commit bc53c30
Merge: 6c2150f 39e9fbf
Author: Adam Wróblewski <[email protected]>
Date:   Thu Nov 28 12:27:35 2024 +0100

    Merge branch 'master' into fix/AG-29014

commit 6c2150f
Author: Adam Wróblewski <[email protected]>
Date:   Tue Nov 26 12:20:03 2024 +0100

    Do not use destructuring assignment
    Change selectorText value to null

commit c273a04
Author: Adam Wróblewski <[email protected]>
Date:   Mon Nov 25 14:52:00 2024 +0100

    Update JSDoc for interface

commit 0cb9c15
Author: Adam Wróblewski <[email protected]>
Date:   Mon Nov 25 14:15:21 2024 +0100

    Add JSDoc for interface
    Remove properties from findAndClickElement JSDoc

commit 1432c5a
Author: Adam Wróblewski <[email protected]>
Date:   Mon Nov 25 10:26:48 2024 +0100

    Update changelog
    and comment

commit 7c65269
Author: Adam Wróblewski <[email protected]>
Date:   Fri Nov 22 18:59:46 2024 +0100

    Fix trusted-click-element
    Check if element is connected to Document
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