Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I know if browser notifications are blocked by Windows

My web app sends browser notifications, and I know how to check the browser permission for the notifications, and how to request permissions if they are not granted. However, even if the user granted permission for my site to send notifications, she might still not get the notifications, because they might be disabled (either globally on Windows, or for the current browser).

Is there a way for me to detect this and let the user know that notifications won't be displayed unless she enables them in Windows Settings?

like image 358
splintor Avatar asked Apr 14 '21 06:04

splintor


People also ask

How do I unblock browser notifications?

On Chrome:Click on the lock icon next to the address bar. Select "Allow" on the dropdown next to "Notifications"

How do I block a website from sending me notifications?

On your computer, open Chrome. Go to the site you are getting notifications from. Select View site information. Next to Notifications, select Block from the drop down menu.

How do I turn off notifications on my browser?

Click on the Chrome menu icon in the top-right corner of your browser (it’s a three-dotted shape) and select Settings. You will find the Privacy and Security option on the window that appears; click on Site Settings under the list of options that appears after selecting Privacy and security. Click on Notifications in the window that appears next.

Why am I getting notifications while browsing the Internet?

If you mistakenly click on “allow” instead of “block” when one of those notifications pop up, you will begin to receive notifications from that website while browsing. Another way some websites get access to start sending you unwanted notifications is through unsuspecting links.

How to block notifications on edge and opera?

Unfortunately, Edge doesn’t have the ability to block all notifications entirely. Step 1: Open an Opera browser window and select the O logo in the top-left corner. Then select Settings from the drop-down menu. Step 2: Select Advanced from the left-hand menu, then select Privacy and security.


Video Answer


1 Answers

There's no way to do!

There's no way to do this, JavaScript doesn't have direct access to Windows to detect settings, or to change in Windows Settings.

I am pretty sure it's made to protect users privacy.

The only affected browsers by Windows Settings are Chromium built browsers.

If you turn Notifications settings off in Windows, Google Chrome and Microsoft Edge (aka Chromium browsers) won't be able to send Notifications while other browsers like Firefox that are built on different engines will be able to send Notifications.

Which means that Google Chrome and Microsoft Edge uses a different way to address notifications:

Google Chrome:

Google Chrome

Microsoft Edge:

Microsoft Edge

While Firefox has a completely different way and UI:

Firefox

Summarize:

JavaScript can't detect whatever Notifications settings is enabled or not in Windows settings. And if Notifications settings are disabled, browsers like Firefox can still send notifications.

like image 156
Kevin M. Mansour Avatar answered Oct 19 '22 13:10

Kevin M. Mansour