diff --git a/jupyter_server/extension/application.py b/jupyter_server/extension/application.py index 3cc7c79aef..f3ce62e59d 100644 --- a/jupyter_server/extension/application.py +++ b/jupyter_server/extension/application.py @@ -7,6 +7,7 @@ Unicode, List, Dict, + Bool, default, validate ) @@ -205,6 +206,14 @@ def static_url_prefix(self): help=_("""Handlers appended to the server.""") ).tag(config=True) + open_browser = Bool(True, + help=_("""Whether to open in a browser after starting. + The specific browser used is platform dependent and + determined by the python standard library `webbrowser` + module, unless it is overridden using the --browser + (ServerApp.browser) configuration option. + """)).tag(config=True) + def _config_file_name_default(self): """The default config file name.""" if not self.extension_name: @@ -311,7 +320,7 @@ def initialize_server(cls, argv=[], load_other_extensions=True, **kwargs): config = Config({ "ServerApp": { "jpserver_extensions": {cls.extension_name: True}, - "open_browser": True, + "open_browser": cls.open_browser, "default_url": cls.extension_url } })