Rules "prohibit this page from creating additional dialogs"

I am trying to understand the behavior of Firefox regarding the added “obstacles to this page to create additional dialogs” in the dialogs.

Using jquery, add the following listeners:

//html
<input class="testInput" />

//javascript
$('.testInput')
.click(function(){ alert('clicked') })
.keyup(function(){ alert('keyup') })
  • When you click on the input, a warning window appears normally until ~ 13th time.
  • When a key is hit, on the other hand, a second message box already appears with the message "prohibit this page from creating additional dialogs." Actually, it seems something like tiemout, and if I wait like 2 seconds between two keystrokes, the message disappears.

In my informal tests, it 2.works when the warning field is not called from the onclick callback (for example: keyup callback that displays a warning window in response to the ajax action ...)

I use Firefox 9.0.1 under Ubuntu, as far as I know, I have not changed the settings of firefox regarding these thresholds. I guess this happens with any latest version of any browser.

I use the jQuery library, but I do not think it matters here.

My question is: What are the exact rules that trigger this warning in the dialog box?

[change]

Using Chromium / Ubuntu (version 17.0.963.26), the threshold value, apparently, represents only the delay between the two dialog boxes.

You can check it from jsfiddle here (thanks Rory McCrossan)

+5
2

(): . , , SUCCESSIVE_DIALOG_TIME_LIMIT

2614 :

nsGlobalWindow::DialogOpenAttempted()

TimeDuration dialogDuration(TimeStamp::Now() - topWindow->mLastDialogQuitTime);

if (dialogDuration.ToSeconds() < Preferences::GetInt("dom.successive_dialog_time_limit",SUCCESSIVE_DIALOG_TIME_LIMIT)){topWindow->mDialogAbuseCount++;return (topWindow->GetPopupControlState() > openAllowed || topWindow->mDialogAbuseCount > MAX_DIALOG_COUNT);}topWindow->mDialogAbuseCount = 0; return false;}

+6

Firefox, . , .

Firefox nsGlobalWindow.cpp nsGlobalWindow.h ( ). , MAX_DIALOG_COUNT (10) nsGlobalWindow.h SUCCESSIVE_DIALOG_TIME_LIMIT (3 - ). nsGlobalWindow.cpp (mDialogAbuseCount). -, dialogDuration mDialogAbuseCount , , SUCCESSIVE_DIALOG_TIME_LIMIT. AreDialogsBlocked mDialogAbuseCount (), , .

, : , , 10 - .

+1

All Articles