Push Notifications Fail from Forge of Empires
-
abnovia last edited by leocg
Opera GX fails to display push notifications from the browser game Forge of Empires, despite permissions being granted and service workers active. The root cause appears to be Opera GX’s strict JSON parsing of PushMessageData, which crashes when the push message is plain text instead of valid JSON.
Details:
Site: https://se1.forgeofempires.com/game/index
Service worker: webPushWorker.js
Notifications: Permission granted manually in browser
GX Control: RAM/CPU/Network limiters disabled
OS: Windows 11
Opera GX: Latest version as of July 2025
Steps to Reproduce:
Visit https://se1.forgeofempires.com/game/index? in Opera GX
Accept notification prompt
Wait for in-game push trigger (or simulate with DevTools → Application → Push)
Observe that no notification is shown, and the following error appears in console:
Uncaught SyntaxError: Failed to execute 'json' on 'PushMessageData': Unexpected token 'T', "Test push "... is not valid JSON
at webPushWorker.js:5:25
Why This Matters:Brave and Chrome handle this gracefully: either the push payload is formatted differently or .json() failures are silently handled.
Opera GX appears to strictly enforce JSON parsing, leading to a crash if the data is just a plain string.
Request:
While the bug ultimately lies in Forge’s service worker, it would be helpful if Opera GX:
Offered a fallback or more forgiving push message handling, or
Surfaced this issue in DevTools warnings, or
Reached out to major sites using push APIs (like Forge) for compliance guidance.
Reproducibility: Always
Impact: Blocks user-facing web push notifications on GX
Workaround: Use Brave or ChromeHappy to provide logs or assist further. Please confirm whether this behavior is intended, or if future builds may soften the error behavior to match other Chromium browsers.
Thanks!