Changing Notification permissions for a given website?

Hi there,
I’m trying to change the Notification permissions for a given website.
I was able to fetch the current permission via:
const result = await browser.tabs.executeScript(tabId, {code:'Notification.permission'});

I’m not sure however how to set the Notification permission for a given website…?

Thanks a lot in advance!


The ‘permission’ property is read-only. It indicates the current permission granted by the user.

Only the user can change this permission. The user prompt can be shown via

Is there a way to temporarily block Notifications coming from a specific tab (programmatically, of course)?

Sure, you can overwrite the notification APIs and ignore the calls. Note that this does not work for service workers.

Example content script that intercepts the notification APIs: