aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview/plugin.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/webview/plugin.js')
-rw-r--r--src/webview/plugin.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/webview/plugin.js b/src/webview/plugin.js
index 9903ee07a..d9e021e6d 100644
--- a/src/webview/plugin.js
+++ b/src/webview/plugin.js
@@ -5,8 +5,8 @@ import path from 'path';
5import { isDevMode } from '../environment'; 5import { isDevMode } from '../environment';
6import RecipeWebview from './lib/RecipeWebview'; 6import RecipeWebview from './lib/RecipeWebview';
7 7
8import Spellchecker from './spellchecker.js'; 8import Spellchecker from './spellchecker';
9import './notifications.js'; 9import './notifications';
10 10
11ipcRenderer.on('initializeRecipe', (e, data) => { 11ipcRenderer.on('initializeRecipe', (e, data) => {
12 const modulePath = path.join(data.recipe.path, 'webview.js'); 12 const modulePath = path.join(data.recipe.path, 'webview.js');
@@ -39,3 +39,15 @@ ipcRenderer.on('settings-update', (e, data) => {
39document.addEventListener('DOMContentLoaded', () => { 39document.addEventListener('DOMContentLoaded', () => {
40 ipcRenderer.sendToHost('hello'); 40 ipcRenderer.sendToHost('hello');
41}, false); 41}, false);
42
43// Patching window.open
44const originalWindowOpen = window.open;
45
46window.open = (url, frameName, features) => {
47 // We need to differentiate if the link should be opened in a popup or in the systems default browser
48 if (!frameName && !features) {
49 return ipcRenderer.sendToHost('new-window', url);
50 }
51
52 return originalWindowOpen(url, frameName, features);
53};