-
Notifications
You must be signed in to change notification settings - Fork 29k
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
Extensions need a writable directory to store and load scripts for usage in a notebook #149868
Comments
Pertinent issue: IPyWidget support requires downloading files and loading them into the notebook output webview. |
Another issue where this is necessary: |
@rchiodo Can you explain why this is needed? Having the extension download files from a CDN so that these files can be served up inside a webview seems like a hack. It would be better to fix the root issue than add an API that helps workaround it |
JS files exist on a remote jupyter machine. These files need to be loaded into the webview. The web extension can download these files because it has the necessary authentication to get them. The webview doesn't. In desktop we workaround this problem by downloading the files next to the extension. In the web version, this location isn't writable so we need to add another location that's writable and we can use as a localResourceRoot. |
What about using data uris for this? |
I think that might work. In the widget code it uses requirejs to load the js files. We inject redirects for requires to URIs. I think that the redirect could redirect to a data uri. |
Is there a size limit for a data uri? Or maybe for a message we send to the webview? The js file would have to be base64 encoded and sent as a string. |
I have not heard of a size limit for data uri but you could also use object urls. They wrap around blobs/files and I am pretty sure no limits exists, this is how we use it for some JS scripts
Ideally you use data/object-urls for desktop too. I believe we aren't super-fans of extension modifying their own installation data. Also curious what auth issue it is that you are running into? Is this jupyter specific or a scenario that could affect other extensions too? |
@rchiodo Just checking, is this is still needed? |
I don't think so. We can use object URLs if necessary but I believe I was mistaken. Jupyter doesn't require authentication for nbextension resources at the moment, so the URL should work directly. |
Right now when running a cell in a notebook, there are certain directories where scripts can be uploaded from.
These include:
The problem is that these locations are not always writable.
This location is:
But
globalStorageUri
is not allowed as a localResourceRoot.This feature request is to have a writable location that can be specified as a 'localResourceRoot' in some way.
The text was updated successfully, but these errors were encountered: