I wish to make a fetch call after the push event for fetching the notif data through an internal api with user specific params which are stored in the localstorage or cookie such as usertype or country id .. how do i do this ?
相关问题
- PWAs on iOS 12 no longer shares Service Worker cac
- Are promises lazily evaluated?
- start_url does not respond with a 200 when offline
- Adding a new header to a Request, while preserving
- unable to post message to service worker because c
相关文章
- Checking for service worker updates in a single pa
- Progressive web app(PWA) vs Electron vs Browser ex
- Is there a way to add badge notifications using pr
- Uncaught (in promise) DOMException: Quota exceeded
- Manifest start_url is not cached by a Service Work
- Why does fetch request have to be cloned in servic
- Media Notifications using the Media Session Web AP
- Get page URL parameters from a service worker
You cannot use Local Storage in service workers. It was decided that service workers should not have access to any synchronous APIs. You can use IndexedDB instead, or communicate with the controlled page using
postMessage()
.By default, cookies are not included with
fetch
requests, but you can include them as follows:fetch(url, {credentials: 'include'})
.