You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Open new BrowserWindow in the same renderer process #8959
It would be great if Electron can open new BrowserWindow with the same renderer process. It would make it easier to use subwindows in Electron, like native desktop apps.
Example
// Add function `popupBrowserWindow` that opens a BrowserWindow// with the same renderer process// like native window.open supported in sandboxed mode,// but has full control of BrowserWindowconstpopup=popupBrowserWindow("popup.html",{width: 800,height: 400,parent: remote.getCurrentWindow(),modal: true,});popup.window// => Window object of new windowpopup.browserWindow// => Remote BrowserWindow of new windowpopup.window.document.body.innerHTML="<h1>Hello</h1>"// You can access its DOM directly
Benefits
It becomes easier to open DOM-based dialogs or floating windows in native way
Why not use sandbox: true if you want native window.open API?
Because I also want to use full Node.js support including native addons in the renderer process.
Probably you can proxy it via IPC but I think it would reduce convenience of Electron.
Right now sandbox mode supports the remote module, so you can probably use most node.js modules without much effort(require('electron').remote.require('module')). The fs module proxy is already available directly as require('fs') from the renderer, but we may add more modules.
I still want to use Node modules directly - using all Node modules through remote.require would introduce some problems. For example if you add callbacks to remote objects and reload the window later, you'll have dangling callbacks and Electron will throw errors.
changed the title [-]Feature request: open new BrowserWindow in the same renderer process[/-][+]Open new BrowserWindow in the same renderer process[/+]on Mar 31, 2017
Activity
tarruda commentedon Mar 20, 2017
Why not use
sandbox: trueif you want nativewindow.openAPI?seanchas116 commentedon Mar 20, 2017
Because I also want to use full Node.js support including native addons in the renderer process.
Probably you can proxy it via IPC but I think it would reduce convenience of Electron.
tarruda commentedon Mar 20, 2017
Right now sandbox mode supports the
remotemodule, so you can probably use most node.js modules without much effort(require('electron').remote.require('module')). Thefsmodule proxy is already available directly asrequire('fs')from the renderer, but we may add more modules.seanchas116 commentedon Mar 20, 2017
I still want to use Node modules directly - using all Node modules through
remote.requirewould introduce some problems. For example if you add callbacks to remote objects and reload the window later, you'll have dangling callbacks and Electron will throw errors.[-]Feature request: open new BrowserWindow in the same renderer process[/-][+]Open new BrowserWindow in the same renderer process[/+]