How to send a runtime reference to a <webview>?


Is it possible to send a runtime reference to a <webview>?

I know we have ipc, which serializes everything. Is there some way to send functions, and other non-serializable objects to other BrowserWindows or <webview>s?


webview.shadowRoot.querySelector('object').contentWindow returns null, no luck there.


Ah, it seems that I can call Electron.remote.getGlobal('something') inside the <webview> and get whatever reference I need if it’s on the main process global.

But that brings up another question: how do we prevent windows (or <webview>s) from accessing everything in the main process global by calling Electron.remote.getGlobal('global')? Suppose we have an “app platform” that loads “apps” in child windows, and we don’t want them to do anything fishy with the main process.

Another question is, can we get the global of a BrowserWindow as easily as we can get the main process global?