aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview/recipe.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/webview/recipe.js')
-rw-r--r--src/webview/recipe.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/webview/recipe.js b/src/webview/recipe.js
index c223b73de..353eb31fd 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
@@ -173,11 +174,17 @@ new RecipeController();
173// Patching window.open 174// Patching window.open
174const originalWindowOpen = window.open; 175const originalWindowOpen = window.open;
175 176
177
176window.open = (url, frameName, features) => { 178window.open = (url, frameName, features) => {
179 debug('window.open', url, frameName, features);
177 // We need to differentiate if the link should be opened in a popup or in the systems default browser 180 // We need to differentiate if the link should be opened in a popup or in the systems default browser
178 if (!frameName && !features) { 181 if (!frameName && !features && typeof features !== 'string') {
179 return ipcRenderer.sendToHost('new-window', url); 182 return ipcRenderer.sendToHost('new-window', url);
180 } 183 }
181 184
182 return originalWindowOpen(url, frameName, features); 185 return originalWindowOpen(url, frameName, features);
183}; 186};
187
188if (isDevMode) {
189 window.log = console.log;
190}