# Are there any Webxdc runtime which works directly in browser?

**URL:** <https://forum.delta.chat/t/are-there-any-webxdc-runtime-which-works-directly-in-browser/2619>\
**Category:** Mini Apps\
**Created:** [June 19, 2023, 1:03pm UTC](https://forum.delta.chat/t/are-there-any-webxdc-runtime-which-works-directly-in-browser/2619 "2023-06-19T13:03:49Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![gholk](https://forum.delta.chat/letter_avatar_proxy/v4/letter/g/edb3f5/32.png) [@gholk](https://forum.delta.chat/u/gholk)\
**Post date:** [August 7, 2023, 1:36pm UTC](https://forum.delta.chat/t/are-there-any-webxdc-runtime-which-works-directly-in-browser/2619/3 "2023-08-07T13:36:31Z")

</div>

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:

> **[Files · master · gold holk / sword-xdc · GitLab](https://gitlab.com/gholk/sword-xdc/-/tree/master)**
>
> GitLab.com

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.)

---

_[View the full topic](https://forum.delta.chat/t/are-there-any-webxdc-runtime-which-works-directly-in-browser/2619)._
