eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
20.08k stars 2.5k forks source link

plugin: webviews on development host do not work on electron #10989

Open saltylassi opened 2 years ago

saltylassi commented 2 years ago

Bug Description:

On electron, and when starting the development host (plugin-system) webviews fail to properly start due to a service worker error:

Uncaught (in promise) DOMException: Failed to register a ServiceWorker: The document is in an invalid state.

Steps to Reproduce:

  1. open https://github.com/microsoft/vscode-extension-samples/tree/main/webview-sample as a workspace
  2. build the extension (npm i)
  3. start the debug configuration run extension
  4. the development host should start
  5. trigger the command cat coding: start cat coding session
  6. the webview editor opens but there is no content with the above error

Additional Info

vince-fugnitto commented 2 years ago

I simplified the issue so the problem is more easier to reproduce and identify :+1:

Looking at vscode, it seems they set special privileges for the vscode-webview scheme to allow service-workers, and it may be the reason that it does not work in the framework at the moment (previously I thought it was disabled for security reasons):