2017-04-24 11:54:05 -07:00
|
|
|
const {remote, shell} = require('electron')
|
2017-09-29 10:41:20 -07:00
|
|
|
const path = require('path')
|
|
|
|
const electronPath = path.relative(process.cwd(), remote.process.execPath)
|
2017-04-24 11:54:05 -07:00
|
|
|
|
2017-09-27 14:50:46 -04:00
|
|
|
document.onclick = (e) => {
|
2017-04-24 11:54:05 -07:00
|
|
|
e.preventDefault()
|
|
|
|
if (e.target.tagName === 'A') {
|
|
|
|
shell.openExternal(e.target.href)
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2017-09-27 23:51:53 -04: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 10:41:20 -07:00
|
|
|
document.querySelector('.command-example').innerText = `${electronPath} path-to-app`
|