I am writing a userscript for a website to change link targets from "_blank" to "_self".
The website's links are all handled by an EventListener on Click action, which reviews the id
attribute for every <a>
element to set the click URL and load it in a new tab. None of the <a>
elements have a href
or target
attribute.
I would like all clicked links to load in the same tab (rather than a new tab).
Is there any way to modify link targets set by an event listener, or to simply set/override the default link target for all links on a webpage?