2023-04-24 14:35:14 +00:00
|
|
|
const { ipcRenderer, shell } = require('electron')
|
2019-11-01 15:04:47 +00:00
|
|
|
|
|
|
|
const appInfoBtn = document.getElementById('app-info')
|
2023-04-24 14:35:14 +00:00
|
|
|
const electronDocLink = document.querySelectorAll('a[href]')
|
2019-11-01 15:04:47 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
})
|
|
|
|
|
2023-04-24 14:35:14 +00:00
|
|
|
electronDocLink.addEventListener('click', (e) => {
|
2019-11-01 15:04:47 +00:00
|
|
|
e.preventDefault()
|
2023-04-24 14:35:14 +00:00
|
|
|
const url = e.target.getAttribute('href')
|
2019-11-01 15:04:47 +00:00
|
|
|
shell.openExternal(url)
|
2023-04-05 13:42:20 +00:00
|
|
|
})
|