From 37c89344c7af9fc729be753d38bacc37f8e5d977 Mon Sep 17 00:00:00 2001 From: wangao <1366463855@qq.com> Date: Tue, 24 Mar 2020 09:05:46 +0800 Subject: [PATCH 1/3] fix: set nodeIntegration true --- activity-monitor/app.js | 6 +++++- hash/app.js | 6 +++++- mirror/app.js | 6 +++++- prices/app.js | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/activity-monitor/app.js b/activity-monitor/app.js index fb610d4..1a8518f 100644 --- a/activity-monitor/app.js +++ b/activity-monitor/app.js @@ -17,7 +17,11 @@ app.once('ready', () => { // set the background color to black backgroundColor: "#111", // Don't show the window until it's ready, this prevents any white flickering - show: false + show: false, + // Set nodeIntegration true //default false + webPreferences:{ + nodeIntegration:true + } }) window.loadURL(url.format({ diff --git a/hash/app.js b/hash/app.js index e24b0b7..f938a36 100644 --- a/hash/app.js +++ b/hash/app.js @@ -16,7 +16,11 @@ app.once('ready', () => { // background color of the page, this prevents any white flickering backgroundColor: "#D6D8DC", // Don't show the window until it's ready, this prevents any white flickering - show: false + show: false, + // Set nodeIntegration true //default false + webPreferences:{ + nodeIntegration:true + } }) // Load a URL in the window to the local index.html path diff --git a/mirror/app.js b/mirror/app.js index c2fb4fc..2dc2b26 100644 --- a/mirror/app.js +++ b/mirror/app.js @@ -13,7 +13,11 @@ app.once('ready', () => { // Make the window transparent transparent: true, // Remove the frame from the window - frame: false + frame: false, + // Set nodeIntegration true //default false + webPreferences:{ + nodeIntegration:true + } }) // Load a URL in the window to the local index.html path diff --git a/prices/app.js b/prices/app.js index 542784a..1c6c5d3 100644 --- a/prices/app.js +++ b/prices/app.js @@ -15,7 +15,11 @@ app.once('ready', () => { // Don't show the window until it ready, this prevents any white flickering show: false, // Don't allow the window to be resized. - resizable: false + resizable: false, + // Set nodeIntegration true //default false + webPreferences:{ + nodeIntegration:true + } }) // Load a URL in the window to the local index.html path From 44f072e6ed7c4747e8e54f3a5dc30feb9df0dd30 Mon Sep 17 00:00:00 2001 From: wangao <1366463855@qq.com> Date: Tue, 24 Mar 2020 09:06:24 +0800 Subject: [PATCH 2/3] fix: access screen through remote --- mirror/window.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mirror/window.js b/mirror/window.js index bd5a5dc..c97cf48 100644 --- a/mirror/window.js +++ b/mirror/window.js @@ -1,8 +1,11 @@ // Run this function after the page has loaded $(() => { - const electron = require('electron') + const {remote} = require('electron') + + // get screen through remote module + const {screen}=remote - const display = electron.screen.getPrimaryDisplay() // http://electron.atom.io/docs/api/screen + const display = screen.getPrimaryDisplay() // http://electron.atom.io/docs/api/screen const constraints = { video: { From c9101cc9e43047fb662c2d4becd516b74fe75e7a Mon Sep 17 00:00:00 2001 From: wangao <1366463855@qq.com> Date: Tue, 24 Mar 2020 09:18:58 +0800 Subject: [PATCH 3/3] feat: update electron to v7 --- activity-monitor/package.json | 2 +- electron-tray/package.json | 2 +- hash/package.json | 2 +- mirror/package.json | 2 +- prices/package.json | 2 +- url/package.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/activity-monitor/package.json b/activity-monitor/package.json index f793e6f..9df549b 100644 --- a/activity-monitor/package.json +++ b/activity-monitor/package.json @@ -9,6 +9,6 @@ }, "license": "ISC", "devDependencies": { - "electron": "^3.0.2" + "electron": "^7.1.7" } } diff --git a/electron-tray/package.json b/electron-tray/package.json index a0c9f5d..9667cc0 100644 --- a/electron-tray/package.json +++ b/electron-tray/package.json @@ -9,6 +9,6 @@ }, "license": "ISC", "devDependencies": { - "electron": "^3.0.2" + "electron": "^7.1.7" } } diff --git a/hash/package.json b/hash/package.json index 5f80874..a6bfeb1 100644 --- a/hash/package.json +++ b/hash/package.json @@ -9,6 +9,6 @@ }, "license": "ISC", "devDependencies": { - "electron": "^3.0.2" + "electron": "^7.1.7" } } diff --git a/mirror/package.json b/mirror/package.json index 3d70f48..c3f6733 100644 --- a/mirror/package.json +++ b/mirror/package.json @@ -9,6 +9,6 @@ }, "license": "ISC", "devDependencies": { - "electron": "^3.0.2" + "electron": "^7.1.7" } } diff --git a/prices/package.json b/prices/package.json index 79d6522..9369d51 100644 --- a/prices/package.json +++ b/prices/package.json @@ -9,7 +9,7 @@ }, "license": "ISC", "devDependencies": { - "electron": "^3.0.2" + "electron": "^7.1.7" }, "dependencies": { "papaparse": "^4.6.0" diff --git a/url/package.json b/url/package.json index 0e162d3..1e295ca 100644 --- a/url/package.json +++ b/url/package.json @@ -9,6 +9,6 @@ }, "license": "ISC", "devDependencies": { - "electron": "^3.0.2" + "electron": "^7.1.7" } }