diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-10-03 15:14:46 +0200 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2019-10-03 15:14:46 +0200 |
commit | 7c9018e0a97916218a9a034ad92ab448cca0840f (patch) | |
tree | c26cb3cb7ceec208def6fbc4d370f89d4176f3d3 /src/webview/recipe.js | |
parent | Fixes #1609 by adding special handling for skype links (diff) | |
parent | fix(Service): Fix disappearing cursor in services (diff) | |
download | ferdium-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.js | 8 |
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'; | |||
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 | ||
@@ -173,6 +174,7 @@ new RecipeController(); | |||
173 | // Patching window.open | 174 | // Patching window.open |
174 | const originalWindowOpen = window.open; | 175 | const originalWindowOpen = window.open; |
175 | 176 | ||
177 | |||
176 | window.open = (url, frameName, features) => { | 178 | window.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 | |||
213 | if (isDevMode) { | ||
214 | window.log = console.log; | ||
215 | } | ||