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

Move opening path in new browser tabs to a separate plugin #7056

Merged
merged 25 commits into from
Sep 20, 2023

Conversation

jtpio
Copy link
Member

@jtpio jtpio commented Sep 18, 2023

This will help downstreams like JupyterLite configure how they open paths more easily, without having to redefine all the plugins.

Paths can be:

  • files, like example.py or notebooks/example.ipynb
  • terminals
  • consoles

By default in Notebook 7 paths are opened are joined with /, for example https://localhost:8888/notebooks/example.ipynb.
In the case of JupyterLite paths are opened by specifying the ?path= query string parameter in the URL, for example: https://localhost:8000/notebooks?path=example.ipynb`.

To avoid having downstream applications like JupyterLite have to override several plugins to be able to customize the behavior of window.open, the path opening logic is moved to a dedicated plugin so only that plugin would need to be redefined in other applications.

  • Add INotebookPathOpener to be able to override the URL for opening paths
  • Keep it optional to not break existing behavior in potential downstream applications reusing some notebook plugins

@jtpio jtpio added this to the 7.0.x milestone Sep 18, 2023
@github-actions
Copy link
Contributor

Binder 👈 Launch a Binder on branch jtpio/notebook/window-opener-plugin

@jtpio jtpio marked this pull request as ready for review September 19, 2023 09:28
@jtpio jtpio marked this pull request as draft September 19, 2023 09:47
@jtpio jtpio marked this pull request as ready for review September 20, 2023 06:48
@jtpio jtpio merged commit 6246540 into jupyter:main Sep 20, 2023
31 checks passed
@jtpio jtpio deleted the window-opener-plugin branch September 20, 2023 06:48
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant