webPreferences

2019-08-07  本文已影响0人  ww4u

function createWindow(){
    win = new BrowserWindow(
        {
            width: 800,
            height: 600,
            webPreferences:{
                nodeIntegration: true 
            }
        }
    )

    win.loadFile("index.html")

    win.webContents.openDevTools()

    win.on( 'closed', () => {
        win = null 
    })
}

image.png
const osenv = require('osenv');
function getUsersHomeFolder(){
  return osenv.home();
}
image.png
上一篇下一篇

猜你喜欢

热点阅读