service-worker

How to use a Service Worker With BASIC Authentication (NTLM, Negotiate)

≡放荡痞女 提交于 2021-02-18 07:48:48
问题 I have been trying to use a service worker within a IIS hosted web site that caches some of the static content of the site. The site is an internal application that uses Windows Authentication. I have been able to register and run a service worker without too much hassle, but as soon as I open the caches and start adding files to the cache, the promise fails with an authorisation failure. the returned HTTP result is 401 Unauthorised. This is the usual response for the first few requests until

serviceWorker missing from ReactApp

不羁的心 提交于 2021-02-16 13:08:12
问题 Hi All I realized just recently when CRA(npx create-react-app myapp) , serviceWorker is missing from src folder and instead I noticed reportWebVitals().Is there some update from React that got ride of serviceWorker and replaced it with reportWebVitals ? Or there it is something I am not doing correctly? pls lmk. thank you 回答1: I have the same problem here! I don’t know if I did something wrong. But definitely seems like create-react-app has changed the way that manage service worker. I found

serviceWorker missing from ReactApp

给你一囗甜甜゛ 提交于 2021-02-16 13:06:20
问题 Hi All I realized just recently when CRA(npx create-react-app myapp) , serviceWorker is missing from src folder and instead I noticed reportWebVitals().Is there some update from React that got ride of serviceWorker and replaced it with reportWebVitals ? Or there it is something I am not doing correctly? pls lmk. thank you 回答1: I have the same problem here! I don’t know if I did something wrong. But definitely seems like create-react-app has changed the way that manage service worker. I found

How can I cache external URLs using service worker?

情到浓时终转凉″ 提交于 2021-02-16 05:50:18
问题 I've been playing with the Google Web Starter Kit (https://github.com/google/web-starter-kit) and have got a little progressive web app working but am stuck on one thing: caching static files from external CDNs. E.g. I'm using MDL icons from https://fonts.googleapis.com/icon?family=Material+Icons I can't see a way to cache the request as the service worker only responds to URLs within my app domain. Options I see: 1. Download the file and put it in a vendor folder. Advantages: easy to set up

Clear cache using workbox-expiration in workbox 6.0.2

孤者浪人 提交于 2021-02-11 14:45:20
问题 I wish to make sure to clear all local cache when a new service-worker is loaded by the client. In my app the cache will often hold the old assets in cache even if the service-woker is updated. This causes a lot of unwanted behaviours. I am using webpack v4.41 and workbox v6 to create my service-worker.js . I have read the documentation for workbox-expiration, but still do not understand how to clear the cache manually (the "Advanced Usage" section). app.js const wb = new Workbox('/service

javascript background sync android power button

旧时模样 提交于 2021-02-11 14:24:16
问题 service worker sync will not fire on case in android chrome WHAT IM MISSING ??? Same thing in here: JavaScript Background Sync Stops Working if Page is Loaded/Refreshed while offline unplug usb cable for development (for chrome dev tool) push android home button push power button for sleep (black screen) then i wait 5 minutes (at least) then i push power button for awake then i push myapp to wake app (app is not closed but set to sleep) then i blug in usb cable for debugging then i click some

Service worker Angular 5

情到浓时终转凉″ 提交于 2021-02-11 13:54:00
问题 Service worker doesn't work after deploy to Azure. My json: { "index": "/index.html", "assetGroups": [ { "name": "app", "installMode": "prefetch", "resources": { "files": [ "/index.html" ], "versionedFiles": [ "/*.bundle.css", "/*.bundle.js", "/*.chunk.js" ] } }, { "name": "assets", "installMode": "lazy", "updateMode": "prefetch", "resources": { "files": [ "/assets/**", "favicon.ico" ] } }]} In .angular-cli.json added "serviceWorker": true In app.module.ts added ServiceWorkerModule.register('

beforeinstallprompt does not work on console.log

安稳与你 提交于 2021-02-11 12:52:48
问题 on https://www.zamanha.com/sw.js on self.addEventListener('beforeinstallprompt', (e) => { the console.log() does not work. anyone? 回答1: the answer is in below. but it is very important to put it in the main.js that runs service worker like sw.js. after regissteration of service worker if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/sw.js') } else { console.log('CLIENT: service worker is not supported.'); } this code -----> var deferredPrompt; self.addEventListener(

Continue recording with getDisplayMedia on page after reload

我只是一个虾纸丫 提交于 2021-02-10 14:26:54
问题 I'm recording my screen on a webpage with navigator.mediaDevices.getDisplayMedia . But when I reload the page, it stops. I'd like to automatically continue recording. Is it possible? Maybe I could use the localstorage somehow, that the reloaded page would try to record again, but then the prompt to choose the screen to record appears again, but I'd like to have picked the same screen to record automatically as before, so that the users aren't bothered after every page reload. Is there any way

Debug service worker with Chrome on Android mobile

倖福魔咒の 提交于 2021-02-08 23:38:54
问题 I'm developing a progressive webapp and, in order to make sure it's working on mobile device (and particularly on Chrome for Android as it's 90% of users), I'm trying to test service worker on an Android device. Unfortunaltely, on Chrome for Android , I'm unable to register the service worker : An SSL certificate error occurred when fetching the script. Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID I know service worker needs to be served over HTTPS so I have a self-signed