aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-10-03 13:51:00 +0200
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-10-03 13:51:00 +0200
commitd390f216c3e0ecd38067d19da8bd882e6a0303a7 (patch)
treec54a2f988c44ed655637c7f7082f0800a8ce3cee /src
parentAdd darkModeSupport (diff)
downloadferdium-app-d390f216c3e0ecd38067d19da8bd882e6a0303a7.tar.gz
ferdium-app-d390f216c3e0ecd38067d19da8bd882e6a0303a7.tar.zst
ferdium-app-d390f216c3e0ecd38067d19da8bd882e6a0303a7.zip
re-fix & improve new-window handling
Diffstat (limited to 'src')
-rw-r--r--src/webview/recipe.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/webview/recipe.js b/src/webview/recipe.js
index 7be307f05..e1ff44f05 100644
--- a/src/webview/recipe.js
+++ b/src/webview/recipe.js
@@ -12,6 +12,7 @@ import contextMenu from './contextMenu';
12import './notifications'; 12import './notifications';
13 13
14import { DEFAULT_APP_SETTINGS } from '../config'; 14import { DEFAULT_APP_SETTINGS } from '../config';
15import { isDevMode } from '../environment';
15 16
16const debug = require('debug')('Franz:Plugin'); 17const debug = require('debug')('Franz:Plugin');
17 18
@@ -169,3 +170,17 @@ class RecipeController {
169/* eslint-disable no-new */ 170/* eslint-disable no-new */
170new RecipeController(); 171new RecipeController();
171/* eslint-enable no-new */ 172/* eslint-enable no-new */
173
174// Patching window.open
175const originalWindowOpen = window.open;
176
177
178window.open = (url, frameName, features) => {
179 debug('window.open', url, frameName, features);
180 // We need to differentiate if the link should be opened in a popup or in the systems default browser
181 if (!frameName && !features && typeof features !== 'string') {
182 return ipcRenderer.sendToHost('new-window', url);
183 }
184
185 return originalWindowOpen(url, frameName, features);
186};