Differences in how Che-Theia Webview works on a single-host mode comparing to a multi-host mode

Depending on which Che deployment strategy is used, single-host or multi-host, there’re 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 a multi-host mode

When Eclipse Che is deployed in a multi-host 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 a 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.