Remove duplicates from the menu to manually show blocked popups. Also limit the menu to 100 entries max.
bug 235454, r=danm, sr=jag git-svn-id: svn://10.0.0.236/trunk@153438 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -2154,6 +2154,21 @@ function onPopupBlocked(aEvent) {
|
||||
browser.popupUrls = [];
|
||||
browser.popupFeatures = [];
|
||||
}
|
||||
// Check for duplicates, remove the old occurence of this url,
|
||||
// to update the features, and put it at the end of the list.
|
||||
for (var i = 0; i < browser.popupUrls.length; ++i) {
|
||||
if (browser.popupUrls[i].equals(aEvent.popupWindowURI)) {
|
||||
browser.popupUrls.splice(i, 1);
|
||||
browser.popupFeatures.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Limit the length of the menu to some reasonable size.
|
||||
// We only add one item every time, so no need for more complex stuff.
|
||||
if (browser.popupUrls.length >= 100) {
|
||||
browser.popupUrls.shift();
|
||||
browser.popupFeatures.shift();
|
||||
}
|
||||
browser.popupUrls.push(aEvent.popupWindowURI);
|
||||
browser.popupFeatures.push(aEvent.popupWindowFeatures);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user