2020-08-27 14:31:51 +00:00
|
|
|
const { ipcRenderer, shell } = require('electron')
|
|
|
|
|
|
|
|
const links = document.querySelectorAll('a[href]')
|
|
|
|
const errorBtn = document.getElementById('error-dialog')
|
|
|
|
|
|
|
|
errorBtn.addEventListener('click', event => {
|
|
|
|
ipcRenderer.send('open-error-dialog')
|
|
|
|
})
|
|
|
|
|
|
|
|
Array.prototype.forEach.call(links, (link) => {
|
|
|
|
const url = link.getAttribute('href')
|
|
|
|
if (url.indexOf('http') === 0) {
|
|
|
|
link.addEventListener('click', (e) => {
|
|
|
|
e.preventDefault()
|
|
|
|
shell.openExternal(url)
|
|
|
|
})
|
|
|
|
}
|
2023-04-05 13:42:20 +00:00
|
|
|
})
|