Bug 456076: Popup blocker notification has only two options and both are permanent, r=bcombee

This commit is contained in:
Mark Finkle 2009-08-12 12:28:51 -04:00
Родитель 276c7e93db
Коммит 666cafaef0
2 изменённых файлов: 36 добавлений и 8 удалений

Просмотреть файл

@ -1799,13 +1799,18 @@ const gPopupBlockerObserver = {
else {
var buttons = [
{
label: bundle_browser.getString("popupButtonAlwaysAllow"),
accessKey: bundle_browser.getString("popupButtonAlwaysAllow.accesskey"),
label: bundle_browser.getString("popupButtonAllowOnce"),
accessKey: null,
callback: function() { gPopupBlockerObserver.showPopupsForSite(); }
},
{
label: bundle_browser.getString("popupButtonAlwaysAllow2"),
accessKey: null,
callback: function() { gPopupBlockerObserver.toggleAllowPopupsForSite(); }
},
{
label: bundle_browser.getString("popupButtonNeverWarn"),
accessKey: bundle_browser.getString("popupButtonNeverWarn.accesskey"),
label: bundle_browser.getString("popupButtonNeverWarn2"),
accessKey: null,
callback: function() { gPopupBlockerObserver.dontShowMessage(); }
}
];
@ -1836,6 +1841,30 @@ const gPopupBlockerObserver = {
var showMessage = gPrefService.getBoolPref("privacy.popups.showBrowserMessage");
gPrefService.setBoolPref("privacy.popups.showBrowserMessage", !showMessage);
Browser.getNotificationBox().removeCurrentNotification();
},
showPopupsForSite: function showPopupsForSite() {
let uri = Browser.selectedBrowser.currentURI;
let pageReport = Browser.selectedBrowser.pageReport;
if (pageReport) {
for (let i = 0; i < pageReport.length; ++i) {
var popupURIspec = pageReport[i].popupWindowURI.spec;
// Sometimes the popup URI that we get back from the pageReport
// isn't useful (for instance, netscape.com's popup URI ends up
// being "http://www.netscape.com", which isn't really the URI of
// the popup they're trying to show). This isn't going to be
// useful to the user, so we won't create a menu item for it.
if (popupURIspec == "" || popupURIspec == "about:blank" ||
popupURIspec == uri.spec)
continue;
let popupFeatures = pageReport[i].popupWindowFeatures;
let popupName = pageReport[i].popupWindowName;
Browser.addTab(popupURIspec, false);
}
}
}
};

Просмотреть файл

@ -36,10 +36,9 @@ alertDownloadsDone=%S has finished downloading
# Popup Blocker
popupWarning=%S prevented this site from opening a pop-up window.
popupWarningMultiple=%S prevented this site from opening %S pop-up windows.
popupButtonAlwaysAllow=Always allow
popupButtonAlwaysAllow.accesskey=A
popupButtonNeverWarn=Never tell me
popupButtonNeverWarn.accesskey=N
popupButtonAllowOnce=Show
popupButtonAlwaysAllow2=Always Show
popupButtonNeverWarn2=Never Show
# XPInstall
xpinstallPromptWarning=%S prevented this site (%S) from asking you to install software on your computer.