2019-11-05 21:39:39 +00:00
|
|
|
const { ipcRenderer } = require('electron')
|
|
|
|
const shell = require('electron').shell
|
|
|
|
|
|
|
|
const links = document.querySelectorAll('a[href]')
|
|
|
|
|
2023-07-13 08:10:37 +00:00
|
|
|
for (const link of links) {
|
2019-11-05 21:39:39 +00:00
|
|
|
const url = link.getAttribute('href')
|
|
|
|
if (url.indexOf('http') === 0) {
|
|
|
|
link.addEventListener('click', (e) => {
|
|
|
|
e.preventDefault()
|
|
|
|
shell.openExternal(url)
|
|
|
|
})
|
|
|
|
}
|
2023-07-13 08:10:37 +00:00
|
|
|
}
|
2019-11-05 21:39:39 +00:00
|
|
|
|
|
|
|
const dragFileLink = document.getElementById('drag-file-link')
|
|
|
|
|
|
|
|
dragFileLink.addEventListener('dragstart', event => {
|
|
|
|
event.preventDefault()
|
|
|
|
ipcRenderer.send('ondragstart', __filename)
|
|
|
|
})
|