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
This commit is contained in:
Syeda Asra Arshia Qadri 2019-03-14 10:05:02 +00:00
Родитель 3cce0a0fc6
Коммит e74db02a2f
1 изменённых файлов: 5 добавлений и 0 удалений

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

@ -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);
}