docs: adds Native-UI Open external links and the file manager Fiddle example (#20524)

This commit is contained in:
Yaser 2019-12-04 17:38:19 +11:00 committed by Cheng Zhao
parent 5733507040
commit 1b61fe780e
3 changed files with 173 additions and 0 deletions

View file

@ -0,0 +1,13 @@
const { shell } = require('electron')
const os = require('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('http://electron.atom.io')
})