From e74db02a2f35c32ddd0265f71493682bcd6c1e2d Mon Sep 17 00:00:00 2001 From: Syeda Asra Arshia Qadri Date: Thu, 14 Mar 2019 10:05:02 +0000 Subject: [PATCH] Bug 1469774 - Error this.pageListener is undefined in AboutPrivateBrowsingHandler.jsm r=johannh Differential Revision: https://phabricator.services.mozilla.com/D23295 --HG-- extra : moz-landing-system : lando --- browser/components/about/AboutPrivateBrowsingHandler.jsm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/browser/components/about/AboutPrivateBrowsingHandler.jsm b/browser/components/about/AboutPrivateBrowsingHandler.jsm index a210031e2a39..ff1b8af64721 100644 --- a/browser/components/about/AboutPrivateBrowsingHandler.jsm +++ b/browser/components/about/AboutPrivateBrowsingHandler.jsm @@ -10,6 +10,7 @@ const {RemotePages} = ChromeUtils.import("resource://gre/modules/remotepagemanag const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); var AboutPrivateBrowsingHandler = { + _inited: false, _topics: [ "DontShowIntroPanelAgain", "OpenPrivateWindow", @@ -21,9 +22,13 @@ var AboutPrivateBrowsingHandler = { for (let topic of this._topics) { this.pageListener.addMessageListener(topic, this.receiveMessage.bind(this)); } + this._inited = true; }, uninit() { + if (!this._inited) { + return; + } for (let topic of this._topics) { this.pageListener.removeMessageListener(topic); }