Skip to content
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

Hijack links clicked from within JupyterLab #8

Closed
dhirschfeld opened this issue Apr 13, 2018 · 4 comments
Closed

Hijack links clicked from within JupyterLab #8

dhirschfeld opened this issue Apr 13, 2018 · 4 comments

Comments

@dhirschfeld
Copy link

For a notebook with a link to some reference documentation it would be nice if by default the web page was opened in jupyterlab_iframe so you could use the powerful phosphor layout capabilities to place it where you want rather than have it open in a new tab.

Ctrl-click could then as usual open in a new tab and there could be a context menu item for that too.

@timkpaine
Copy link
Owner

@ian-r-rose @blink1073 you guys have any thoughts about this?

@ian-r-rose
Copy link

@timkpaine I think you should be able to create a new IRenderMimeRegistry for the application and provide your own IResolver and ILinkHandler options for it that override the default behavior. In particular, I think you would want to override the IResolver.isLocal function to tell the application to treat your iframe urls as local links, and the ILinkHandler.handleLink function to open your iframe urls with your extension.

@blink1073
Copy link

One better, we could make IResolver and ILinkHandler into tokens and have them be optional arguments here:

https://github.com/jupyterlab/jupyterlab/blob/2c57346d4f4d69a26afe79b15df919e3c8fe17dd/packages/rendermime-extension/src/index.ts#L30

Then this plugin could provide those without the user needing to disable the core plugin.

@timkpaine
Copy link
Owner

I think im going to close this. Its a good thought, but in the "real world" stuff has been way more difficult. As a simple example, id say 99% of jupyterlab users run without ssl, and 99% of the websites they access will run with ssl, meaning 99% of the links we want to hijack will pass through the jupyterlab_iframe proxy which make life super difficult. Same deal for websites not allowing iframe embedding (e.g. google.com), websites with cors issues, etc. The user experience would just be terrible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants