Search code examples
htmlairwebkitlocal-storagesamsung-smart-tv

Webkit support for local storage on Samsung TV browser


I'm porting a HTML-based app to a Samsung smart TV. The app uses local storage to keep preferences, etc.. Local storage appears to be supported and data is persistent while the browser is open. But, once the browser is exited ... poof! the data is gone. Other data like sessions and cookies do persist.

I use the Lawnchair library in the app and have also tested using jStorage. Neither persist beyond closing of the browser.

The browser (or browser component) on the TV is webkit build 534.7. From playing with the browser, I suspect it is actually written in Adobe Air.

I have also tested the Air browser component on my PC, which is build 533.19.4 of webkit. This doesn't appear to support local storage at all.

Chrome on my PC, build 535.19 of webkit, works fine in all my tests.

So, where does the blame lie here: is it the webkit build, the implementation of webkit in Adobe Air, or the TV? Can anyone offer a fix or a suggestion for work around?

Thanks.


Solution

  • Unfortunately I don't have 2012 model so I can't check if the HTML5 localStorage is working or not.

    But I have workaround for you which will be backward compatible with previous TV sets' models also, as 2010 and 2011 models use Maple browser: http://www.samsungdforum.com/Guide/View/Developer_Documentation/Samsung_SmartTV_Developer_Documentation_3.1/API_Reference/JavaScript_APIs/File_API

    1. Serialize your data object
    2. Save it using File API to application directory
    3. And every time you open the app open this file and unserialize data.

    This will work for sure!