mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
fix: ELECTRON-1505 (Prevent opening links longer than 2083) (#776)
* ELECTRON-1505 - Prevent opening links longer than 2083 * ELECTRON-1505 - Prevent opening links longer than 2083
This commit is contained in:
parent
82cfbb1de0
commit
0902523c03
@ -193,9 +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);
|
||||
}
|
||||
};
|
||||
|
@ -41,6 +41,10 @@ class ProtocolHandler {
|
||||
* @param isAppRunning {Boolean} - whether the application is running
|
||||
*/
|
||||
public sendProtocol(url: string, isAppRunning: boolean = true): void {
|
||||
if (url && url.length > 2083) {
|
||||
logger.info(`protocol-handler: protocol handler url length is greater than 2083, not performing any action!`);
|
||||
return;
|
||||
}
|
||||
logger.info(`protocol handler: processing protocol request for the url ${url}!`);
|
||||
if (!this.preloadWebContents || !isAppRunning) {
|
||||
logger.info(`protocol handler: app was started from the protocol request. Caching the URL ${url}!`);
|
||||
|
Loading…
Reference in New Issue
Block a user