Commit f4271a16 authored by Vincent Bechu's avatar Vincent Bechu

[erp5_officejs] Add test serviceWorker in navigator, in bootloader

parent becb33d7
...@@ -141,28 +141,31 @@ sub gadget does not have all aquired Method at this point*/ ...@@ -141,28 +141,31 @@ sub gadget does not have all aquired Method at this point*/
.declareMethod("install", function () { .declareMethod("install", function () {
var gadget = this, var gadget = this,
storage = createStorage(gadget); storage = createStorage(gadget);
return new RSVP.Queue() if (navigator.serviceWorker !== undefined) {
.push(function () { return new RSVP.Queue()
return navigator.serviceWorker.register( .push(function () {
"gadget_officejs_bootloader_serviceworker.js" return navigator.serviceWorker.register(
); "gadget_officejs_bootloader_serviceworker.js"
}) );
.push(function () { })
return storage.repair(); .push(function () {
}) return storage.repair();
.push(undefined, function (error) {
return gadget.changeState({
retry: gadget.state.retry !== undefined ?
gadget.state.retry + 1 : 0,
error: error
}) })
.push(function () { .push(undefined, function (error) {
return RSVP.delay(1000); return gadget.changeState({
retry: gadget.state.retry !== undefined ?
gadget.state.retry + 1 : 0,
error: error
}) })
.push(function () { .push(function () {
return gadget.install(); return RSVP.delay(1000);
}); })
}); .push(function () {
return gadget.install();
});
});
}
return;
}); });
}(window, document, RSVP, rJS, jIO, navigator, URL)); }(window, document, RSVP, rJS, jIO, navigator, URL));
\ No newline at end of file
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>961.19028.47293.9045</string> </value> <value> <string>961.19383.11182.45687</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1502288666.48</float> <float>1502291956.98</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment