Skip to content

Commit 4271752

Browse files
committed
add open_browser trait to ExtensionApp
1 parent e1b4ce4 commit 4271752

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

jupyter_server/extension/application.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ def static_url_prefix(self):
161161
help=_("The default URL to redirect to from `/`")
162162
)
163163

164+
open_browser = Bool(
165+
True,
166+
help=_("Should the extension open a browser window?")
167+
)
168+
164169
custom_display_url = Unicode(u'', config=True,
165170
help=_("""Override URL shown to users.
166171
@@ -319,7 +324,7 @@ def start(self):
319324
# Override the server's display url to show extension's display URL.
320325
self.serverapp.custom_display_url = self.custom_display_url
321326
# Override the server's default option and open a broswer window.
322-
self.serverapp.open_browser = True
327+
self.serverapp.open_browser = self.open_browser
323328
# Hijack the server's browser-open file to land on
324329
# the extensions home page.
325330
self.serverapp._write_browser_open_file = self._write_browser_open_file

0 commit comments

Comments
 (0)