06285f0bf1
* docs: add app information example * Code review changes * Remove demo-control css class, link href change
18 lines
No EOL
516 B
JavaScript
18 lines
No EOL
516 B
JavaScript
const {ipcRenderer} = require('electron')
|
|
|
|
const appInfoBtn = document.getElementById('app-info')
|
|
const electron_doc_link = document.querySelectorAll('a[href]')
|
|
|
|
appInfoBtn.addEventListener('click', () => {
|
|
ipcRenderer.send('get-app-path')
|
|
})
|
|
|
|
ipcRenderer.on('got-app-path', (event, path) => {
|
|
const message = `This app is located at: ${path}`
|
|
document.getElementById('got-app-info').innerHTML = message
|
|
})
|
|
|
|
electron_doc_link.addEventListener('click', (e) => {
|
|
e.preventDefault()
|
|
shell.openExternal(url)
|
|
}) |