How to click on a buttom in JS?

How can I click on a accepting cookies button on a page using a bookmarklet…
(javascript: void( ‘’ +
Whenever I try this on e.g. Wie die Pandemie die Normen der Wissenschaft verändert – DIE ACHSE DES GUTEN. ACHGUT.COM
It requests an accepting cookie click first…

Even setting aside the potential legal ramifications of auto-accepting cookies, this may be a tough nut to crack technically…

Can your bookmarklet cross frames or windows? Can you make one that doesn’t need to know the details of that button (what is the selector, is it even a button or simply a styled anchor?)

There is no standard convention for naming that button, and without that you can’t select it to .click()

1 Like

Not really an answer to your JS question but if this is just to avoid clicking the accept cookie, I would check out the “I don’t care about cookies” extension.

1 Like

Oh, I see. It’s quite difficult then. So, it works fine only for specific sites…
The question is also, whether it pays, to do such an effort…

Thanks anyway

Thanks very much! That could do the job. I’ll have to test it.
Though, it seems to work only with Chrome?
May be, I could change it, to work for firefox too?

If you follow the website link on the page @lasjorg sent, there are versions for other browsers.

Oh! That’s fine, thanks!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.