docs: add app information example (#20487)

* docs: add app information example

* Code review changes

* Remove demo-control css class, link href change
This commit is contained in:
Amarnath Karthi 2019-11-01 20:34:47 +05:30 committed by Shelley Vohr
parent eaf2c61bef
commit 06285f0bf1
4 changed files with 49 additions and 0 deletions

View file

@ -0,0 +1,18 @@
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)
})