Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 将Notificaion.requestPermission()对话框替换为html对话框_Javascript_Html_Browser_Permissions_Notifications - Fatal编程技术网

Javascript 将Notificaion.requestPermission()对话框替换为html对话框

Javascript 将Notificaion.requestPermission()对话框替换为html对话框,javascript,html,browser,permissions,notifications,Javascript,Html,Browser,Permissions,Notifications,我需要向用户请求发送通知的权限,所以我使用此代码 Notification.requestPermission().then(...).catch(...); 这将显示此对话框 但是我想用html中的一个对话框来替换这个对话框,一个像这样的对话框 我搜索了很多次,但没有找到任何可以帮助我的东西。由于安全原因,您无法创建自定义html对话框,其中显示块和允许按钮,但两者的行为都类似于允许

我需要向用户请求发送通知的权限,所以我使用此代码

Notification.requestPermission().then(...).catch(...);
这将显示此对话框

但是我想用html中的一个对话框来替换这个对话框,一个像这样的对话框


我搜索了很多次,但没有找到任何可以帮助我的东西。

由于安全原因,您无法创建自定义html对话框,其中显示块和允许按钮,但两者的行为都类似于允许