aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Prasanna <mail.prasanna.v@gmail.com>2021-06-01 12:19:10 +0530
committerLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-06-01 13:55:17 +0530
commit8ae66af728aa2031956b0a210b5a89e1cfc6cae9 (patch)
treeb23b82e097281d8eaa92e0633d0b98115fcacd66
parentipc messages will allow only JS objects, replacing browser event with neeeded... (diff)
downloadferdi-8ae66af728aa2031956b0a210b5a89e1cfc6cae9.tar.gz
ferdi-8ae66af728aa2031956b0a210b5a89e1cfc6cae9.tar.zst
ferdi-8ae66af728aa2031956b0a210b5a89e1cfc6cae9.zip
restrict opening blank screens in the new window
-rw-r--r--src/models/Service.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/models/Service.js b/src/models/Service.js
index 796734e4..e7efbe30 100644
--- a/src/models/Service.js
+++ b/src/models/Service.js
@@ -6,6 +6,7 @@ import path from 'path';
6 6
7import userAgent from '../helpers/userAgent-helpers'; 7import userAgent from '../helpers/userAgent-helpers';
8import { TODOS_RECIPE_ID, todosStore } from '../features/todos'; 8import { TODOS_RECIPE_ID, todosStore } from '../features/todos';
9import { isValidExternalURL } from '../helpers/url-helpers';
9 10
10const debug = require('debug')('Ferdi:Service'); 11const debug = require('debug')('Ferdi:Service');
11 12
@@ -287,6 +288,9 @@ export default class Service {
287 288
288 this.webview.addEventListener('new-window', (event, url, frameName, options) => { 289 this.webview.addEventListener('new-window', (event, url, frameName, options) => {
289 debug('new-window', event, url, frameName, options); 290 debug('new-window', event, url, frameName, options);
291 if (!isValidExternalURL(event.url)) {
292 return;
293 }
290 if (event.disposition === 'foreground-tab') { 294 if (event.disposition === 'foreground-tab') {
291 ipcRenderer.send('open-browser-window', { 295 ipcRenderer.send('open-browser-window', {
292 disposition: event.disposition, 296 disposition: event.disposition,