From 18c3219e9bf629a9b3a2812e768367e8b6543e1a Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Thu, 17 Mar 2022 12:56:40 +0100 Subject: [PATCH] Allow popups to be opened when their url starts with the referrer url --- src/Application.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Application.ts b/src/Application.ts index ab58926..fccab27 100644 --- a/src/Application.ts +++ b/src/Application.ts @@ -76,6 +76,8 @@ export default class Application { if (contents.getType() === 'webview') { console.log('Setting external links to open in default OS browser'); contents.setWindowOpenHandler(details => { + if (details.url.startsWith(details.referrer.url)) return {action: 'allow'}; + const url = details.url; this.openExternalLink(url) .catch(console.error);