Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8271983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:59:25+00:00 2026-06-08T06:59:25+00:00

QUESTION How can I detect if a user has checked the box, "prevent this

  • 0

QUESTION

How can I detect if a user has checked the box, "prevent this page from creating additional dialogs"?

WHY It’s a problem

If the user has prevented the appearance of confirm boxes, the function confirm('foobar') always returns false.

If the user cannot see my confirmation dialogue boxes confirm('Are you sure?'), then the user can never perform the action.

CONTEXT

So, I use the code like if(confirm('are you sure?')){ //stuff... }. So an auto-response of false from the browser will prevent the user from ever doing stuff. But, if there was a way to detect that the user has checked the box, then I could execute the action automatically.

I think that if the user has disabled the dialogues, then the function should either throw an error, or return true. The function is meant to confirm an action that the user has requested.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T06:59:26+00:00Added an answer on June 8, 2026 at 6:59 am

    As far as I know, this is not possible to do in any clean way as it’s a browser feature, and if the browser doesn’t let you know then you can’t know.

    However, what you could do is write a wrapper around confirm() that times the response time. If it is too fast to be human then the prompt was very probably suppressed and it would return true instead of false. You could make it more robust by running confirm() several times as long as it returns false so the probability of it being an über-fast user is very low.

    The wrapper would be something like this:

    function myConfirm(message){
        var start = new Date().getTime();
        var result = confirm(message);
        var dt = new Date().getTime() - start;
        // dt < 50ms means probable computer
        // the quickest I could get while expecting the popup was 100ms
        // slowest I got from computer suppression was 20ms
        for(var i=0; i < 10 && !result && dt < 50; i++){
            start = new Date().getTime();
            result = confirm(message);
            dt = new Date().getTime() - start;
        }
        if(dt < 50)
           return true;
        return result;
    }
    

    PS: if you want a practical solution and not this hack, Jerzy Zawadzki’s suggestion of using a library to do confirmation dialogs is probably the best way to go.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have a 404 page that can detect if a user has
Simple question here: How can I detect when I user swipes their finger on
I cannot find a simple example about my question above: how can i detect
My question can be boiled down to, where does the string returned from stringstream.str().c_str()
I know this question can be answered by searching in google. But I have
I apologize before hand if this is an obvious question: can Apache 2.0 +
I asked a question about different testing frameworks yesterday. This question can be found
Simple question: How do I detect that the onscreen keyboard has been displayed on
i am trying to load images from facebook. if a user has set a
This question has been asked many times before but none of the previous ones

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.