gpt4 book ai didi

javascript - 如何防止谷歌浏览器抑制对话框?

转载 作者:数据小太阳 更新时间:2023-10-29 05:21:28 27 4
gpt4 key购买 nike

当我尝试使用 prompt() 命令时,如何防止 Chrome 控制台出现以下错误?

A window.prompt() dialog generated by this page was suppressed because this page is not the active tab of the front window. Please make sure your dialogs are triggered by user interactions to avoid this situation. https://www.chromestatus.com/feature/5637107137642496

直到 2-3 天前,prompt() 命令工作正常,会打开一个对话框,我可以在其中输入数据,现在它总是给我这个错误,即使我肯定在事件选项卡上。我检查了 Chrome 内容设置并选中了允许弹出窗口。

谢谢!

最佳答案

此处的错误行为是因为,在使用开发人员工具进行调试时,开发人员工具窗口实际上是事件窗口。解决方法是使用呈现在实际正在调试的选项卡上的播放或步骤按钮,如下所示。

enter image description here

关于javascript - 如何防止谷歌浏览器抑制对话框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43901822/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com