mirror of
https://github.com/electron/electron.git
synced 2026-02-08 22:25:14 -05:00
15 lines
542 B
JavaScript
15 lines
542 B
JavaScript
const { shell } = require('electron')
|
|
const path = require('path')
|
|
|
|
const openInBrowserButton = document.getElementById('open-in-browser')
|
|
const openAppLink = document.getElementById('open-app-link')
|
|
// Hides openAppLink when loaded inside Electron
|
|
openAppLink.style.display = 'none'
|
|
|
|
openInBrowserButton.addEventListener('click', () => {
|
|
console.log('clicked')
|
|
const pageDirectory = __dirname.replace('app.asar', 'app.asar.unpacked')
|
|
const pagePath = path.join('file://', pageDirectory, 'index.html')
|
|
shell.openExternal(pagePath)
|
|
})
|