Debug Service Worker
  • 24 Oct 2023
  • 2 Minutes to read

    Debug Service Worker


      Article Summary

      Insider Tag integration and service worker integration are required for web pushes to work properly.

      If you are having any issues about receiving no push noti, you should always debug it with a new user on your browser. Your current user may have been cached and it might stop you from having web pushes. You can check your service worker status following these steps:

      1. Create a new profile

      Set up a new profile on your browser. You can quickly create it without connecting it to an account.

      2. Open Browser Console

      Go to your website on the new browser window that appears when you create a new profile. First, you should check the Insider service worker status and whether you have another service worker that interferes with Insider's.

      Your title goes here
      If there is another service worker, it should not conflict with Insider service worker. Two service workers will not work under the same folder. That's why you can add Insider service worker in a subfolder named /insider/.

      Chrome

      Before allowing web push notifications:

      1. Click right to open the browser console on your website and go to Application > Service Workers

      2. Click the Allow button on the opt-in screen to see the Insider service worker (insider-sw-sdk.js) status appear under Service Workers.

      If Insider's service worker functions with no issues, you will see a green icon in the Status. If it does not function properly, the status will be red.

      Firefox

      Before allowing web push notifications, 

      1. Click right to open the browser console on your website and go to Application > Service Workers

      2. Click the Allow button on the opt-in screen and refresh the page to see the Insider service worker (insider-sw-sdk.js) status appear under Service Workers.

      If Insider's service worker functions with no issues, you will see a green icon in the Status. If it does not function properly, the status will be red.

      3. Check Network Requests

      You can also check the status of Insider's service worker under Network.
      Go to the Network tab and type "insider-sw-sdk.js" in the Filter box. You can see the status code in the next column on the results or click on it to see its headers. 

      The status code 200 means that it functions with no issues.

      4. Check Service Worker's Accessibility

      Your service worker file must be accessible through your website as well. If you visit the service worker path on your browser, you should see the following content.

      Your title goes here
      If you have added the service worker file on a subfolder, you should visit that path (e.g. mywebsite.com/insider/insider-sw-sdk.js).


      Was this article helpful?


      ESC

      Eddy, a super-smart generative AI, opening up ways to have tailored queries and responses