I am reading the Web notification API and I want to send notification like they are on iOS or Android (ex: You have 7 new messages
).
Considering I have accepted notification from www.my-foobar-super-site.com
, can I, after authorizing notification from it, can my website send Web notification to a user when this user has no tabs open of this website?
After accepting web notifications, can a website send notifications when browser has no tab open of this website?
Yes, but there's more to it than just a user granting the notifications permission.
The Web Notifications API is only concerned with displaying messages on-screen from a script already running on the user's computer, it is unrelated to "push notifications" or delivery.
To send "push" messages to a user's browser, you'll need to use the separate Push API - and run a Service Worker to receive messages from your service (via the Push API) and only then can your script use the Notifications API to show the notification message.