One of the greatest feature of PWA Extension is adding editable Service Worker File.
This adds a big value if you want to customize service worker for your needs.
Follow steps :
- Go to Plugins
- Search for PWA
- You will see : System - PWA Progressive Web App
- Click on to the title and visit plugin admin panel.
- Go to Section / Tab "Extras"
- Find parameter "Add custom js to service worker file" and swith it to "YES"
- New field opens automatically : "Custom JS for Service Worker"
- Add your code to the text area
- Go to up and find parameter "Re-create Service Worker"
- Select "YES"
- Click to "SAVE" and do this one more time to safe the creation
Now your new service worker is ready.
You can check it via URL : https://www.your-site-url-here.com/pwaextension-service-worker.js