What I want is a web-extensions, bookmarklet or some light-weight solution,
which allow user to open a webxdc in browser easily.
Though we can unzip it and open it in browser with file: protocol,
the localstorage will get lost if the file path change,
and window.webxdc.* api will not work.
I am new to webxdc and delta chat,
but I think the webxdc’s concept should not be limited in delta chat.
Delta chat is not a large desktop app,
but install delta chat only to run a webxdc is a little overwork.
I developed some web apps which work fine offline,
but I can only publish them online.
Publish a zip file is not very intuitive for end users.
(and with some limitations on local storage api.)
It would be great if end users can easily open a xdc file in browser,
though it might not be able to block any http request in a normal browser like delta chat.
I know there is a run command in webxdc-dev npm package,
but it is not very convient for end user; it is made for developer.
Nice idea, I’ve been thinking about this as well, except also with WebRTC communication support. I think the webxdc core is pretty simple to implement, especially for just one user. Its JS implementation could be taken from webxdc-dev.
For the actual runtime part, I believe it should be achievable or near-achievable with extensions. You gotta unzip the file with something like jszip, then you can read the files and insert the contents into an iframe. There are code playground extensions like Webmaker, we can look up how they work, although I’m not sure if they’re suitable for running untrusted fiddles.
I have an experimental implementation with PWA (prograssive web app) and service worker.
The advantage of service worker is that the app can rewrite the url and response from any address
with onfetch event, so the relative path in the zip file can work.
The Web Extension can not do this now.
the project:
I have not work on it for a while, and never setup it as a real pwa work on gitlab,
but it should work if you enable service worker in http mode and run it on localhost.
It can play 2048 and some other games.
The most serious issue is that all webxdc app share a same localstorage and indexeddb.
I think we can wrap the window.localStorage and window.indexedDB to overcome this,
and hope the javascript code will not check the idb’s name or bypass the wrapped api.
Another problem I faced is import and export data. import/export localStorage is easy,
but it would be tedious to export a indexed db;
we need to export version, indices and blobs.
(maybe I should not call it a webxdc runtime, since the spec require webxdc runtime to block all connection to internet.)
one of the main advantages of webxdc is the chat-integration part, the possibility to interact with other users in a more secure way not controlled by the app creator, if it is to just run an app offline you can pretty much create a normal desktop app that launches the app in the browser or offline webview for more desktop-like/app-like experience, or just host the app normally and make it work offline after the page is loaded like many other apps do, like pinafore (mastodon client) or the official mastodon web client
by your description you simply don’t want to use webxdc, so why to use the webxdc format for a non-webxdc app and then run it in an emulator that un-webxdc the app
I made something alike to what you did with that project but simpler, with this one there is no problem with the local bases since every app it is opened in a different url, and I had tested some apps and seems to works fine with most of them. But it is not either a WebXDC emulator since it doesn’t have any kind of restrictions on network, and lack of many other things that webxdcs have, it is more like a web-app runner.
The project: Web-App