fix: external link not opening (#7859)

This commit is contained in:
Rinku Chaudhari 2024-04-09 19:51:49 +05:45 committed by GitHub
parent a33a400f01
commit d917db438e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4953,11 +4953,7 @@ class App extends React.Component<AppProps, AppState> {
} }
if (!customEvent?.defaultPrevented) { if (!customEvent?.defaultPrevented) {
const target = isLocalLink(url) ? "_self" : "_blank"; const target = isLocalLink(url) ? "_self" : "_blank";
const newWindow = window.open( const newWindow = window.open(undefined, target);
undefined,
target,
"noopener noreferrer",
);
// https://mathiasbynens.github.io/rel-noopener/ // https://mathiasbynens.github.io/rel-noopener/
if (newWindow) { if (newWindow) {
newWindow.opener = null; newWindow.opener = null;