Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updates to API changes

  • Loading branch information...
commit f42d754ceca064c2cf028fe9de3f597a9cf97d53 1 parent f270440
@jakearchibald jakearchibald authored
View
10 examples/single-page-app/cdn.example.com/all-v1.js
@@ -1,13 +1,13 @@
// set up the controller
-if (navigator.registerController) {
- navigator.registerController("/*", "/ctrl.js");
+if (navigator.registerServiceWorker) {
+ navigator.registerServiceWorker("/*", "/ctrl.js");
- navigator.addEventListener('controllerreloadpage', function(event) {
+ navigator.addEventListener('serviceworkerreloadpage', function(event) {
// singlePageApp is just something I made up
if (singlePageApp.interactedWith) {
- event.waitUntil(new Promise(function(resolver) {
+ event.waitUntil(new Promise(function(resolve, reject) {
var updateBanner = new singlePageApp.UpdateBanner();
- updateBanner.okButton.addEventListener('click', resolver.resolve.bind(resolver));
+ updateBanner.okButton.addEventListener('click', resolve);
updateBanner.show();
}));
}
View
2  examples/single-page-app/example.com/ctrl.js
@@ -21,7 +21,7 @@ this.oninstalled = function(event) {
'/'
]));
- event.waitUntil(Promise.every.apply(Promise,
+ event.waitUntil(Promise.all(
caches.values().map(function(x) { return x.ready(); })
)).then(function() {
if (event.previousVersion) {
Please sign in to comment.
Something went wrong with that request. Please try again.