Make all webxdc apps web-ready (again) (effortlessly) (with WebRTC) (webxdc-x-web)

Demo

I’m proud to announce a prototype!

To see it in work

  1. Go here (it’s a web version of the Editor app).
  2. When you open the page, the URL will get updated with the room id. Copy it.
  3. Send the copied link to a friend (or simply open it in a new browser tab, in case you have no friends).
  4. Type something - you’ll see the text appear on your friend’s device (or other tab).

To create a new room, simply open the URL without the part after # in a new tab.

Here’s also the Chess app (here’s the original webxdc app’s source code).

How to use

npm install --save-prod git+https://codeberg.org/WofWca/webxdc-x-web.git

Then you’ll probably need to make a separate build process for the web version. Just make sure that the webxdc-x-web/webxdc.js file is executed before any other code that relies on webxdc API, and that’s it. Adding import 'webxdc-x-web/webxdc.js' at the top of your index.js should work.

Limitations

The limitations of this prototype are severe enough to make most current webxdc apps near-unusable.

In short: when you or at least one of the peers closes the tab, it stops working properly.

  • One-time usage.
    It doesn’t handle reconnects well. When you close the tab, everything is lost.
  • Messages are not stored.
    It’s purely peer-to-peer, and there is no dedicated server to store messages. If you close the browser tab, and then someone else joins the room, they won’t receive your messages.

Source code

1 Like