aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview/recipe.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-10-03 15:14:46 +0200
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-10-03 15:14:46 +0200
commit7c9018e0a97916218a9a034ad92ab448cca0840f (patch)
treec26cb3cb7ceec208def6fbc4d370f89d4176f3d3 /src/webview/recipe.js
parentFixes #1609 by adding special handling for skype links (diff)
parentfix(Service): Fix disappearing cursor in services (diff)
downloadferdium-app-7c9018e0a97916218a9a034ad92ab448cca0840f.tar.gz
ferdium-app-7c9018e0a97916218a9a034ad92ab448cca0840f.tar.zst
ferdium-app-7c9018e0a97916218a9a034ad92ab448cca0840f.zip
Merge branch 'release/5.4.0' into fix/skype-links
Diffstat (limited to 'src/webview/recipe.js')
-rw-r--r--src/webview/recipe.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/webview/recipe.js b/src/webview/recipe.js
index 60660d8f1..e3e13b726 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,6 +174,7 @@ 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) => {
177 if (!url && !frameName && !features) { 179 if (!url && !frameName && !features) {
178 // The service hasn't yet supplied a URL (as used in Skype). 180 // The service hasn't yet supplied a URL (as used in Skype).
@@ -201,9 +203,13 @@ window.open = (url, frameName, features) => {
201 } 203 }
202 204
203 // We need to differentiate if the link should be opened in a popup or in the systems default browser 205 // We need to differentiate if the link should be opened in a popup or in the systems default browser
204 if (!frameName && !features) { 206 if (!frameName && !features && typeof features !== 'string') {
205 return ipcRenderer.sendToHost('new-window', url); 207 return ipcRenderer.sendToHost('new-window', url);
206 } 208 }
207 209
208 return originalWindowOpen(url, frameName, features); 210 return originalWindowOpen(url, frameName, features);
209}; 211};
212
213if (isDevMode) {
214 window.log = console.log;
215}