Bug 1896783 - don't rely on the ReportBrokenSite object existing as a window property, r=twisniewski,pbz,webcompat-reviewers

Unfortunately the addition in browser-siteProtections.js still makes this a
variable on the browser window, but refactoring the contents of that file to
be module-based is a separate effort.

Differential Revision: https://phabricator.services.mozilla.com/D210434
This commit is contained in:
Gijs Kruitbosch
2024-08-14 13:10:41 +00:00
parent a6f6ff1c9a
commit 628fafe237
8 changed files with 18 additions and 11 deletions

View File

@@ -7,6 +7,7 @@
ChromeUtils.defineESModuleGetters(this, {
ContentBlockingAllowList:
"resource://gre/modules/ContentBlockingAllowList.sys.mjs",
ReportBrokenSite: "resource:///modules/ReportBrokenSite.sys.mjs",
SpecialMessageActions:
"resource://messaging-system/lib/SpecialMessageActions.sys.mjs",
});
@@ -1376,6 +1377,8 @@ var gProtectionsHandler = {
if (!this._protectionsPopup) {
let wrapper = document.getElementById("template-protections-popup");
this._protectionsPopup = wrapper.content.firstElementChild;
this._protectionsPopup.addEventListener("popupshown", this);
this._protectionsPopup.addEventListener("popuphidden", this);
wrapper.replaceWith(wrapper.content);
this.maybeSetMilestoneCounterText();