question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@electron/remote for multiple windows

See original GitHub issue

Hi! I use electron 14 and @electron/remote 2.0.1 for main window successfully. Then I try open child window. I get an error

core.js:6479 ERROR Error: @electron/remote is disabled for this WebContents. 
Call require("@electron/remote/main").enable(webContents) to enable it.
    at IpcMainImpl.<anonymous> (C:\projects\xProject\node_modules\@electron\remote\dist\src\main\server.js:317:61)
    at IpcMainImpl.emit (events.js:376:20)
    at Object.<anonymous> (electron/js2c/browser_init.js:161:10490)
    at Object.emit (events.js:376:20)

Please help me understand how to open multiple child window with call require(“@electron/remote/main”).enable(webContents).

Thank you for help.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
TheTotocommented, Oct 21, 2021

I create windows from renderer and I use nativeWindowOpen: true, I my case it works with (in main process) :

const remoteMain = require('@electron/remote/main')

...

mainWin.webContents.on('did-create-window', (childWin) => {
    remoteMain.enable(childWin.webContents)
})
1reaction
imndxcommented, Sep 24, 2021

My code contains this flow: remote = window.require(‘@electron/remote’); let win = new remote.BrowserWindow({… remote.require(“@electron/remote/main”).enable(win.webContents)

Thanks for your reply.

I tried your flow, but still the same error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 5. Working with multiple windows - Electron in Action
We can use Electron's remote module to ask the window in the renderer process for a reference to itself and send that reference...
Read more >
How to switch between multiple windows of Electron JS ...
And this tutorial will demonstrate how to open the Settings page in a new window using Electron JS. We assume that you are...
Read more >
Electron best way for multiple windows - Stack Overflow
And in the Renderer process (inside the created window), you can use it like this: var remote = require('remote'); var windowManager = remote....
Read more >
How to Handle Multiple Windows in an Electron App
Electron allows you to create desktop apps using Node.js. These apps usually have a single window, but here's how to support multiple ......
Read more >
Multi Window Electron Desktop Apps - YouTube
Learn how to send messages between multiple windows using Electron to create a desktop application.Getting started with Node.js: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found