Scriptlets icon indicating copy to clipboard operation
Scriptlets copied to clipboard

Improve 'trusted-click-element' — add the ability to click on an element containing a given text

Open Sergey-Lyapin opened this issue 11 months ago • 0 comments

For example, to replace this rule with a scriptlet:

audioteka.com,jastrzabpost.pl,deliciousmagazine.pl,finansowysupermarket.pl,genialne.pl,pysznosci.pl,nocowanie.pl#%#AG_onLoad(function(){if(!(-1<document.cookie.indexOf("OAX")||"undefined"!=typeof localStorage&&null!==localStorage.getItem("crdab"))){var a=new MutationObserver(function(){var b=document.evaluate("//button[contains(text(), 'PRZECHODZ')]",document,null,XPathResult.ANY_TYPE,null).iterateNext();b&&(a.disconnect(),setTimeout(function(){b.click()},1E3))});a.observe(document,{childList:!0,subtree:!0});setTimeout(function(){a.disconnect()},1E4)}});

Something like: example.com#%#//scriptlet('trusted-click-element', 'button[name="agree"]', 'containsText:/agree|accept/')

Sergey-Lyapin avatar Feb 28 '24 14:02 Sergey-Lyapin