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

Open jupyter lab url via custom command with placeholder #7226

Open
antoine-gallix opened this issue Sep 18, 2019 · 0 comments
Open

Open jupyter lab url via custom command with placeholder #7226

antoine-gallix opened this issue Sep 18, 2019 · 0 comments

Comments

@antoine-gallix
Copy link

Description

I'm trying to use Chrome in app mode to open jupyter lab at startup. Chrome app mode is a stripped down interface made to open applications. I can do it manually with the following command

chromium --app="http://localhost:8888/?token=052b2ab48e31bba526723bb28ccb6445475fb02fdf887356"

I have to get the URL by hand in the shell terminal that runs Jupyter Lab.

I've found the c.NotebookApp.browser option that allows to use a custom command to open the lab. I also found the undocumented possibility to insert the jupyter file string in the command c.NotebookApp.browser = 'chromium --app=%s'. But it seems that the string used in the placeholder is the file version of the lab, the one cited in the jupyter lab terminal window: file:///home/antoine/.local/share/jupyter/runtime/nbserver-20759-open.html. The chrome window opened by jupyter lab at startup complains with the following error:

Access to the file was denied
The file at file:///home/antoine/.local/share/jupyter/runtime/nbserver-27050-open.html is not
 readable. It may have been removed, moved, or file permissions may be preventing access.
ERR_ACCESS_DENIED

To manage to do what I wanted I would need one of the following:

  • an option to write the url+token string somewhere in a file so I can use it programatically to open the lab by myself.
  • an option to feed the url to the browser string with placeholder, instead of the file version of the lab
  • in any case, the placeholder option for browser command is undocumented, I found it by coincidence on a forum. That would be nice to have it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant