
        if (currentElement && message.remove)
        {
          // Hide the selected element itself if an added blocking
          // filter is causing it to collapse. Note that this
          // behavior is incomplete, but the best we can do here,
          // e.g. if an added blocking filter matches other elements,
          // the effect won't be visible until the page is is reloaded.
          checkCollapse(currentElement.prisoner || currentElement);

          // Apply added element hiding filters.
          contentFiltering.apply({elemhide: true});
        }
        deactivateBlockElement(!!message.popupAlreadyClosed);
        break;
      case "composer.content.clearPreviousRightClickEvent":
        if (!lastRightClickEventIsMostRecent)
          lastRightClickEvent = null;
        lastRightClickEventIsMostRecent = false;
        break;
      case "composer.content.dialogOpened":
        if (window == window.top)
          blockelementPopupId = message.popupId;
        break;
      case "composer.content.dialogClosed":
        // The onRemoved hook for the popup can create a race condition, so we
        // to be careful here. (This is not perfect, but best we can do.)
        if (window == window.top && blockelementPopupId == message.popupId)
        {
          browser.runtime.sendMessage({
            type: "composer.forward",
            payload:
            {
              type: "composer.content.finished",
              popupAlreadyClosed: true
            }
          });
        }
        break;
    }
  });

  if (window == window.top)
    browser.runtime.sendMessage({type: "composer.ready"});

  return true;
}

if (document instanceof HTMLDocument)
{
  // There's a bug in Firefox that causes document_end content scripts to run
  // before document_start content scripts on extension startup. In this case
  // the ext object is undefined, we fail to initialize, and initializeComposer
  // returns false. As a workaround, try again after a timeout.
  // https://bugzilla.mozilla.org/show_bug.cgi?id=1395287
  if (!initializeComposer())
    setTimeout(initializeComposer, 2000);
}


/***/ })
/******/ ]);
//# sourceMappingURL=include.postload.js.map