Bug 787236 - Correctly remove "pagehide" listener for ErrorPageEventHandler (r=mfinkle)

This commit is contained in:
Lucas Rocha 2012-08-31 16:36:38 +01:00
parent 2a29cb9531
commit 0678b5879a

View File

@ -2681,10 +2681,12 @@ Tab.prototype = {
// pages have any privilege themselves.
if (/^about:/.test(target.documentURI)) {
this.browser.addEventListener("click", ErrorPageEventHandler, false);
this.browser.addEventListener("pagehide", function listener() {
let listener = function() {
this.browser.removeEventListener("click", ErrorPageEventHandler, false);
this.browser.removeEventListener("pagehide", listener, true);
}.bind(this), true);
}.bind(this);
this.browser.addEventListener("pagehide", listener, true);
}
if (/^about:reader/.test(target.documentURI)) {