olean value capturing if spotlight was displayed
   */
  async showSpotlightDialog(browser, message, dispatch = this.defaultDispatch) {
    const win = browser?.ownerGlobal;
    if (!win || win.gDialogBox.isOpen) {
      return false;
    }
    const spotlight_url = "chrome://browser/content/spotlight.html";

    const dispatchCFRAction =
      // This also blocks CFR impressions, which is fine for current use cases.
      message.content?.metrics === "block" ? () => {} : dispatch;

    // This handles `IMPRESSION` events used by ASRouter for frequency caps.
    // AboutWelcome handles `IMPRESSION` events for telemetry.
    this.sendUserEventTelemetry("IMPRESSION", message, dispatchCFRAction);
    dispatchCFRAction({ type: "IMPRESSION", data: message });

    if (message.content?.modal === "tab") {
      let { closedPromise } = win.gBrowser.getTabDialogBox(browser).open(
        spotlight_url,
        {
          features: "resizable=no",
          allowDuplicateDialogs: false,
        },
        message.content
      );
      await closedPromise;
    } else {
      await win.gDialogBox.open(spotlight_url, message.content);
    }

    // If dismissed report telemetry and exit
    this.sendUserEventTelemetry("DISMISS", message, dispatchCFRAction);
    return true;
  },
};
PK