Merge pull request #3511 from Tyriar/windows_opener
Swallow error when opener can't be sent
This commit is contained in:
@@ -29,7 +29,11 @@ const strictUrlRegex = new RegExp(start + protocolClause + bodyClause + end);
|
|||||||
function handleLink(event: MouseEvent, uri: string): void {
|
function handleLink(event: MouseEvent, uri: string): void {
|
||||||
const newWindow = window.open();
|
const newWindow = window.open();
|
||||||
if (newWindow) {
|
if (newWindow) {
|
||||||
newWindow.opener = null;
|
try {
|
||||||
|
newWindow.opener = null;
|
||||||
|
} catch {
|
||||||
|
// no-op, Electron can throw
|
||||||
|
}
|
||||||
newWindow.location.href = uri;
|
newWindow.location.href = uri;
|
||||||
} else {
|
} else {
|
||||||
console.warn('Opening link blocked as opener could not be cleared');
|
console.warn('Opening link blocked as opener could not be cleared');
|
||||||
|
|||||||
Reference in New Issue
Block a user