question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Populate notebook data from URL parameter

See original GitHub issue

It would be beneficial to allow “saving” to and loading from a query parameter. More specifically, I am proposing something like the ability to create/interpret URLs like https://jupyterlite.readthedocs.io/en/latest/_static/lab/index.html?loadarchive=<base64-encoded-archive>&path=some/path/into/archive/notebook.ipynb. This differs from #430. It may be closely related to #458, but easier to exploit by novices.

Without understanding feasibility, approaches might be:

  • “Mounting” the archive read-only somewhere in the File Browser tree
  • Unpacking the archive into the File Browser tree (perhaps resulting an error prior to unpacking if there are conflicts)
  • ???

Problem: Publishing content requires a high degree of technical expertise and access to serving mechanisms (e.g., GitHub)

Currently, the threshold to create and share content is high. One either needs to create and serve a JupyterLite installation with the content embedded, or one needs to create and serve a URL with that content and provide instructions for the recipient to manually load that content using the Open from URL... feature. Even if #430 were solved, content creators still have to create and serve notebooks independently from the viewing platform.

Solution: Allow content publication allowing URLs (and URLs alone) to serve as the transport mechanism, which can be copied from the platform in which they were created, then passed around without having to serve that data anywhere else

Yes, some installation needs to exist somewhere. However, this affords extending use of that installation to others. For example, an installation owner could share an initial approach to an audience. An audience member could expand on that approach and, without any other infrastructure, create a URL capturing the edits and share it (e.g., back to the original sender, with the same audience, in an entirely new context, etc.).

This isn’t unheard of. @HighDiceRoller has done something similar (and simpler) by allowing an LZString-encoded query parameter to propagate code in Icecup. AnyDice allows URL creation (presumably backed by some server-side storage) that reference existing programs. There are probably dozens of (better) examples, but those are what’s in front of me right now.

Security implications

Any caveat that applies to Open from URL... or similar (e.g., https://github.com/jupyterlite/jupyterlite/issues/458#issuecomment-1022532513) probably applies here. However, this does present additional risks in that it makes using an unwitting third party’s installation much, much easier. For example, if this feature were developed and enabled on JupyterLite’s own RtD site, others might use it extensively for things having nothing to do with either RtD or JupyterLite, perhaps taxing resources of that platform in unexpected ways, or perhaps even exploiting the trustworthiness of the domain to more easily trick recipients into loading malicious code. If developed, this should be disable-able by the installation owner and should probably default to disabled.

Applicability to other Jupyter versions

It’s quite possible this feature belongs in Jupyter Lab as well. If so, it can be moved or refiled there.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
bollwyvlcommented, Oct 29, 2022

Right. But the UX of an extension.

1reaction
bollwyvlcommented, Oct 29, 2022

Giant base64-encoded blobs as data uris are still just urls, and could also be serviced by the same flavor of extension as #430, just bounded by a 2mb-URL prefix limit, and would be less inspectable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fill form fields in Colab notebook from URL query parameters
How can I dynamically populate a form field in my Colab notebook from a URL query parameter so I can construct preconfigured links...
Read more >
How-to : Passing arguments in the url of the notebook / PAC
This is useful to have a shareable url with specific default values. ... from Fabian Iwand, I've improved the method to extract parameters...
Read more >
Use Parameters in Your Scheduled Notebooks - Esri
Step 1: Decide which notebook values you want to be able to change using parameters. In my case, I want to use parameters...
Read more >
Use URL parameters to create and modify maps - ArcGIS Online
You can create and modify maps using URL parameters. ... data layers; an extent; a legend; and navigation tools such as zoom, pan,...
Read more >
Parameters | Query and analyze data - Mode Support
You can include parameter values in a report's URL query string and Mode will return the report's output using those values. NOTE: Parameters...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found