jupyter_server icon indicating copy to clipboard operation
jupyter_server copied to clipboard

Fix notebook URL opened in browser when redirect file not used

Open randomir opened this issue 9 months ago • 6 comments

Fix #1325.

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.

ServerApp used to do the same, last time in v1.3.0. The change in behavior/bug seems to be introduced in 1bbcbcb359, released as 1.4.0.

randomir avatar Sep 18 '23 12:09 randomir

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly. welcome You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] avatar Sep 18 '23 12:09 welcome[bot]

If this PR is on the right track, I can try adding some tests. Lmk.

randomir avatar Sep 18 '23 12:09 randomir

Hi @randomir, this seems like a reasonable change to me. @afshin, since you made the original change, do you agree?

blink1073 avatar Sep 19 '23 00:09 blink1073

Hi @randomir, this seems like a reasonable change to me. @afshin, since you made the original change, do you agree?

This looks right to me. @randomir do you want to take a crack at writing a test? Otherwise, I can take this PR over to get it merged.

Zsailer avatar Dec 06 '23 17:12 Zsailer

@Zsailer, thanks for taking a look. I can take a crack at writing a test, and then ping you when I think it's ready for review.

randomir avatar Dec 07 '23 09:12 randomir

Great! thanks @randomir! Let me know if you need any help or have any questions around our unit tests.

Zsailer avatar Dec 07 '23 15:12 Zsailer

From my perspective, it appears this is not limited to notebooks but to jupyterlab as well. It appears that the jupyter lab command does not see or respond to c.ServerApp.use_redirect_file=False by sending http://localhost:8889/?token=... to the browser (instead of sending file:///...)

With this PR, will jupyter lab now respect c.ServerApp.use_redirect_file=False? If yes, when will this be merged? If no, can you please clarify for me? Is there a different config to be able to get jupyter lab to not use a redirect file but rather send http://localhost:8889/?token=...?

Thank you.

DanielGoldfarb avatar May 14 '24 20:05 DanielGoldfarb