Change: some node integration on rend-proc #86

This commit is contained in:
Cutls 2019-06-15 02:30:29 +09:00
parent 070c40a958
commit eba54d0906
4 changed files with 20 additions and 21 deletions

View File

@ -104,13 +104,13 @@
class="material-icons left">close</i>Close</button>
<script type="text/javascript" src="./js/ui/theme.js"></script>
<script>
postMessage(["sendSinmpleIpc", "aboutData"], "*")
function renderAbout(args) {
$("#now").text(localStorage.getItem("ver"));
var electron = require("electron");
var remote = electron.remote;
const shell = electron.shell;
$("#node").text(remote.process.version);
$("#chrome").text(remote.process.versions.chrome);
$("#electron").text(remote.process.versions.electron);
$("#node").text(args.version);
$("#chrome").text(args.versions.chrome);
$("#electron").text(args.versions.electron);
}
if (location.search) {
var m = location.search.match(/\?ver=([a-zA-Z-0-9.]+)/);
var ver = m[1];
@ -118,7 +118,7 @@
}
$(document).on('click', 'a', e => {
var url = $(e.target).attr('href');
shell.openExternal(url);
postMessage(["openUrl", url], "*")
return false;
});
</script>

View File

@ -1,6 +1,3 @@
//jQuery読む
window.jQuery = window.$ = require('../../js/common/jquery.js');
var Hammer = require('../../js/common/hammer.min.js');
$.strip_tags = function (str, allowed) {
if (!str) {
return "";

View File

@ -243,12 +243,13 @@ ipc.on('prog', function (event, arg) {
ipc.on('mess', function (event, arg) {
updateMess(arg)
})
/*
//about.html
ipc.on('aboutData', function (event, arg) {
renderAbout(arg)
})
var webviewDom = document.getElementById('webview');
const {
shell
} = require('electron');
if(webviewDom){
webviewDom.addEventListener('new-window', function (e) {
shell.openExternal(e.url);
});
*/
}

View File

@ -144,9 +144,10 @@ function system(mainWindow, dir, lang) {
about();
});
ipc.on('aboutData', (e, args) => {
e.sender.webContents.send('aboutDataRender', process);
});
function about() {
var ver = app.getVersion()
var window = new BrowserWindow({
webPreferences: {