preload路径
This commit is contained in:
parent
8c75631d4a
commit
b0d469b132
@ -47,8 +47,8 @@ async function createWindow() {
|
||||
height: 600, // 默认高度(实际会被最大化覆盖)
|
||||
show: false, // 先隐藏窗口,避免闪烁
|
||||
webPreferences: {
|
||||
// 更新preload路径为background目录下的preload.js
|
||||
preload: require("path").join(process.cwd(), "background/preload.js"),
|
||||
// 修改:使用更可靠的方式获取preload路径,避免依赖process.cwd()
|
||||
preload: path.join(__dirname, 'preload.js'),
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user