How to open JavaScript "onclick" links in new browser tab

1

1

Some websites, for reasons I'll never understand, implement links using JavaScript in the onclick event, like this:

<div onclick="document.location='/target_url';">

This doesn't allow me to open it in a new window, either by middle-clicking or even right-clicking and selecting "Open in new tab" in the context menu. Is there a way to allow this, either in Chrome or Firefox on Windows? For example, maybe there is some extension that can rewrite the HTML according to certain patterns, a bit like the Stylish extension does for CSS?

EM0

Posted 2017-09-22T11:57:43.800

Reputation: 1 703

Question was closed 2017-09-26T04:48:13.053

For something as simple as that it might work but there are plenty of ways to implement it. I'm not sure you would be able to do it as an extension. – Seth – 2017-09-22T12:27:39.850

No answers