service-worker

Service worker update delay

不问归期 提交于 2019-12-21 23:33:50
问题 I have a web app that is working and relying on service workers to keep all the cached files in check and to make sure users are on the correct version of the app. Our client is currently wanting the device to check for an update at specific points (When reopening the app) etc, as currently when you open the app it can take up to 5minutes before the device realises its on an outdated version. Am I able to force the device to check the service worker for any new changes instead of waiting for

Why does this code fail to execute 'fetch'?

馋奶兔 提交于 2019-12-21 21:35:26
问题 I'm working on push notifications using service workers. I'm using the XHR(Ajax) approach to get my notification, here is a code snippet of service-worker.js: var API_ENDPOINT = new Request('/getNotification', { redirect: 'follow'}); event.waitUntil( fetch(API_ENDPOINT, {credentials: 'include' }) .then(function(response) { console.log(response); if (response.status && response.status != 200) { // Throw an error so the promise is rejected and catch() is executed throw new Error('Invalid status

Angular Service Worker on the browsers that do not support it

倖福魔咒の 提交于 2019-12-21 17:51:52
问题 Angular team made a great job and introduced service workers support in the version 5. The documentation is quite helpful and I can really see how the things will work right after reading the related articles, however there is one topic that is not covered there. How does this all work in the browsers that do not support service workers. This is what's being said: Your application must run in a web browser that supports service workers. Currently, the latest versions of Chrome and Firefox are

Chrome Service Worker iOS Support

ぃ、小莉子 提交于 2019-12-21 12:18:28
问题 As Apple announced Service Worker support for iOS 11.3 a few months ago, I recently started trying to get a service worker to work on iOS. On Safari it works as expected, after vising the website, it works offline. However, when trying to use the same feature in Chrome, I had intermittent results. Specifically, the service worker would only work every other page refresh, with the original refresh after going offline being one of the ones not working. I know that Chrome on iOS is built on a

Is it possible to track geolocation with a service worker while PWA is not open

血红的双手。 提交于 2019-12-21 12:12:37
问题 Is it possible to read from local storage and track geolocation in PWAs with a service worker while app is not open on phone (in background) So far my research is pointing to no, and I am finding that the PWA needs to be open for location services. Thank you, 回答1: The solution is at hand and has been for some years now as this POC clearly testifies. Unfortunately W3C and lobbyists such as Jake Archibald have fought tooth and nail to prevent it from being made available :-( Why? I know not.

Uncaught (in promise) DOMException: Quota exceeded

隐身守侯 提交于 2019-12-21 08:00:11
问题 I am trying to see the demo of offline status from the below link and I get DOMException: Quota exceeded. https://serviceworke.rs/offline-status_demo.html This error occurs only in chrome. It works fine in firefox without error in firefox. The error occurs in the install event of the service worker. Code from the service worker in posted below for reference. // /serviceworker-cookbook/offline-status/ var CACHE_NAME = 'dependencies-cache'; // Files required to make this app work offline var

Service Worker with Multiple Caches

谁都会走 提交于 2019-12-21 05:34:14
问题 There are numerous examples out there for initializing a service worker with a single cache similar to the following: let cacheName = 'myCacheName-v1'; let urlsToCache = ['url1', 'url2', url3']; self.addEventListener('install', function (event) { event.waitUntil( caches.open(cacheName).then(function (cache) { return cache.addAll(urlsToCache); }).then(function () { return this.skipWaiting(); }) ); }); I wish to initialize multiple caches on my service worker. The motivation is to group assets

navigator.serviceWorker.controller is null until page refresh

亡梦爱人 提交于 2019-12-21 04:09:15
问题 I work with angularjs and use service worker to receive push notification. but navigator.serviceWorker.controller is null until page refresh,and I don't know how to do to solve this problem some code of serviceworker : self.addEventListener('push', pwServiceWorker.pushReceived); self.addEventListener('notificationclick', pwServiceWorker.notificationClicked); // refresh caches self.addEventListener('activate', function (event) { event.waitUntil( caches.keys().then(function (cacheNames) {

PWA add to home screen not showing popup

一曲冷凌霜 提交于 2019-12-21 03:53:16
问题 I implemented PWA for my static site. service worker register successfully and my page is also working in offline as I expected but the real problem is in add to Home screen I included manifest.json with appropriate icons and still, I don't see the add home screen pop up and while trying to push the add to home screen from inspected only i able to see the popup This my site URL: https://www.savesoftinc.com/ Manifest JSON: { "name": "Save Soft", "short_name": "SaveSoft", "start_url": ".",

WKWebView analog of service worker

你。 提交于 2019-12-21 02:34:41
问题 I'm trying to implement part of app with PWA approach, that works fine on Android , but not for iOS . We need to have offline content availability option to update content dynamically (like special offers or so). With service worker we show prompt to update web content. As were mentioned here service workers are not supported within WKWebView (or UIWebView ). So is there analog or alternative solution like smart cache control? Seems like it is possible to store some web content from app and