如何在浏览器中自定义推送通知的权限请求弹出窗口? [英] 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
而官方 API 文档没有提供任何关于如何自定义权限请求的线索;我可以生成的唯一请求看起来像那样
whereas official API documentation doesn't provide any clue how to customize permission requests; and the only request I can generate looks like that
如何创建一个不那么难看的弹出窗口?
How can I create a less ugly popup?
推荐答案
点击 House of Bots 网站上的允许"按钮,您将确切地看到他们是如何做到的——他们没有.
Click the Allow button on the House of Bots site and you'll see exactly how they do it--they don't.
您看到的弹出窗口只是普通的 html,没什么特别的.当您点击允许时,它会打开一个要求许可的新窗口,然后您会看到典型的浏览器窗口,就像第二张图片一样.
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.
这篇关于如何在浏览器中自定义推送通知的权限请求弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!