erActors("ReportSiteIssueHelper", browsingContext);
          const promises = actors.map(actor => actor.sendQuery("GetLog"));
          const logs = await Promise.all(promises);
          const info = await actors[0].sendQuery("GetBlockingStatus");
          info.hasMixedActiveContentBlocked = !!(
            browsingContext.secureBrowserUI.state &
            Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT
          );
          info.hasMixedDisplayContentBlocked = !!(
            browsingContext.secureBrowserUI.state &
            Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_DISPLAY_CONTENT
          );
          info.isPB = incognito;
          info.log = logs
            .flat()
            .sort((a, b) => a.timeStamp - b.timeStamp)
            .map(m => m.message);
          return info;
        },
      },
    };
  }

  onShutdown(isAppShutdown) {
    this._unregisterActorModule();
  }

  _registerActorModule() {
    resProto.setSubstitution(
      "report-site-issue",
      Services.io.newURI(
        "experimentalAPIs/actors/",
        null,
        this.extension.rootURI
      )
    );
    ChromeUtils.registerWindowActor("ReportSiteIssueHelper", {
      child: {
        moduleURI: "resource://report-site-issue/tabExtrasActor.jsm",
      },
      allFrames: true,
    });
  }

  _unregisterActorModule() {
    ChromeUtils.unregisterWindowActor("ReportSiteIssueHelper");
    resProto.setSubstitution("report-site-issue", null);
  }
};

function getActorForBrowsingContext(name, browsingContext) {
  const windowGlobal = browsingContext.currentWindowGlobal;
  return windowGlobal ? windowGlobal.getActor(name) : null;
}

function gatherActors(name, browsingContext) {
  const list = [];

  const actor = getActorForBrowsingContext(name, browsingContext);
  if (actor) {
    list.push(actor);
  }

  for (const child of browsingContext.children) {
    list.push(...gatherActors(name, child));
  }

  return list;
}
PK