mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-14 19:52:10 +08:00
去掉无用文件
This commit is contained in:
@@ -38,8 +38,7 @@ const config = {
|
||||
webPreferences: {
|
||||
//webSecurity: false,
|
||||
contextIsolation: false, // 设置此项为false后,才可在渲染进程中使用electron api
|
||||
nodeIntegration: true,
|
||||
preload: path.join(__dirname, '../preload.js')
|
||||
nodeIntegration: true
|
||||
},
|
||||
frame: true,
|
||||
//titleBarStyle: 'hidden'
|
||||
|
||||
12
preload.js
12
preload.js
@@ -1,12 +0,0 @@
|
||||
// All of the Node.js APIs are available in the preload process.
|
||||
// It has the same sandbox as a Chrome extension.
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
const replaceText = (selector, text) => {
|
||||
const element = document.getElementById(selector)
|
||||
if (element) element.innerText = text
|
||||
}
|
||||
|
||||
for (const type of ['chrome', 'node', 'electron']) {
|
||||
replaceText(`${type}-version`, process.versions[type])
|
||||
}
|
||||
})
|
||||
@@ -1,6 +0,0 @@
|
||||
// This file is required by the index.html file and will
|
||||
// be executed in the renderer process for that window.
|
||||
// No Node.js APIs are available in this process because
|
||||
// `nodeIntegration` is turned off. Use `preload.js` to
|
||||
// selectively enable features needed in the rendering
|
||||
// process.
|
||||
Reference in New Issue
Block a user