1

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?

jeff
  • 1,169
  • 1
  • 19
  • 44

2 Answers2

1

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

Himbeer
  • 141
  • 1
  • 3
  • 9
  • 1
    Thanks! I use a dart server (because it's inside a Flutter app) do you know which specs are used, may be I can implement them in dart too – jeff May 30 '20 at 05:50
  • Do you maybe have a good source with kindle specs? Because I had another problem, trying to update src in , which didn't work – jeff May 30 '20 at 05:52
  • The WS specs used are I think https://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00 for a bad sample implementation you can see my GitHub repo linked in the answer. To test your implementation I recommend using https://github.com/google/pywebsocket/blob/master/example/echo_client.py from the Google Repo with the argument --protocol-version=hybi00 – Himbeer May 30 '20 at 10:45
  • For general browser specs I sadly don't know, you could try looking at the user agent for the webkit version or run a generic browser compatibility tester. Generally, to test the websites I build for the Kindle I usually just use Internet Explorer (sometimes with emulation set to IE 10). – Himbeer May 30 '20 at 10:46
  • Changing the src of an img definitely works: Title – Himbeer May 30 '20 at 10:47
0

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

jeff
  • 1,169
  • 1
  • 19
  • 44