Bug 1531838 - Ensure we don't set up twice on any window. r=johannh

Differential Revision: https://phabricator.services.mozilla.com/D26701

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nihanth Subramanya 2019-04-10 22:12:09 +00:00
Родитель d849a2f135
Коммит fb51bfa78f
1 изменённых файлов: 7 добавлений и 2 удалений

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

@ -241,13 +241,18 @@ this.FirefoxMonitor = {
EveryWindow.registerCallback(
this.kNotificationID,
(win) => {
if (this.notificationsByWindow.has(win)) {
// We've already set up this window.
return;
}
this.notificationsByWindow.set(win, new Set());
// Inject our stylesheet.
let DOMWindowUtils = win.windowUtils;
DOMWindowUtils.loadSheetUsingURIString(this.getURL("privileged/FirefoxMonitor.css"),
DOMWindowUtils.AUTHOR_SHEET);
this.notificationsByWindow.set(win, new Set());
// Setup the popup notification stuff. First, the URL bar icon:
let doc = win.document;
let notificationBox = doc.getElementById("notification-popup-box");