electron / remote

Bridge JavaScript objects from the main process to the renderer process in Electron.
MIT License
373 stars 50 forks source link

ERROR Uncaught ReferenceError: webContents is not defined #134

Open mike2003 opened 2 years ago

mike2003 commented 2 years ago

I wanted to repeat the lesson https://www.youtube.com/watch?v=2RxHQoiDctI But there is used remote I already know that this is a deprecated method, but I want to finish.

I need to close the second window. It closes itself. var window = remote.getCurrentWindow(); window.close();

I've included @electron/remote in main, but I can't get remote here.

main.js require("@electron/remote/main").initialize(); require("@electron/remote/main").enable(win.webContents);

But in the second window it does not work and the browser swears. It tells me to write this code, but that doesn't help either.

const remote = require("@electron/remote") require("@electron/remote/main").enable(webContents)

webContents is not defined

Tibus commented 2 years ago

Same here