Swallow error when opener can't be sent

Fixes #2943

Co-authored-by: Megan Rogge <merogge@microsoft.com>
This commit is contained in:
Daniel Imms
2021-10-19 10:28:09 -07:00
co-authored by Megan Rogge
parent be7fcbe485
commit 581272ee51
@@ -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');