Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Web is a Contender

Surma
September 25, 2015

The Web is a Contender

JSConf EU 2015

Surma

September 25, 2015
Tweet

More Decks by Surma

Other Decks in Technology

Transcript

  1. { "name": "Air Horner", "short_name": "Air Horner", "icons": [{ "src":

    "images/touch/Airhorner_128.png", "type": "image/png", "sizes": "128x128" },{ "src": "images/touch/Airhorner_192.png", "type": "image/png", "sizes": "192x192" }], "start_url": "/?homescreen=1", "display": "standalone", "background_color": "#2196F3", "theme_color": "#2196F3" }
  2. var items = [ '/', '/styles/main.css', '/script/main.js' ]; self.addEventListener('install', function(event)

    { event.waitUntil( caches.open(CACHE_NAME) .then(function(cache) { return cache.addAll(items); }) ); });
  3. self.addEventListener('push', function(event) { var n = new Notification('A Message!’); //

    ... }); self.addEventListener('notificationclick', function(event) { var url = event.notification.data.url; event.waitUntil(clients.openWindow(url)); });