rame.contentWindow.location.href === "about:blank") return;
    const duplicates = document.getElementsByName(frame.name);

    document
      .querySelector(frame.name)
      ?.replaceWith(...frame.contentDocument.body.childNodes);

    // Workaround to Chrome bug:
    // Chrome can't handle iframes being inside the replaced target, but Firefox can.
    // Since the HTML rewriter inserts the matching iframe outside the target,
    // we remove the old one
    duplicates.forEach((dupe) => dupe.remove());
  