electron/docs/fiddles/system/system-app-user-information/app-information/renderer.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
566 B
JavaScript
Raw Normal View History

const { ipcRenderer, shell } = require('electron')
const appInfoBtn = document.getElementById('app-info')
const electronDocLink = 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
})
electronDocLink.addEventListener('click', (e) => {
e.preventDefault()
const url = e.target.getAttribute('href')
shell.openExternal(url)
})