electron/docs/fiddles/native-ui/external-links-file-manager/renderer.js
Milan Burda 24c9cbcc0a
docs: handle opening links in the default browser in main.js (#39379)
docs: handle opening links in the default browser in the main process
2023-08-08 12:35:59 +02:00

13 lines
395 B
JavaScript

const { shell } = require('electron')
const os = require('node:os')
const exLinksBtn = document.getElementById('open-ex-links')
const fileManagerBtn = document.getElementById('open-file-manager')
fileManagerBtn.addEventListener('click', (event) => {
shell.showItemInFolder(os.homedir())
})
exLinksBtn.addEventListener('click', (event) => {
shell.openExternal('https://electronjs.org')
})