From de5a60f06d5d5af79f96abba82f668ff1b1ab28f Mon Sep 17 00:00:00 2001 From: Kiran Niranjan Date: Fri, 30 Aug 2019 16:01:27 +0530 Subject: [PATCH] fix: ELECTRON-1505 (Prevent opening links longer than 2083) (#775) * ELECTRON-1505 - Prevent opening links longer than 2083 * ELECTRON-1505 - Prevent opening links longer than 2083 --- src/app/child-window-handler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/child-window-handler.ts b/src/app/child-window-handler.ts index 3b89c2886..9f39b94bd 100644 --- a/src/app/child-window-handler.ts +++ b/src/app/child-window-handler.ts @@ -193,13 +193,13 @@ export const handleChildWindow = (webContents: WebContents): void => { } }); } else { + event.preventDefault(); if (newWinUrl && newWinUrl.length > 2083) { logger.info(`child-window-handler: new window url length is greater than 2083, not performing any action!`); return; } logger.info(`child-window-handler: new window url is ${newWinUrl} which is not of the same host, so opening it in the default browser!`); - event.preventDefault(); windowHandler.openUrlInDefaultBrowser(newWinUrl); } };