Troubleshoot OneSignal Web Push issues on Chrome, Firefox, Safari, and Android. Fix common service worker, origin, MIME type, and mobile push errors with step-by-step debugging guidance.
OneSignal provides detailed error messages in your browser’s Developer Tools Console when your site has the Web SDK active.
Before troubleshooting, double-check the Web SDK Setup to ensure:
<head>
.Follow the steps below to debug common issues and verify your integration is working properly.
Test in a clean browser profile
Open your website in a new browser profile.
Open browser developer tools
Launch the Developer Console by pressing F12, right-click and selecting “Inspect”, or navigating to View > Developer > JavaScript Console.
Attempt to subscribe and observe errors
Try subscribing to your site and check the Console for errors. Then match the error against the list below for guidance.
Open your browser's developer tools and inspect for errors
[Service Worker Installation] Installing service worker failed TypeError: Failed to register a ServiceWorker for scope (‘https://www.yoursite.com/
’) with script (‘https://www.yoursite.com/...
’): A bad HTTP response code (403) was received when fetching the script.
Example of a service worker installation error
If you see 403 or 404 service worker errors, your service worker files are likely blocked, redirected, or missing.
https://yoursite.com/OneSignalSDKWorker.js
https://yoursite.com/push/onesignal/OneSignalSDKWorker.js
https://yoursite.com/wp-content/plugins/onesignal-free-web-push-notifications/sdk_files/OneSignalSDKWorker.js
See Service Worker Setup Guide to confirm correct setup.
application/javascript
.MIME type error in service worker
Redirect error in console
Site origin mismatch error
Duplicate SDK initialization error
iOS - See Safari Web Push on iOS for requirements.
Android - Web push works automatically on android mobile devices using a supported browser.
Linux armv8l
in the Device column of the “Subscriptions” page.The Site URL set in the Safari Config must be exactly what you see when visiting the site. For example, if you see https://www.yoursite.com
in the browser, then you must add this to the setup field. www and non-www sites are different origins.
Safari 12.1+ created a new rule that users must perform some action on the site before they can get prompted
You must use the Slide Prompt on Safari. This is why the slide prompt always shows before native if you use our Typical Setup.
If you want to use only the native browser prompt, you will need to setup your own trigger to detect a user action. Then call our Web SDK methods to trigger the prompt.
Due to Safari’s custom web push implementation, your site name and icon image are treated as static resources downloaded and stored locally on the user’s computer. New site names and new images are not updated or downloaded.
Unfortunately anyone subscribed with these older resources will need to clear your cache and resetting push permissions and return to the site to resubscribe.
See Clearing your cache and resetting push permissions for more details.
The browser’s developer tools can be used to interact with the web SDK on your webpage and enable logging or easily send test notifications to yourself.
Access the Browser Developer Tools Console
Accessing the developer console
Desktop Debugging:
Android Debugging:
chrome://inspect#devices
in your Desktop Chrome browser.about:debugging
in your Desktop Firefox browser.Enable web SDK logging
You should be able to run commands in the developer tools Console now.
Execute the following code:
You should see undefined
as the result.
If you see:
Uncaught ReferenceError: OneSignal is not defined(…) ReferenceError: OneSignal is not defined
Then OneSignal is not active on your webpage, or you need to switch to the top
frame context (see above screenshot).
Now that our web SDK’s debug logging is enabled, please close the tab and open a new tab to the same page (refreshing the page is not enough to trigger some of our SDK events). You should see a lot of output in the Console.
Console with verbose SDK logs
You can always disable this additional logging by entering this code:
Check if you are subscribed
Run in the Console:
Depending on whether you are subscribed, you should see similar to the below:
Send yourself a test notification
Only if you are subscribed (see above section), you can send yourself a test notification. See Find & Set Test Subscriptions for details.
Note: Please complete these steps in order.
Follow steps 1 - 4 above to try receiving a test notification
Check the Delivery Page in your OneSignal dashboard
If you’re subscribed but you did not receive a test notification, please visit your OneSignal dashboard Delivery Page to view if the test notifications you’ve sent yourself shows at the top.
Use chrome://gcm-internals to check message delivery
If you’re subscribed, did not receive a test notification, but you see the message has been delivered (colored green), please open Chrome to chrome://gcm-internals
.
Click the “Start Recording” button on the top left. Making sure you see “Connection State: CONNECTED”.
Leave this open and send yourself a push (follow step #4 above to send yourself a test notification).
You should see something in the “Receive Message Log” if you got it.
GCM internals logging
Use chrome://serviceworker-internals to debug service worker
Visit chrome://serviceworker-internals
.
Search for Scope: https://your-site.com
.
Click Inspect, or Start -> Inspect, like below. A Chrome Developer Tools popup will appear.
Inspecting the service worker
On the Chrome Developer Tools popup to our service worker, click the Console tab, and run OneSignalWorker.log.trace();
. It should return undefined
. Any messages from our service worker should now appear in this pop.
Capture console output and contact support
Switch back from the service worker’s Dev Tools popup to your main page’s Developer Tools console (the same one used in step 2).
Send yourself another test notification. If you still do not see the notification, review the console output for any new errors or messages.
To share this information with support:
Need help?
Chat with our Support team or email support@onesignal.com
Please include:
We’re happy to help!
Troubleshoot OneSignal Web Push issues on Chrome, Firefox, Safari, and Android. Fix common service worker, origin, MIME type, and mobile push errors with step-by-step debugging guidance.
OneSignal provides detailed error messages in your browser’s Developer Tools Console when your site has the Web SDK active.
Before troubleshooting, double-check the Web SDK Setup to ensure:
<head>
.Follow the steps below to debug common issues and verify your integration is working properly.
Test in a clean browser profile
Open your website in a new browser profile.
Open browser developer tools
Launch the Developer Console by pressing F12, right-click and selecting “Inspect”, or navigating to View > Developer > JavaScript Console.
Attempt to subscribe and observe errors
Try subscribing to your site and check the Console for errors. Then match the error against the list below for guidance.
Open your browser's developer tools and inspect for errors
[Service Worker Installation] Installing service worker failed TypeError: Failed to register a ServiceWorker for scope (‘https://www.yoursite.com/
’) with script (‘https://www.yoursite.com/...
’): A bad HTTP response code (403) was received when fetching the script.
Example of a service worker installation error
If you see 403 or 404 service worker errors, your service worker files are likely blocked, redirected, or missing.
https://yoursite.com/OneSignalSDKWorker.js
https://yoursite.com/push/onesignal/OneSignalSDKWorker.js
https://yoursite.com/wp-content/plugins/onesignal-free-web-push-notifications/sdk_files/OneSignalSDKWorker.js
See Service Worker Setup Guide to confirm correct setup.
application/javascript
.MIME type error in service worker
Redirect error in console
Site origin mismatch error
Duplicate SDK initialization error
iOS - See Safari Web Push on iOS for requirements.
Android - Web push works automatically on android mobile devices using a supported browser.
Linux armv8l
in the Device column of the “Subscriptions” page.The Site URL set in the Safari Config must be exactly what you see when visiting the site. For example, if you see https://www.yoursite.com
in the browser, then you must add this to the setup field. www and non-www sites are different origins.
Safari 12.1+ created a new rule that users must perform some action on the site before they can get prompted
You must use the Slide Prompt on Safari. This is why the slide prompt always shows before native if you use our Typical Setup.
If you want to use only the native browser prompt, you will need to setup your own trigger to detect a user action. Then call our Web SDK methods to trigger the prompt.
Due to Safari’s custom web push implementation, your site name and icon image are treated as static resources downloaded and stored locally on the user’s computer. New site names and new images are not updated or downloaded.
Unfortunately anyone subscribed with these older resources will need to clear your cache and resetting push permissions and return to the site to resubscribe.
See Clearing your cache and resetting push permissions for more details.
The browser’s developer tools can be used to interact with the web SDK on your webpage and enable logging or easily send test notifications to yourself.
Access the Browser Developer Tools Console
Accessing the developer console
Desktop Debugging:
Android Debugging:
chrome://inspect#devices
in your Desktop Chrome browser.about:debugging
in your Desktop Firefox browser.Enable web SDK logging
You should be able to run commands in the developer tools Console now.
Execute the following code:
You should see undefined
as the result.
If you see:
Uncaught ReferenceError: OneSignal is not defined(…) ReferenceError: OneSignal is not defined
Then OneSignal is not active on your webpage, or you need to switch to the top
frame context (see above screenshot).
Now that our web SDK’s debug logging is enabled, please close the tab and open a new tab to the same page (refreshing the page is not enough to trigger some of our SDK events). You should see a lot of output in the Console.
Console with verbose SDK logs
You can always disable this additional logging by entering this code:
Check if you are subscribed
Run in the Console:
Depending on whether you are subscribed, you should see similar to the below:
Send yourself a test notification
Only if you are subscribed (see above section), you can send yourself a test notification. See Find & Set Test Subscriptions for details.
Note: Please complete these steps in order.
Follow steps 1 - 4 above to try receiving a test notification
Check the Delivery Page in your OneSignal dashboard
If you’re subscribed but you did not receive a test notification, please visit your OneSignal dashboard Delivery Page to view if the test notifications you’ve sent yourself shows at the top.
Use chrome://gcm-internals to check message delivery
If you’re subscribed, did not receive a test notification, but you see the message has been delivered (colored green), please open Chrome to chrome://gcm-internals
.
Click the “Start Recording” button on the top left. Making sure you see “Connection State: CONNECTED”.
Leave this open and send yourself a push (follow step #4 above to send yourself a test notification).
You should see something in the “Receive Message Log” if you got it.
GCM internals logging
Use chrome://serviceworker-internals to debug service worker
Visit chrome://serviceworker-internals
.
Search for Scope: https://your-site.com
.
Click Inspect, or Start -> Inspect, like below. A Chrome Developer Tools popup will appear.
Inspecting the service worker
On the Chrome Developer Tools popup to our service worker, click the Console tab, and run OneSignalWorker.log.trace();
. It should return undefined
. Any messages from our service worker should now appear in this pop.
Capture console output and contact support
Switch back from the service worker’s Dev Tools popup to your main page’s Developer Tools console (the same one used in step 2).
Send yourself another test notification. If you still do not see the notification, review the console output for any new errors or messages.
To share this information with support:
Need help?
Chat with our Support team or email support@onesignal.com
Please include:
We’re happy to help!