-
Notifications
You must be signed in to change notification settings - Fork 27.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
importScripts works in browser web EH but not in desktop web EH #128080
Comments
I updated the title. |
Yeah, there is two problems:
|
FWIW, extensions running in the web worker extension host should be able to spawn their own |
Yes - either run in a separate worker or bundle everything into a single JS file. That's what I would strongly recommend |
|
Also discussed this with @aeschli yesterday and our thinking/plan is to prohibt
|
Would extensions be able to continue to use
Yes, for context, Eleanor and I are exploring use cases for Pyodide (Eleanor is investigating Pyodide for her internship, I'm doing a separate investigation out of personal interest). Pyodide is the CPython runtime, compiled to WASM and capable of running in a renderer or web worker. Pyodide can load and run Python packages as well, also compiled to WASM. The problem is that it would be several hundred MB if we were to bundle and ship all the Python packages that users might conceivably want to import. For my specific use case, which is enabling users to run Python code in Jupyter notebooks via Pyodide in the browser web worker extension host, I would much rather lazy-load the JS/WASM for Python packages from a CDN than ship a large bundle upfront containing packages that the user may never need to use. |
Yeah, for web workers spawned by extensions we have no restrictions planned. Such workers are scoped to your extension, therefore less conflicting with other extensions or the extension host implementation. Esp. for something like Pyodide a dedicated worker is highly recommended |
Thank you for the extra information! I also recommend in this case to create a |
Closing this issue as I have pushed a commit that blocks @aeschli you might now a place where to document this? |
To verify write a web extension that calls |
I added it to the web extension wiki |
I'm not sure how to write a web host extension. Is it documented somewhere/Or an example? And assuming I write one, how do I test it? |
@joyceerhl provided some steps internally. |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
importScripts("https://cdn.jsdelivr.net/pyodide/v0.17.0/full/pyodide.js");
in yourextension.ts
file (enable webworkers to use this command)TypeError: Failed to execute 'importScripts' on 'WorkerGlobalScope': This document requires 'TrustedScriptURL' assignment.
The following error occurs when I try and run my web extension on the desktop vscode and it seems that the import scripts line pasted above that causes the error.
The text was updated successfully, but these errors were encountered: