简体   繁体   English

如何在隐身模式下默认打开 Jupyter Notebook (Chrome)

[英]How to default open Jupyter Notebook in incognito mode (Chrome)

No matter what I do, jupyter notebook always opens in chrome non-incognito mode.无论我做什么,jupyter notebook 总是以 chrome 非隐身模式打开。 This is my jupyter_notebook_config.py file这是我的 jupyter_notebook_config.py 文件

## Specify what command to use to invoke a web browser when opening the notebook.
#  If not specified, the default browser will be determined by the `webbrowser`
#  standard library module, which allows setting of the BROWSER environment
#  variable to override it.
#  Default: ''

import webbrowser
webbrowser.register('incognito-chrome',None, webbrowser.get("C:/Program Files/Google/Chrome/Application/chrome.exe %s --incognito"))
c.ServerApp.browser = 'incognito-chrome'

Please help请帮忙

Another way of opening an incognito chrome window is as below:打开隐身镀铬窗口的另一种方法如下:

import webbrowser as wb
jUrl = 'http://localhost:8888' #Default jupyter host
incongnito_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s --incognito'
wb.get(incongnito_path).open_new(jUrl)

This works for me!这对我有用!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM