Bläddra i källkod

去掉无用文件

gaoshuaixing 3 år sedan
förälder
incheckning
291171aea7
3 ändrade filer med 1 tillägg och 20 borttagningar
  1. 1 2
      electron/config.js
  2. 0 12
      preload.js
  3. 0 6
      renderer.js

+ 1 - 2
electron/config.js

@@ -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'

+ 0 - 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])
-  }
-})

+ 0 - 6
renderer.js

@@ -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.