So I know that I can apply rel="noopener
in an a
tag when using target="_blank"
. But I'm trying to pass it as an argument to window.open()
, ie:
window.open('http://cats.com', '_blank', 'rel=noopener')
however it doesn't seem to be working the way that I expected, as the opener
object still exists on the window after the user clicks on the link.
Is there something I'm missing? Or cannot it not be done the way that I'm intending?
I've found some great articles but they don't quite address my use case as far as I can tell.
https://developer.mozilla.org/en-US/docs/Web/API/Window/open https://mathiasbynens.github.io/rel-noopener/
Much appreciated.
window.open()
, is justnoopener
and notrel=noopener
. The solution suggested here has the best backwards and cross-browser compatibility, however. – Apocryphal