So bad is not a full html self runnable, I guess it is doable with some quick trickery. In that case, one could build a QR code html interpreter (aka read > output to file > open the file with firefox ) and it would be so cool
(I had to fix the mime type detection and I'll have to push that fix to PyPI, so use the main branch if you want to try it yourself.)
Unfortunately, since we have to ship it with the gzip lib pako.js, the size more than quadruples to 77kb, so no QR code with this approach. Maybe I should look into making compression optional.
You can use DecompressionStream instead of pako.js for all modern browsers. FetchCrunch [1] uses it to generate self-extracting HTML files, which were not portable at that time but now fully portable across browsers.