<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Can "openjscad.xyz/?uri=..." support "data" protocol in addition to "http(s)"?]]></title><description><![CDATA[<p dir="auto">I have minimal JSCAD file:</p>
<pre><code>$ cat JSCAD.minimal.js 
module.exports=function main(){return require('@jscad/modeling').primitives.sphere({radius: 50})}
$
</code></pre>
<p dir="auto">I have it online on my webserver as well, and can start openjscad.xyz with it easily, and it just works:<br />
<a href="https://openjscad.xyz/?uri=https://stamm-wilbrandt.de/en/forum/JSCAD.minimal.js" rel="nofollow ugc">https://openjscad.xyz/?uri=https://stamm-wilbrandt.de/en/forum/JSCAD.minimal.js</a></p>
<p dir="auto">Then I tried to use "data" protocol:</p>
<pre><code>$ 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.
$ 
</code></pre>
<p dir="auto">But that URI does not work:<br />
<a href="https://openjscad.xyz/?uri=data:text/plain;base64,bW9kdWxlLmV4cG9ydHM9ZnVuY3Rpb24gbWFpbigpe3JldHVybiByZXF1aXJlKCdAanNjYWQvbW9kZWxpbmcnKS5wcmltaXRpdmVzLnNwaGVyZSh7cmFkaXVzOiA1MH0pfQo=" rel="nofollow ugc">https://openjscad.xyz/?uri=data:text/plain;base64,bW9kdWxlLmV4cG9ydHM9ZnVuY3Rpb24gbWFpbigpe3JldHVybiByZXF1aXJlKCdAanNjYWQvbW9kZWxpbmcnKS5wcmltaXRpdmVzLnNwaGVyZSh7cmFkaXVzOiA1MH0pfQo=</a></p>
<p dir="auto">Is there a reason why data scheme does not work for "?uri=data..."?<br />
If not, can it be enabled?</p>
<p dir="auto">I ask because this method would allow to share simple JSCAD files in the URL without storing them somewhere ...</p>
<p dir="auto">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 ...</p>
<p dir="auto">Regards,</p>
<p dir="auto">Hermann.</p>
<p dir="auto">P.S:<br />
My GraphvizFiddle tool has a similar Share button approach, allowing to share a design via URL, eg:<br />
<a href="https://stamm-wilbrandt.de/GraphvizFiddle/?1705330894960#digraph%20G%20%7Brankdir%3DLR%3B%20JS-%3ECAD%7D%0A" rel="nofollow ugc">https://stamm-wilbrandt.de/GraphvizFiddle/?1705330894960#digraph%20G%20%7Brankdir%3DLR%3B%20JS-%3ECAD%7D%0A</a></p>
]]></description><link>https://openjscad.nodebb.com/topic/418/can-openjscad-xyz-uri-support-data-protocol-in-addition-to-http-s</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Sep 2026 17:44:12 GMT</lastBuildDate><atom:link href="https://openjscad.nodebb.com/topic/418.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 15 Jan 2024 15:03:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Can "openjscad.xyz/?uri=..." support "data" protocol in addition to "http(s)"? on Tue, 16 Jan 2024 20:13:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hrgdavor" aria-label="Profile: hrgdavor">@<bdi>hrgdavor</bdi></a> Thanks, done:<br />
<a href="https://github.com/jscad/OpenJSCAD.org/issues/1318" rel="nofollow ugc">https://github.com/jscad/OpenJSCAD.org/issues/1318</a></p>
]]></description><link>https://openjscad.nodebb.com/post/1392</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1392</guid><dc:creator><![CDATA[Hermann-SW]]></dc:creator><pubDate>Tue, 16 Jan 2024 20:13:09 GMT</pubDate></item><item><title><![CDATA[Reply to Can "openjscad.xyz/?uri=..." support "data" protocol in addition to "http(s)"? on Tue, 16 Jan 2024 19:34:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hermann-sw" aria-label="Profile: Hermann-SW">@<bdi>Hermann-SW</bdi></a> yes, the repo is better for bugs and features</p>
]]></description><link>https://openjscad.nodebb.com/post/1390</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1390</guid><dc:creator><![CDATA[hrgdavor]]></dc:creator><pubDate>Tue, 16 Jan 2024 19:34:21 GMT</pubDate></item><item><title><![CDATA[Reply to Can "openjscad.xyz/?uri=..." support "data" protocol in addition to "http(s)"? on Tue, 16 Jan 2024 19:34:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hrgdavor" aria-label="Profile: hrgdavor">@<bdi>hrgdavor</bdi></a> Sure, Hermann-SW.<br />
Should I create the issue against this repo?<br />
<a href="https://github.com/jscad/OpenJSCAD.org" rel="nofollow ugc">https://github.com/jscad/OpenJSCAD.org</a></p>
<p dir="auto">9/2022 I created thread on user user callbacks:<br />
<a href="https://openjscad.nodebb.com/topic/384/are-there-jscad-user-callbacks?_=1705433092538">https://openjscad.nodebb.com/topic/384/are-there-jscad-user-callbacks?_=1705433092538</a><br />
Should I create a freature request issue on that as well?</p>
<p dir="auto">Regards,</p>
<p dir="auto">Hermann.</p>
]]></description><link>https://openjscad.nodebb.com/post/1389</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1389</guid><dc:creator><![CDATA[Hermann-SW]]></dc:creator><pubDate>Tue, 16 Jan 2024 19:34:17 GMT</pubDate></item><item><title><![CDATA[Reply to Can "openjscad.xyz/?uri=..." support "data" protocol in addition to "http(s)"? on Tue, 16 Jan 2024 12:59:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hermann-sw" aria-label="Profile: Hermann-SW">@<bdi>Hermann-SW</bdi></a> do you have an github account ? This would be nicer as a github issue.</p>
]]></description><link>https://openjscad.nodebb.com/post/1388</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1388</guid><dc:creator><![CDATA[hrgdavor]]></dc:creator><pubDate>Tue, 16 Jan 2024 12:59:30 GMT</pubDate></item></channel></rss>