mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-14 05:34:48 +00:00
15 lines
428 B
JavaScript
15 lines
428 B
JavaScript
(function () {
|
|
const shell = require('electron').shell
|
|
const links = document.querySelectorAll('a[href]')
|
|
|
|
Array.prototype.forEach.call(links, function (link) {
|
|
const url = link.getAttribute('href')
|
|
if (url.indexOf('http') === 0) {
|
|
link.addEventListener('click', function (e) {
|
|
e.preventDefault()
|
|
shell.openExternal(url)
|
|
})
|
|
}
|
|
})
|
|
})
|