I did some digging into identifying the potential cause of the issue.
https://www.roblox.com/js/ServiceWorker/ServiceWorkerRegistrar.js
var installOrUpdate = function () {
var scriptUrl = getPushNotificationsServiceWorkerJsFileLocation();
navigator.serviceWorker.register(scriptUrl, { scope: '/' }).then(function (registration) {
//success
}).catch(function (error) {
//failure
});
};
From using debugging tools, I think Firefox is hitting that empty catch. As for why Roblox has the catch, I believe it’s because when you try to register their service worker:
You get an error that gives you no debug information / line numbers. This code snippet works as expected on Chrome. So, I am unsure where to go from here.
When you press the button to enable push notifcations (PushNotificationRegister.js), the following code is executed:
var subscribe = function (onSuccess, onFailure) {
Roblox.ServiceWorkerRegistrar.register();
navigator.serviceWorker.ready.then(function (serviceWorkerRegistration) {
Roblox.ServiceWorkerRegistrar.register();
is part of the code I linked, and since it never manages to register a service worker, the service worker is never ready and the rest of the subscription code will not run.
I tried Edge which was able to register the service worker, but would always fail with the following error: DOMException: Registration failed - missing applicationServerKey
.
Which is interesting because it does make a request to: https://notifications.roblox.com/v2/push-notifications/chrome-manifest
This might be because only Chrome v52 and below needs a manifest file, Edge and Firefox do not use manifest files, and Roblox is not passing the applicationServerKey as a required parameter to pushManager.subscribe, which would result in that error for Edge and other browsers.
This is the following code Roblox has:
serviceWorkerRegistration.pushManager.subscribe({ userVisibleOnly: true })
(PushNotificationRegistar.js)
To explain why everything doesn’t work:
Firefox → the serviceWorker is never ready, the subscription code is never run, notification panel doesn’t show up.
Edge → the serviceWorker is ready, subscription code is run, subscription code errors (no token), notification panel doesn’t show up.
As for why Firefox fails to register the service worker is anyone’s guess.
More information, when enabling push notifications with chrome you get this warning:
TLDR: Roblox is using gcm_sender_id to authenticate (chrome only) which is deprecated and is going to be removed from Chrome stable.
The push notification system is essentially a ticking time bomb and It’s only a matter of time before it breaks entirely. They need to be using VAPID tokens asap - which is standardized and will support more browsers.
Credit to @tornadus11 for helping discover the Edge issue with me, and assisting with the research process.