electron/default_app/renderer.js

19 lines
730 B
JavaScript
Raw Normal View History

const {remote, shell} = require('electron')
2017-09-29 17:41:20 +00:00
const path = require('path')
const electronPath = path.relative(process.cwd(), remote.process.execPath)
2017-09-27 18:50:46 +00:00
document.onclick = (e) => {
e.preventDefault()
if (e.target.tagName === 'A') {
shell.openExternal(e.target.href)
}
return false
}
2017-09-28 03:51:53 +00:00
document.querySelector('.electron-version').innerText = `Electron v${process.versions.electron}`
document.querySelector('.chrome-version').innerText = `Chrome v${process.versions.chrome}`
document.querySelector('.node-version').innerText = `Node v${process.versions.node}`
document.querySelector('.v8-version').innerText = `v8 v${process.versions.v8}`
2017-09-29 17:41:20 +00:00
document.querySelector('.command-example').innerText = `${electronPath} path-to-app`