зеркало из https://github.com/mozilla/pjs.git
moving most of the popup window abuse check to WindowCreator. bug 166442 r=jag,jst,timeless
This commit is contained in:
Родитель
8667c2c992
Коммит
e14500e398
|
@ -2842,36 +2842,24 @@ GlobalWindowImpl::CheckForAbusePoint ()
|
|||
if (!prefs)
|
||||
return PR_FALSE;
|
||||
|
||||
if (!mIsDocumentLoaded || mRunningTimeout) {
|
||||
PRBool blockOpenOnLoad = PR_FALSE;
|
||||
prefs->GetBoolPref("dom.disable_open_during_load", &blockOpenOnLoad);
|
||||
if (blockOpenOnLoad) {
|
||||
PRInt32 clickDelay = 0;
|
||||
prefs->GetIntPref("dom.disable_open_click_delay", &clickDelay);
|
||||
if (clickDelay) {
|
||||
PRTime now, ll_delta;
|
||||
PRInt32 delta;
|
||||
now = PR_Now();
|
||||
LL_SUB(ll_delta, now, mLastMouseButtonAction);
|
||||
LL_L2I(delta, ll_delta);
|
||||
delta /= 1000;
|
||||
if (delta > clickDelay)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf ("*** Scripts executed during (un)load or as a result of "
|
||||
"setTimeout() are potential javascript abuse points.\n");
|
||||
printf ("*** Scripts executed more than %ims after a mouse button "
|
||||
"action are potential javascript abuse points (%i.)\n",
|
||||
clickDelay, delta);
|
||||
#endif
|
||||
return PR_TRUE;
|
||||
}
|
||||
} else {
|
||||
PRInt32 clickDelay = 0;
|
||||
prefs->GetIntPref("dom.disable_open_click_delay", &clickDelay);
|
||||
if (clickDelay) {
|
||||
PRTime now, ll_delta;
|
||||
PRInt32 delta;
|
||||
now = PR_Now();
|
||||
LL_SUB(ll_delta, now, mLastMouseButtonAction);
|
||||
LL_L2I(delta, ll_delta);
|
||||
delta /= 1000;
|
||||
if (delta > clickDelay)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf ("*** Scripts executed more than %ims after a mouse button "
|
||||
"action are potential javascript abuse points (%i.)\n",
|
||||
clickDelay, delta);
|
||||
#endif
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче