How do webview processes render to main process's window in OSX


#1

Webviews run in a separate process as the main process and somehow render their content to the BrowserWindow created in the main process. This seems to be a similar pattern with the render processes.

In Windows, we can render to another process’s window by grabbing the window handle…
In OSX there is no obvious way to access the main process’s NSWindow (created via BrowserWindow) inside a render process. So how does a webview render its DOM on the main process’s NSWindow?

More context if Im missing something in my question:
I have an openGL renderer that I can hookup to the main process using node addons and provide the NSWindow to my GL stack and I am rendering my GL stuff. If I had this node addon hooked up inside a webview’s process, it wont work, because I dont have access to the NSWindow created via BroswerWindow in the main process and can’t do much with the NSView* returned by
electron.remote.getCurrentWindow().getNativeWindowHandle()
This all works in Windows but OSX is a lot more restricted when it comes to inter-process memory access…but webviews somehow render.


#2

The Chromium rendering engine handles all of that. You would probably be better off asking on the Chromium discussion groups.


#3

Here’s the post to the Chromium group:

https://groups.google.com/a/chromium.org/forum/#!topic/chromium-discuss/xfgWL7jNajk