Can "openjscad.xyz/?uri=..." support "data" protocol in addition to "http(s)"?
-
I have minimal JSCAD file:
$ cat JSCAD.minimal.js module.exports=function main(){return require('@jscad/modeling').primitives.sphere({radius: 50})} $I have it online on my webserver as well, and can start openjscad.xyz with it easily, and it just works:
https://openjscad.xyz/?uri=https://stamm-wilbrandt.de/en/forum/JSCAD.minimal.jsThen I tried to use "data" protocol:
$ cat doit #!/bin/bash browser=firefox browser=chromium-browser $browser "openjscad.xyz?uri=data:text/plain;base64,`base64 -w 0 $1`" $ ./doit JSCAD.minimal.js Opening in existing browser session. $But that URI does not work:
https://openjscad.xyz/?uri=data:text/plain;base64,bW9kdWxlLmV4cG9ydHM9ZnVuY3Rpb24gbWFpbigpe3JldHVybiByZXF1aXJlKCdAanNjYWQvbW9kZWxpbmcnKS5wcmltaXRpdmVzLnNwaGVyZSh7cmFkaXVzOiA1MH0pfQo=Is there a reason why data scheme does not work for "?uri=data..."?
If not, can it be enabled?I ask because this method would allow to share simple JSCAD files in the URL without storing them somewhere ...
I tested, and there is an 8KB URI length limitation on openjscad.xyz. But in case data scheme would work, maybe "...?uri=data:application/gzip,base64;..." would work as well, allowing for scripts with gzipped length of up to 6KB ...
Regards,
Hermann.
P.S:
My GraphvizFiddle tool has a similar Share button approach, allowing to share a design via URL, eg:
https://stamm-wilbrandt.de/GraphvizFiddle/?1705330894960#digraph%20G%20%7Brankdir%3DLR%3B%20JS-%3ECAD%7D%0A -
@Hermann-SW do you have an github account ? This would be nicer as a github issue.
-
@hrgdavor Sure, Hermann-SW.
Should I create the issue against this repo?
https://github.com/jscad/OpenJSCAD.org9/2022 I created thread on user user callbacks:
https://openjscad.nodebb.com/topic/384/are-there-jscad-user-callbacks?_=1705433092538
Should I create a freature request issue on that as well?Regards,
Hermann.
-
@Hermann-SW yes, the repo is better for bugs and features
-
@hrgdavor Thanks, done:
https://github.com/jscad/OpenJSCAD.org/issues/1318
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login