From 5fbf1c0c0e1dfaefb2ef050cf7f0502666f8af66 Mon Sep 17 00:00:00 2001 From: Rustem Mussabekov Date: Wed, 2 Oct 2019 18:22:24 +0300 Subject: [PATCH] Fix Preview tab --- package.json | 2 +- src/index.js | 11 +++++++++++ src/window.js | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a223d1b..5cf61cd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Raindrop.io", "productName": "Raindrop.io", - "version": "5.1.46", + "version": "5.1.5", "description": "Crossplatform bookmarking app", "main": "src/index.js", "repository": { diff --git a/src/index.js b/src/index.js index d796818..032006a 100644 --- a/src/index.js +++ b/src/index.js @@ -20,4 +20,15 @@ app.on('before-quit', function(){ app.on('window-all-closed', function () { app.quit() +}) + +app.on('web-contents-created', (event, contents) => { + contents.on('will-attach-webview', (event, webPreferences, params) => { + // Strip away preload scripts if unused or verify their location is legitimate + delete webPreferences.preload + delete webPreferences.preloadURL + + // Disable Node.js integration + webPreferences.nodeIntegration = false + }) }) \ No newline at end of file diff --git a/src/window.js b/src/window.js index e7065bc..8471949 100644 --- a/src/window.js +++ b/src/window.js @@ -35,6 +35,7 @@ module.exports = { backgroundColor: '#f6f6f6', webPreferences: { + webviewTag: true, nodeIntegration: true, webSecurity: true, scrollBounce: true, @@ -48,6 +49,9 @@ module.exports = { else*/ this.window.loadURL('https://app.raindrop.io/legacy/4'); + if (isDev) + this.window.webContents.openDevTools(); + this.window.webContents.on('will-navigate', this.handleURLChange); this.window.webContents.on('new-window', function(e,url){ e.preventDefault();