Git Product home page Git Product logo

Comments (3)

gzuidhof avatar gzuidhof commented on May 20, 2024

Ah, fun to see a potential integration into Jupyterlab! :)

I think the short answer is that you should run Starboard Notebook in an iframe inside of JupyterLab (or any web app) on a different origin. Running it without the iframe is a security hazard (if you open my evil notebook it can call JupyterLab's Kernel API and mess with your computer by executing arbitrary Python code.

Of course if this is more of a hobby project and you can trust all notebooks you will ever open then you can get away with a notebook on the same origin. Starboard wrap (https://github.com/gzuidhof/starboard-wrap) makes it easy to do. Without the iframe you will probably also have clashing styles and JS.

Now of course this error you are seeing should be fixed anyhow, I wonder what kind of URL it is trying to construct.. A service worker can only be registered under the path where it is located, so here it won't be succesful anyway :(. For example a service worker on https://bla.com/a/b/myserviceworker.js will only be able to intercept requests from URLs under /a/b/, in your setup these paths are different which will be problematic.

I'm not sure if it is possible to make Jupyter Lab cross origin isolated - I think it is, but you will need to tell Jupyter Lab to set the correct headers (reference).

I'm sorry that this is a bit of an involved answer :(, the entire cross origin isolated / secure context requirements that browsers have nowadays are complicated. If you want you can join the small Discord community and we can have a bit of a tighter feedback loop https://discord.gg/EGgm3mPP

from starboard-notebook.

stefaneidelloth avatar stefaneidelloth commented on May 20, 2024

Thank you for the fast reply. Security is not an issue for now. Nevertheless, I'll try the iframe thing. Hopefully my model tree will then still be able to interact with the code cells of starboard, to remotely control the notebooks during batch studies or sensitivity analysis.

(My aim is to combine several observable notebooks in a model tree. I am not sure, where this journey is going to, more to Jupyter and akernel or to Starboard and observablehq. Currently I play around a bit to understand available options and their limitations...)

I wonder what kind of URL it is trying to construct

The corresponding code section is shown on first screenshot, line 18 in the dev tools.

from starboard-notebook.

stefaneidelloth avatar stefaneidelloth commented on May 20, 2024

Using starboard-wrap and importing starboard from cdn source

https://cdn.starboard.gg/npm/[email protected]/dist/index.html

worked without cross origin warnings. I also tried to use starboard-wrap in combination with the local instance of starboard-notebook under node_modules. However, I did not get it working. There is an existing issue ticket on that topic:

gzuidhof/starboard-wrap#5

from starboard-notebook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.