From 367f2f656e553fa79d9fa76f067416011870b6b7 Mon Sep 17 00:00:00 2001 From: Cutls Date: Fri, 14 Jun 2019 23:25:27 +0900 Subject: [PATCH] Add: getPlatform #86 --- app/js/common/version.js | 6 ++---- app/js/platform/preload.js | 4 ++++ app/main/system.js | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/js/common/version.js b/app/js/common/version.js index b4e76be5..c93af0aa 100644 --- a/app/js/common/version.js +++ b/app/js/common/version.js @@ -46,11 +46,9 @@ function verck(ver) { }); } } - var electron = require("electron"); - var remote = electron.remote; var dialog = remote.dialog; - var platform = remote.process.platform; - console.log("Your platform:" + remote.process.platform) + var platform = localStorage.getItem("platform"); + console.log("Your platform:" + platform) if (platform == "win32") { const options = { type: 'info', diff --git a/app/js/platform/preload.js b/app/js/platform/preload.js index 0d41a915..765d114d 100644 --- a/app/js/platform/preload.js +++ b/app/js/platform/preload.js @@ -8,6 +8,10 @@ onmessage = function (e) { } } +ipc.send("getPlatform", "") +ipc.on('platform', function (event, arg) { + localStorage.setItem("platform",arg) +}) ipc.on('reload', function (event, arg) { location.reload(); }) diff --git a/app/main/system.js b/app/main/system.js index edd8e97c..a1aa5f59 100644 --- a/app/main/system.js +++ b/app/main/system.js @@ -40,6 +40,10 @@ function system(mainWindow, dir, lang) { }); } }); + //プラットフォーム + ipc.on('getPlatform', function (e, arg) { + mainWindow.webContents.send('platform', process.platform); + }) //言語 ipc.on('lang', function (e, arg) {