mirror of
https://github.com/jupyter/notebook.git
synced 2025-03-13 13:17:50 +08:00
Merge pull request #2262 from wordofglass/new_browser_window
Add 'new_browser_window' config option
This commit is contained in:
commit
ee13349d2d
@ -686,7 +686,18 @@ class NotebookApp(JupyterApp):
|
||||
standard library module, which allows setting of the
|
||||
BROWSER environment variable to override it.
|
||||
""")
|
||||
|
||||
|
||||
webbrowser_open_new = Integer(2, config=True,
|
||||
help="""Specify Where to open the notebook on startup. This is the
|
||||
`new` argument passed to the standard library method `webbrowser.open`.
|
||||
The behaviour is not guaranteed, but depends on browser support. Valid
|
||||
values are:
|
||||
2 opens a new tab,
|
||||
1 opens a new window,
|
||||
0 opens in an existing window.
|
||||
See the `webbrowser.open` documentation for details.
|
||||
""")
|
||||
|
||||
webapp_settings = Dict(config=True,
|
||||
help="DEPRECATED, use tornado_settings"
|
||||
)
|
||||
@ -1394,7 +1405,7 @@ class NotebookApp(JupyterApp):
|
||||
uri = url_concat(uri, {'token': self.one_time_token})
|
||||
if browser:
|
||||
b = lambda : browser.open(url_path_join(self.connection_url, uri),
|
||||
new=2)
|
||||
new=self.webbrowser_open_new)
|
||||
threading.Thread(target=b).start()
|
||||
|
||||
if self.token and self._token_generated:
|
||||
|
Loading…
Reference in New Issue
Block a user