Skip to content

Commit 00447c1

Browse files
committed
Fix notebook URL opened in browser when redirect file not used
With `notebook~=7.0` ServerApp is responsible for launching browser, not NotebookApp anymore. In `notebook~=6.0`, `launch_browser` will append notebook path for opening in browser even when `use_redirect_file` is set to `false` - unlike ServerApp, ever since 60c66b6.
1 parent 1cb4116 commit 00447c1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

jupyter_server/serverapp.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2777,6 +2777,10 @@ def _prepare_browser_open(self):
27772777
if self.identity_provider.token:
27782778
uri = url_concat(uri, {"token": self.identity_provider.token})
27792779

2780+
if self.file_to_run:
2781+
file_to_run_relpath = self._resolve_file_to_run_and_root_dir()
2782+
uri = url_escape(url_path_join(uri, *file_to_run_relpath.split(os.sep)))
2783+
27802784
if self.file_to_run: # noqa
27812785
# Create a separate, temporary open-browser-file
27822786
# pointing at a specific file.

0 commit comments

Comments
 (0)