Browse Source

[3.2.x] Expose `window.jupyterapp` (#11417)

* Expose `window.jupyterapp`

* Update help message
Jeremy Tuloup 3 years ago
parent
commit
26000478c9
2 changed files with 3 additions and 1 deletions
  1. 1 0
      dev_mode/index.js
  2. 2 1
      jupyterlab/labapp.py

+ 1 - 0
dev_mode/index.js

@@ -213,6 +213,7 @@ export async function main() {
 
   if (exposeAppInBrowser || devMode) {
     window.jupyterlab = lab;
+    window.jupyterapp = lab;
   }
 
   // Handle a browser test.

+ 2 - 1
jupyterlab/labapp.py

@@ -538,7 +538,8 @@ class LabApp(NBClassicConfigShimMixin, LabServerApp):
     )
     flags['expose-app-in-browser'] = (
         {'LabApp': {'expose_app_in_browser': True}},
-        "Expose the global app instance to browser via window.jupyterlab."
+        """Expose the global app instance to browser via window.jupyterapp.
+        It is also available via the deprecated window.jupyterlab name."""
     )
     flags['extensions-in-dev-mode'] = (
         {'LabApp': {'extensions_in_dev_mode': True}},