-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Create iframe extension #2369
Comments
Iframes are pretty awesome for making quick-and-dirty extensions where it may not be possible or worth it to try to make everything work together. Indeed, having the "Open with Notebook Classic" be able to open an dockpanel iframe would be great, maybe even with some cross-talk between the two frames to notify on changes, command palette, etc. In a couple toy extensions that wrap heavy-duty, opinionated applications, I have found that it's nice to have a toolbar/🍔 with stuff that, while usually available in the browser context menu, can still be hidden/destroyed/require developer knowledge:
Additionally, wrapping up the export interface ISandbox {
'allow-forms'?: boolean;
'allow-modals'?: boolean;
'orientation-lock'?: boolean;
'allow-pointer-lock'?: boolean;
'allow-popups'?: boolean;
'allow-popups-to-escape-sandbox'?: boolean;
'allow-presentation'?: boolean;
'allow-same-origin'?: boolean;
'allow-scripts'?: boolean;
'allow-top-navigation'?: boolean;
}
export const DEFAULT_SANDBOX: ISandboxOptions = {
'allow-forms': true,
'allow-presentation': true,
'allow-same-origin': true,
'allow-scripts': true,
}; (though for the Instrumenting the Also speaking of attributes, supporting I've ended up noticing some postMessage/ In addition, handling the dockpanel drag drop, even with the nasty CSS hack, is still pretty clutch. Finally, mixed http/https stuff can create a headache... not sure the right way to handle that... in 2017, making your own cert, adding it to the system/browser chain, etc. is still a pain. |
I'm somewhat interested in this, I think. I have a JLab server running within an HPC environment. I've ssh-tunneled a single port to get access to JLab and would like to piggy-back on this if possible to also look at other web servers visible within that HPC environment. In particular I'm interested in looking at Dask's diagnostic dashboard page (as a temporary fill in to making a proper extension of course :)). I'm not sure where I should go to ask about this. This issue seemed like possibly the best place, but I'm quite happy to be redirected if this question is in the wrong place or generally foolish :) |
Maybe this would also be useful for a docrepr extension? IIRC last time I tried it I had some issues with the formatting that an iframe might fix |
@mrocklin this is the right issue. Once we build an iframe extension, there would be a JupyterLab command to open an iframe pointing to a URL. However, that would assume that the other HTTP server was reachable by the frontend. In some HPC environments that isn't a given. |
Just came here b/c I think this discussion is the right place also for my use case: I'm finding myself having to look at local HTML files in a remote server quite often. Interestingly, with classic, I can just click on them (as I just discovered a second ago), so that's a good fallback for now: But in Lab, my options are either or Neither is super-satisfying... Is there a (security?) reason why in Lab we don't want to display/view HTML directly as classic does? cc @ian-r-rose @mpacer as per today's chat. |
I've created a rough Sandbox-ed IFrame extension here (canavandl/jupyterlab_sandbox#1) could probably be extended to minimally serve and load local HTML files. I'm also not 100% clear of the security implications of such an extension either. |
What is blocking this issue? I really want this feature because we often view compiled HTML files of notebooks. |
@bicycle1885 I find a trick: from Help -> Launch classic notebook -> open your html file -> replace the link |
I made a lab extension for viewing HTML files in an IFrame in a new JupyterLab Tab (https://github.com/mflevine/jupyterlab_html). There are a couple bugs such as internal href links with open another JupyterLab in the IFrame instead of moving to the position in the file. Also the IFrame Tabs resist being dragged over and resized. But I am able to view the HTML files in the HPC environment I work on. If anyone has any ideas, they would be greatly appreciated. |
@ellisonbg whoops, probably should've checked this issue first. I'm doing this, can probably easily combine with @mflevine's stuff as well |
@ellisonbg @mrocklin this was my use case as well |
I have fixed the bugs I was experiencing and the extension now works as expected. |
Currently, users have 3 options for iframe support: Since it seems to be a generally useful feature perhaps one of these could be officially blessed and moved to the jupyterlab org? In that way no-one is reinventing the wheel and development of new features and bug-fixes can be concentrated in the one repo. |
Don't forget the very simple iframe widget that comes with jupyterlab itself! https://github.com/jupyterlab/jupyterlab/blob/e4e05e2a0969238baf8db4296436628e5cf783fd/packages/apputils/src/iframe.ts Would you (or someone) compare these options and list what the differences, strengths and weaknesses are? Are they all addressing exactly the same problem? |
(and I'm +1 on having an iframe widget in core jlab that lets you open arbitrary web pages or double-click on an html file) |
I certainly don't have the js/ts chops to comment on the implementations but perhaps the authors themselves could pitch the relative strengths of their implementation? |
The extension I wrote (jupyterlab_html), is a mimerenderer for |
Mine does no mimerendering, it just opens a page as a widget. Mine also has some python side stuff for "quick links". No problem with merging, but beware opening iframes is rife with annoyances (sites that won't allow it, http/s cross opening not allowed, etc) |
Hi everybody! Could you please give me an advice?
How may I do this? |
General update: you can right-click on a file in the file manager and choose "Open in new browser tab" to get an html file to open in a new browser tab. This is like what happens in the classic notebook. |
Setting as 1.0 for triage discussion next week. |
#5855 adds live editing for local HTML files. For opening of arbitrary URLs in iframes I recommend checking out @timkpaine's |
Right now the
help-extension
has the ability to open a URL in the dock panel. We should abstract this into a separate extension that offers:.html
files. This would provide a nice way for simple web development.The text was updated successfully, but these errors were encountered: