diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/webview/recipe.js | 15 |
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'; | |||
12 | import './notifications'; | 12 | import './notifications'; |
13 | 13 | ||
14 | import { DEFAULT_APP_SETTINGS } from '../config'; | 14 | import { DEFAULT_APP_SETTINGS } from '../config'; |
15 | import { isDevMode } from '../environment'; | ||
15 | 16 | ||
16 | const debug = require('debug')('Franz:Plugin'); | 17 | const debug = require('debug')('Franz:Plugin'); |
17 | 18 | ||
@@ -169,3 +170,17 @@ class RecipeController { | |||
169 | /* eslint-disable no-new */ | 170 | /* eslint-disable no-new */ |
170 | new RecipeController(); | 171 | new RecipeController(); |
171 | /* eslint-enable no-new */ | 172 | /* eslint-enable no-new */ |
173 | |||
174 | // Patching window.open | ||
175 | const originalWindowOpen = window.open; | ||
176 | |||
177 | |||
178 | window.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 | }; | ||