Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add context isolation option to windows and webview tags #8348
This pull request adds support for running the
This option is completely opt-in and no existing behavior is changed.
Shown below is an application that loads a page (possibly remote/untrusted) but wants to open any clicked links in an external browser using Electron's
This example also shows how variables can be injected into the loaded page and how the preload script can listen for messages from the page using
Jan 17, 2017
8 of 9 checks passed
The second. Our use case is that we don't want any node modules required by mistake in the renderer (and we also load some external content), so we preload them with nodeIntegration off. However, we do need a webview that has to communicate with the main process too. If we use an iframe, we should make an additional proxy from postMessage to ipc.
@bundyo Your use case sounds a bit unusual, however it is still not possible to load a webview in a webContents with nodeIntegration disabled.
However as a potential solution to your exact use case, have you considered simply using two WebViews? I.e.