I am opening a new tab using GM_openInTab inside my tampermonkey script, but I am not able to interact with the elements of this new tab using my code.
I simply want to click a button in the newly opened tab as soon as it opens and close it instantly.
Thanks in advance!
You have to run your script on the URL of the new tab you are opening as well (add an additional
@include
on top), you could make a distinction at the beginning of the script, like this: