Add: getPlatform #86

This commit is contained in:
Cutls 2019-06-14 23:25:27 +09:00
parent 7f806bd155
commit 367f2f656e
3 changed files with 10 additions and 4 deletions

View File

@ -46,11 +46,9 @@ function verck(ver) {
}); });
} }
} }
var electron = require("electron");
var remote = electron.remote;
var dialog = remote.dialog; var dialog = remote.dialog;
var platform = remote.process.platform; var platform = localStorage.getItem("platform");
console.log("Your platform:" + remote.process.platform) console.log("Your platform:" + platform)
if (platform == "win32") { if (platform == "win32") {
const options = { const options = {
type: 'info', type: 'info',

View File

@ -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) { ipc.on('reload', function (event, arg) {
location.reload(); location.reload();
}) })

View File

@ -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) { ipc.on('lang', function (e, arg) {