зеркало из https://github.com/mozilla/pjs.git
Bug 456076: Popup blocker notification has only two options and both are permanent, r=bcombee
This commit is contained in:
Родитель
276c7e93db
Коммит
666cafaef0
|
@ -1799,13 +1799,18 @@ const gPopupBlockerObserver = {
|
||||||
else {
|
else {
|
||||||
var buttons = [
|
var buttons = [
|
||||||
{
|
{
|
||||||
label: bundle_browser.getString("popupButtonAlwaysAllow"),
|
label: bundle_browser.getString("popupButtonAllowOnce"),
|
||||||
accessKey: bundle_browser.getString("popupButtonAlwaysAllow.accesskey"),
|
accessKey: null,
|
||||||
|
callback: function() { gPopupBlockerObserver.showPopupsForSite(); }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: bundle_browser.getString("popupButtonAlwaysAllow2"),
|
||||||
|
accessKey: null,
|
||||||
callback: function() { gPopupBlockerObserver.toggleAllowPopupsForSite(); }
|
callback: function() { gPopupBlockerObserver.toggleAllowPopupsForSite(); }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: bundle_browser.getString("popupButtonNeverWarn"),
|
label: bundle_browser.getString("popupButtonNeverWarn2"),
|
||||||
accessKey: bundle_browser.getString("popupButtonNeverWarn.accesskey"),
|
accessKey: null,
|
||||||
callback: function() { gPopupBlockerObserver.dontShowMessage(); }
|
callback: function() { gPopupBlockerObserver.dontShowMessage(); }
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
@ -1836,6 +1841,30 @@ const gPopupBlockerObserver = {
|
||||||
var showMessage = gPrefService.getBoolPref("privacy.popups.showBrowserMessage");
|
var showMessage = gPrefService.getBoolPref("privacy.popups.showBrowserMessage");
|
||||||
gPrefService.setBoolPref("privacy.popups.showBrowserMessage", !showMessage);
|
gPrefService.setBoolPref("privacy.popups.showBrowserMessage", !showMessage);
|
||||||
Browser.getNotificationBox().removeCurrentNotification();
|
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
|
# Popup Blocker
|
||||||
popupWarning=%S prevented this site from opening a pop-up window.
|
popupWarning=%S prevented this site from opening a pop-up window.
|
||||||
popupWarningMultiple=%S prevented this site from opening %S pop-up windows.
|
popupWarningMultiple=%S prevented this site from opening %S pop-up windows.
|
||||||
popupButtonAlwaysAllow=Always allow
|
popupButtonAllowOnce=Show
|
||||||
popupButtonAlwaysAllow.accesskey=A
|
popupButtonAlwaysAllow2=Always Show
|
||||||
popupButtonNeverWarn=Never tell me
|
popupButtonNeverWarn2=Never Show
|
||||||
popupButtonNeverWarn.accesskey=N
|
|
||||||
|
|
||||||
# XPInstall
|
# XPInstall
|
||||||
xpinstallPromptWarning=%S prevented this site (%S) from asking you to install software on your computer.
|
xpinstallPromptWarning=%S prevented this site (%S) from asking you to install software on your computer.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче