27 lines
754 B
JavaScript
27 lines
754 B
JavaScript
|
const { shell, ipcRenderer } = require("electron")
|
||
|
const path = require('path')
|
||
|
|
||
|
// window.onload = () => {
|
||
|
// // 1 获取元素
|
||
|
// let oBtn1 = document.getElementById('openUrl')
|
||
|
// let oBtn2 = document.getElementById('openFolder')
|
||
|
|
||
|
// oBtn1.addEventListener('click', (ev) => {
|
||
|
// ev.preventDefault()
|
||
|
|
||
|
// let urlPath = oBtn1.getAttribute('href')
|
||
|
|
||
|
// // 打开外部浏览器
|
||
|
// shell.openExternal(urlPath)
|
||
|
// })
|
||
|
|
||
|
// oBtn2.addEventListener('click', () => {
|
||
|
// // 打开当前目录
|
||
|
// shell.showItemInFolder(path.resolve(__filename))
|
||
|
// })
|
||
|
// }
|
||
|
|
||
|
ipcRenderer.on('open', () => {
|
||
|
let iframe = document.getElementById('webview')
|
||
|
iframe.src = 'https://cantyonion.site/git/'
|
||
|
})
|