I'm working on an HTML project that is targetting BrightSign. It's something that needs to be tolerant to the loss of an Internet connection. I decided to test to see what local caching options I had. I used the following, which just checks to see if the necessary objects exists.
function main() {
$('#supportsServiceWorker').text((navigator.serviceWorker)?'supported':'not supported');
$('#supportsIndexDB').text((window.indexedDB)?'supported':'not supported');
$('#supportsLocalStorage').text((window.localStorage)?'supported':'not supported');
$('#supportsCache').text((window.caches)?'supported':'not supported');
}
The results looked promising. I tried testing the serviceWorker by pointing the BrightSign to a simple web app that calculates sderal time and from what I see the serviceWrorker, while the object shows as existing on the window, is never actually instantiated. You can see it at
https://siderealtimepiece.firebase.com .
I tried to instantiate a cache object and add something to it myself.
var cache;
function cacheTest() {
if(!window.caches)
return;
window.caches.open('cache1')
.then(function (returnedCache) {
cache=returnedCache;
}
}
If I run this on my computer's local browser to validate the code it works fine. When it runs on the BrightSign I find that windows.caches is not null, I am able to make a call to window.caches.open and the promise is fulfilled, but instead of returning a cache object a null object is passed instead.
What's going on here? The presence of a non-null window.caches object with an open method suggest that cache is something that I can use on BrightSign. But the outcome of the above suggest that I cannot?
I am running this on an XT 1143 with firmware version 7.1.65
One of the support pages says that this firmware version is based on Chrome 45. When I look at the CanIUse page for this version of Chrome both
serviceWroker and
cache are shown as supported. Is there something additional that I must do to make them work?