//This is the "Offline copy of pages" service worker//Add this below content to your HTML page, or add the js file to your page at the very top to register service worker if (navigator.serviceWorker.controller) { console.log('[PWA Builder] active service worker found, no need to register') } else { //Register the ServiceWorker navigator.serviceWorker.register('pwabuilder-sw.js', { scope: './' }).then(function(reg) { console.log('Service worker has been registered for scope:'+ reg.scope); }); }//This is the "Offline copy of pages" service worker//Install stage sets up the index page (home page) in the cache and opens a new cache self.addEventListener('install', function(event) { var indexPage = new Request('index.html'); event.waitUntil( fetch(indexPage).then(function(response) { return caches.open('pwabuilder-offline').then(function(cache) { console.log('[PWA Builder] Cached index page during Install'+ response.url); return cache.put(indexPage, response); }); })); });//If any fetch fails, it will look for the request in the cache and serve it from there first self.addEventListener('fetch', function(event) { var updateCache = function(request){ return caches.open('pwabuilder-offline').then(function (cache) { return fetch(request).then(function (response) { console.log('[PWA Builder] add page to offline'+response.url) return cache.put(request, response); }); }); };event.waitUntil(updateCache(event.request));event.respondWith( fetch(event.request).catch(function(error) { console.log( '[PWA Builder] Network request Failed. Serving content from cache: ' + error );//Check to see if you have it in the cache //Return response //If not in the cache, then return error page return caches.open('pwabuilder-offline').then(function (cache) { return cache.match(event.request).then(function (matching) { var report = !matching || matching.status == 404?Promise.reject('no-match'): matching; return report }); }); }) ); })

Playstation

ace-combat-7

Ace Combat 7: Skies Unknown E3 trailer looks promising!

The aerial action game Ace Combat 7: Skies Unknown will be out in 2018 for PS4, PC, and Xbox One. Here's the E3 trailer...

Assassin’s creed origins leaked preorder card!

A leaked Target pre-order card for Assassin's creed's newest installment, AC : Origins. The image leaked on imgur and it confirms the speculations about an...
Project Cars 2

Project Cars 2 will be coming to Xbox One and PC this September

Slightly Mad Studio and Bandai Namco today announced the dates of the sequel of community-assisted racing simulator Project CARS. Named Project Cars 2, the game...
Need for Speed Payback

New Need for Speed game trailer revealed, coming on 10th November

EA and Ghost Games today confirmed the latest installment of Need for Speed and it will be called Need for Speed Payback. The latest edition of game will debut on
extinction-ogre-fight

Extinction gets announcement trailer!

The announcement trailer of Iron Galaxy and Maximum Games' Extinction makes it look like a combination of absolute blade-wielding skills of Dishonored and fluid free-run elements...

Perception to be delayed on PS4 and Xbox by a week!

Perception, by the Indie developer The Deep End Games puts you in the shoes of a blind protagonist. In the first person narrative, you...

Follow us to stay updated

144FansLike
7FollowersFollow
48FollowersFollow