Bug 1024391 - Fix popup blocking bug (r=felipe)

This commit is contained in:
Bill McCloskey 2014-07-16 23:05:17 -07:00
parent 76cf0a1088
commit 4da3783e52
3 changed files with 14 additions and 11 deletions

View File

@ -540,7 +540,7 @@ var gPopupBlockerObserver = {
// xxxdz this should make the option say "Show file picker" and do it (Bug 590306)
if (!blockedPopup.popupWindowURI)
continue;
var popupURIspec = blockedPopup.popupWindowURI;
var popupURIspec = blockedPopup.popupWindowURI.spec;
// Sometimes the popup URI that we get back from the blockedPopup
// isn't useful (for instance, netscape.com's popup URI ends up

View File

@ -1024,7 +1024,7 @@
this._appendStatusPanel();
if (updateBlockedPopups)
this.mCurrentBrowser.updateBlockedPopups(false);
this.mCurrentBrowser.updateBlockedPopups();
// Update the URL bar.
var loc = this.mCurrentBrowser.currentURI;

View File

@ -595,15 +595,8 @@
</method>
<method name="updateBlockedPopups">
<parameter name="aBlockedPopups"/>
<parameter name="aFreshPopup"/>
<body>
<![CDATA[
this.blockedPopups = aBlockedPopups;
if (aFreshPopup) {
this.blockedPopups.reported = false;
}
var event = document.createEvent("Events");
event.initEvent("DOMUpdatePageReport", true, true);
this.dispatchEvent(event);
@ -842,9 +835,19 @@
<body><![CDATA[
let data = aMessage.data;
switch (aMessage.name) {
case "PopupBlocking:UpdateBlockedPopups":
this.updateBlockedPopups(data.blockedPopups, data.freshPopup);
case "PopupBlocking:UpdateBlockedPopups": {
this.blockedPopups = data.blockedPopups;
for (let i = 0; i < this.blockedPopups.length; i++) {
let scope = Components.utils.import("resource://gre/modules/BrowserUtils.jsm", {});
let uri = scope.BrowserUtils.makeURI(this.blockedPopups[i].popupWindowURI);
this.blockedPopups[i].popupWindowURI = uri;
}
if (data.freshPopup) {
this.blockedPopups.reported = false;
}
this.updateBlockedPopups();
break;
}
case "Autoscroll:Start": {
if (!this.autoscrollEnabled) {
return false;