iliana / before

🩸 Do you remember before? 🩸
https://before.sibr.dev
5 stars 5 forks source link

Also override `EventSource` to send time offset header #16

Closed iliana closed 3 years ago

iliana commented 3 years ago

In #15 we overrode fetch to send a time offset header, permitting separate tabs of Before in the same browser to be pointed at different times. However this does not apply to EventSource, so jumping in a separate tab will result in the game log jumping suddenly when the browser opens a new stream.

This also will impact socket.io from Seasons 2–3 but I have no idea how I'd want to go about fixing that...

cc @alisww

iliana commented 3 years ago

... and I don't see a way to add arbitrary headers to an EventSource, either. https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-dev