SetInterval is not working in Kindle and Kobo Browsers

383 views Asked by At

I want do stream images to my e-ink reader's browser. I have a Kobo Aura H2O and a Kindle Paperwhite.
I have tried multiple mechanics but nothing seems to work, because the browser ignores half of the javascript.
Websockets do not work, setInterval to update the image regularly does not work neither
Are there any Specs of this Browsers to be found? What other alternatives within Javascript are there to test?

2

There are 2 answers

5
Himbeer On BEST ANSWER

The Kindle browser does technically support WebSockets (even on the very first Kindle Touch), however because it's based on a very old version of Webkit, it's the very first version (or one of the first versions, I'm not exactly sure) of the WebSocket spec which is very different from the current one and isn't supported in the majority of Websocket libraries.

I made a very bad patch for the Node ws library here: https://github.com/HimbeersaftLP/ws

Google's pywebsocket also supports it: https://github.com/google/pywebsocket/wiki/WebSocketProtocolSpec

0
jeff On

setInterval actually works, the problem was that I have used es6 instead of es5 js syntax.
Websockets also work with Kobo Browser but not on Kindle