Delay starting no-op service-worker

 I decided to delay my no-op PWA service worker rathen than remove it.


Chrome give a console warning if the service worker fetch listener of a Progressive Web App (PWA) does nothing. Chrome wants you to remove these no-op (no operation) service workers to avoid the time taken to start the listeners.  


But Chrome only recognises the PWA if it has a service worker. Chrome puts an icon in the top right to let you install the PWA.


I delay starting my service worker with a 'setTimeout' of 3 seconds on the page 'load' event.  You do not notice the delay in the PWA icon appearing.


I also delay all my animations. This also means that Google's search, Chrome's Lighthouse and Webaim's Wave accessibility checker do not see the bad color contrast choices of my animations.


There are more tips at: bbingo.xyz/techtips/


Comments

Popular posts from this blog

webkit-tap-highlight-color in CSS

Steve Jobs quotes