I created a feature request for IPython to be exposed as a window object again but maybe any of you know a workaround.
I want to develop a platform within Jupyter with better styling than Widgets by using HTML/JavaScript. I don’t want to require the user to install a plugin (since I believe the functionality is there, just hidden by the code packer).
If you’re dubious about my use-case, that’s probably fair. Here’s what I have in mind:
The “missing” link (again I believe just hidden by the web packer during build) In Jupyter Notebook is the feature described in this StackOverflow question:
They’re complaining about something that’s not really a good use-case (trying to make the anync JS code affect the current cell’s synchronous output) but just the capability to access IPython is what I mean.
JavaScript executed within a cell accesses window.IPython and tells Jupyter to execute some Python. This works just fine in Jupyter Notebook: Javascript('''IPython.notebook.kernel.execute("my_out = 'hello world'");'''). But fails in JupyterLab.
Any idea if expose_app_in_browser was a feature associated with some CVE related to XSS or something? Or do you know why Jupyter Notebook still supports this but Jupyter Lab chose to change it? Seems like both teams would be on the same page if it’s a security thing.
It’s less about security (you’re in the browser, with a hot shell executor: there’s nothing to keep bad actors out) and more about stability and maintainability: notebooks (or worse, libraries) that heavily rely on “raw” js features are not portable across frontends, as differences like the multi-document nature of JupyterLab makes it much harder to reason about whichJupyter.kernel would do something.
With the modular nature of jupyterlab, many aspects of race conditions, acquiring third party libraries, etc. are resolved at build and install time instead of at runtime. This is less convenient for one-off apps, but is far easier for (volunteer) maintainers over time.
The forthcoming Notebook 7 will share this architecture, so the days of IPython.execute("eval()") are numbered, for certain.