How to disable “prevent this page from creating additional dialogs”?

前端 未结 6 1539
一个人的身影
一个人的身影 2020-12-02 20:28

I\'m developing a web app that utilises JavaScript alert() and confirm() dialogue boxes.

How can I stop Chrome from showing this checkbox?<

6条回答
  •  眼角桃花
    2020-12-02 21:05

    You should let the user do that if they want (and you can't stop them anyway).

    Your problem is that you need to know that they have and then assume that they mean OK, not cancel. Replace confirm(x) with myConfirm(x):

    function myConfirm(message) {
        var start = Number(new Date());
        var result = confirm(message);
        var end = Number(new Date());
        return (end<(start+10)||result==true);
    }
    

提交回复
热议问题