[Replay Bug]: Star Citizen ARK Starmap - stuck on loading
ZheniaZuser opened this issue · 4 comments
https://robertsspaceindustries.com/starmap
using Brave
Can replicate, looks like a replay issue? Moving to ReplayWebpage.
Took a quick look. This may actually be a capture issue under the hood - there is an empty POST request that is being incorrectly recorded as a GET request. However, there may be also additional issues on top of that.
sigh oops. This is the https://robertsspaceindustries.com/api/starmap/bootup
404? Seems to be within the WACZ I made. Unsure about the request type though.
This is fixable but involves not 1 but 2 tricky edge case scenarios:
-
When storing a POST request with no/empty body, ArchiveWeb.page actually just treats it as a GET request, because the body is missing. However, ReplayWeb.page attempts to match it as a POST request. This should be addressed by either changing ArchiveWeb.page, or changing ReplayWeb.page to behave the same way (if no POST data, even though a POST request is made, just treat it as a GET, and not look for &__wb_method=POST query arg).
-
The site uses an
<object>
tag for SVG rendering, however,<object>
tag don't work well with service workers (see: w3c/ServiceWorker#249). The best option is to actually rewrite an<object>
tag to an iframe if the type isimage/svg+xml
. We also want the same behavior for PDFs, already partially implemented. For server side rewriting, can just replace<object>
-><iframe>
if thetype
attribute matches. However, it becomes a bit more tricky when the element is created dynamically and events are added, eg:
const element = document.createElement("object")
element.type = "image/svg+xml";
element.addEventListener("load", ...)
We need a way to create either an <object>
or an <iframe>
based on the object type, but it is set later, so can't determine it in createElement. Replacing the element later is also tricky, as calling code will be pointing to a dead element.
In testing, when forcing all object -> iframe, this works, but this may break other things (eg. if is a flash, etc..). A possible workaround may be to create some intermediate proxy object, and actually create an object or iframe when appendChild() is called...
Just forcing the object to iframe does result in a working replay: