Search code examples
javascriptpush-notificationweb-worker

How can I customize a permission request popup for push notifications in a browser?


I see that some websites have a fancy push notification permission request popups like this one

enter image description here

whereas official API documentation doesn't provide any clue how to customize permission requests; and the only request I can generate looks like that

enter image description here

How can I create a less ugly popup?


Solution

  • Click the Allow button on the House of Bots site and you'll see exactly how they do it--they don't.

    The pop-up you see is just plain html, nothing special. When you click allow, it opens a new window that asks for permission, and then you get the typical browser window just like in your second image.