Skip to content

Commit 15dd628

Browse files
authored
Merge pull request #217 from datalayer-contrib/ext-open-browser
Use extensionapp open_browser trait for serverapp config
2 parents 6d909ca + 6253c77 commit 15dd628

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

jupyter_server/extension/application.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Unicode,
88
List,
99
Dict,
10+
Bool,
1011
default,
1112
validate
1213
)
@@ -205,6 +206,14 @@ def static_url_prefix(self):
205206
help=_("""Handlers appended to the server.""")
206207
).tag(config=True)
207208

209+
open_browser = Bool(True,
210+
help=_("""Whether to open in a browser after starting.
211+
The specific browser used is platform dependent and
212+
determined by the python standard library `webbrowser`
213+
module, unless it is overridden using the --browser
214+
(ServerApp.browser) configuration option.
215+
""")).tag(config=True)
216+
208217
def _config_file_name_default(self):
209218
"""The default config file name."""
210219
if not self.extension_name:
@@ -311,7 +320,7 @@ def initialize_server(cls, argv=[], load_other_extensions=True, **kwargs):
311320
config = Config({
312321
"ServerApp": {
313322
"jpserver_extensions": {cls.extension_name: True},
314-
"open_browser": True,
323+
"open_browser": cls.open_browser,
315324
"default_url": cls.extension_url
316325
}
317326
})

0 commit comments

Comments
 (0)