Differences in Che-Theia Webview in single-host mode and multihost mode

Depending on which Che deployment strategy is used, single-host or multihost, there are differences in how Che-Theia Webview API works.

What’s a Webview

Webview Plug-in API allows creating a view within Che-Theia to show an arbitrary HTML content. Internally, it’s implemented with an iframe and service worker.

Webview in multihost mode

When Eclipse Che is deployed in multihost mode, Webview content is served on a separate origin. That means it’s isolated from the main Che-Theia context. So, a contributed view has no access:

  • to the top-level DOM

  • to the Che-Theia state, like local storage, cookies, and so on.

Webview in single-host mode

When Eclipse Che is deployed in single-host mode, Webview content is loaded through the same origin as the main Che-Theia context. It means that nothing prevents external content from accessing the main Che-Theia in a browser. So, pay extra attention to what content may be loaded by different Plugins that contribute the Webviews.