This repository has been archived by the owner on Jan 31, 2024. It is now read-only.
spec: web server behavior (index.html
, /
, etc)
#61
Labels
api-change-move-to-forum
this issue proposes an api change which belong in the forum, so it should be summarised an put there
This came up after webxdc/store#158 (comment). Basically the behavior of apps that use things like React/Vue/Solid routers is unreliable (might be broken) because it's not clearly defined how the webxdc web server works.
/
->/index.html
The current webxdc implementations (at least Desktop and Android) open the app in such a way that the initial URL is
/index.html
, not/
. This is because of<iframe src="/index.html"
:https://github.com/deltachat/deltachat-android/blob/3becdf52ecc2623b6d1ad5fd2195a2ee674a2c76/res/raw/webxdc_wrapper.html#L131
https://github.com/deltachat/deltachat-desktop/blob/750721ca5b8e4e9c1c376c95cec470eefefd474c/static/webxdc-preload.js#L108
Replacing
src = "index.html"
withsrc = "/"
should work, as long as the server would respond with the contents ofindex.html
to such a request (currently Delta Chat desktop responds with an error). Most web servers do, like Python's http.I believe this started being the case after the WebRTC patches.
non-existent ->
/index.html
Here are Vue Router docs about how the server needs to be configured for the HTML5 history mode to work properly. It says
Which is a more debatable thing than just the "/" -> "/index.html", but it's also somewhat less common to encounter a situation where it is useful, at least as of now, because currently you can't open a webxdc app with a different initial URL. But you can reload a webxdc app, e.g. in Delta Chat desktop, with Ctrl+R (although currently it would just cause it to get closed because of WebRTC mitigation stuff), which would result in a 404 (or is it a network error instead? should we specify this as well?).
The text was updated successfully, but these errors were encountered: