Merge pull request #3511 from Tyriar/windows_opener

Swallow error when opener can't be sent
This commit is contained in:
Daniel Imms
2021-10-19 10:50:20 -07:00
committed by GitHub
@@ -29,7 +29,11 @@ const strictUrlRegex = new RegExp(start + protocolClause + bodyClause + end);
function handleLink(event: MouseEvent, uri: string): void {
const newWindow = window.open();
if (newWindow) {
newWindow.opener = null;
try {
newWindow.opener = null;
} catch {
// no-op, Electron can throw
}
newWindow.location.href = uri;
} else {
console.warn('Opening link blocked as opener could not be cleared');