I want to add to my extension functionality that prevents all websites from its own list form asking about "show notifications" or "record audio" stuff.
There is an API in JS - https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API - it allows you to track notifications created by you. But not existing ones.
I'm talking about in-browser notifications, that asked when you entering website like here: https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API - Just to be clear.
So basically idea was to replace "master Object" of notifications api with something homemade, so when it called, it just won't be created.
We can't manipulate this window with notification anyhow from outside script, that created it, right?
There is a setting for chrome extension, that executes its scripts before page downloaded - I haven't tried it yet, but I believe there will not be any different results.
As I tested in mozilla's example, I rewrote initial API object before notification showed at screen, I believe, you have no access to "global" script from extension's ones.
So am I missing something or it's impossible to forbid some fun websites to show notifications to you? Why then? Chrome allow you to it manually anyway. Some automation would be appreciated by me.