-
Notifications
You must be signed in to change notification settings - Fork 946
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
HTML export not working when embbed in iframe #3652
Comments
Small update:
by (that I picked up from an example file in this repo):
This seem to work from an iframe too, but this still doesn't work in jupyterlab |
This is interesting, it seems the code I wrote above works in jupyterlab in firefox but not in chrome So just to recap:
In chrome console log I get the following 2 errors:
and
Do you have any idea why this would fail to render in chrome, especially in chrome in jupyterlab ? |
Description
When using ipyaggrid, it's possible to create a grid component (usually to be displayed in jupyter), and also to export it as a stand-alone HTML page.
If I export the grid component as a HTML page, and open the stand-alone HTML page on my browser, it works fine.
However, if I try to open the HTML page from the jupyter notebook explorer, or from the jupyterlab explorer, it fails to render.
It's also the same issue that I get if I try to embed the HTML content in an iframe.
I'm trying to understand where the issue is coming from. AFAIU It's a problem with amd-embed.js, but I'm unable to understand what would cause it to behave differently between being rendered normally and in an iframe.
Can you please confirm if it's indeed a bug in components located on this repo, and potentially a way to solve this ?
thank you !
Reproduce
In jupyterlab notebook file, export to HTML a grid component
--> test 1: open test.html in your browser: it should display a grid component (after few seconds loading)
--> test 2: open test.html from jupyterlab: fails to render
--> test 3: wrap test.html in an iframe, and open it in your browser: fails to render
For tests 2 and 3 I get the same error in js console, which is :
From what I've been able to understand, it could be due to this line:
https://github.com/jupyter-widgets/ipywidgets/blame/763dbb9f9278d2f9fe7121a124cb79bf9e31f239/packages/html-manager/amd-public-path.js#L5 where
document.location
is null in the case of iframe, but I'm not 100% sureAttached in the zip file are the working test.html file, and the non-working code wrapped in an iframe test_wrapped.html file
Expected behavior
generated HTML file renders correctly both in "standalone" and in jupyter / iframes
Archive.zip
The text was updated successfully, but these errors were encountered: