Search code examples
htmllocal-storageserver-sent-events

HTML5: Server-Sent-Events and localStorage


Since SSE and localStorage are both HTML5; If a user's browser supports Server-Sent-Events, is there a possibility that the same browser doesn't support localStorage?


Solution

  • Yes, there is always that chance. Browsers can pick and choose which standards and features they want to implement.

    However, in reality, all the browsers that support SSE also support local storage. In particular, you have to find a really old and obscure browser to find one that doesn't support local storage (except Opera Mini, but that does not support SSE either).

    Compare these two:

    https://caniuse.com/#feat=eventsource

    https://caniuse.com/#feat=namevalue-storage