django-webpush icon indicating copy to clipboard operation
django-webpush copied to clipboard

"ReferenceError: Notification is not defined" on Firefox when notifications are disabled

Open marauder37 opened this issue 6 years ago • 1 comments

If a Firefox user has disabled notifications globally by setting dom.webnotifications.enabled:false in prefs (like me!), there will be no Notification object. webpush.js needs to check whether it exists before trying to test its properties.

See also https://miketaylr.com/posts/2017/02/how-not-to-feature-detect.html which helped me work out the problem after a lot of searching. I had forgotten that I disabled notifications.

Thanks!

marauder37 avatar Jan 30 '19 11:01 marauder37

Thanks a lot @marauder37 for the issue! I did not know about it! I will try to fix the issue soon!

safwanrahman avatar Feb 01 '19 20:02 safwanrahman