-
Notifications
You must be signed in to change notification settings - Fork 506
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
Allow "Render with Voilà" button to open new tab #1507
Comments
Hello, I have the same (maybe) issue. I tried the below but it is ignored; the frame-ancestors is still none. Error: Have you tried the solution in the link? |
The solution in the link doesn't work for me because that's explicitly disabling security protections for the Jupyter server, granting all users of the Hub full access to each others' servers. I would like to be able to use the button without disabling security. |
I did find a way that appears to work to keep voilà iframes working: get the page content with // fetch HTML with credentials
r = await fetch(url, {headers: Authorization: "Bearer TOKEN"})
html = await r.text()
// put HTML in iframe srcdoc to avoid CSP issues on src
iframe.srcdoc = html This works because |
I think the error is detectable, so it could open in a new tab as needed without necessarily changing the default. But I agree that the open-in-tab option should be more user-visible by default. |
Problem
JupyterHub CORS policy usually prohibits embedding Jupyter Server pages in iframes, which means the in-panel voila viewer in the JupyterLab extension doesn't work:
But launching in a new tab works fine:
Aside: it would probably be appropriate to display an error if you can detect it, rather than purely an empty white panel with no messages visible to the user except in the js console.
Proposed Solution
It would be nice to have a configuration option to set the voilà toolbar button to invoke the "Open with Voila in new browser tab" action instead of the preview pane when it doesn't work.
Double nice, though I'm not sure it is possible, would be launch the tab automatically if the IFrame fails to load. I'm not sure that is doable, though, and I assume pop up blockers would prevent it since it would be too far removed from the click event.
Additional context
JupyterHub default CORS does not allow
frame-ancestors: self
because multiple users share the same domain in the default configuration, so no iframe is safe.The text was updated successfully, but these errors were encountered: