A custom element that wraps a standard iframe element, providing automatic height resizing based on the content's size and proxying standard iframe attributes.
You don't have to use a separate HTML file. You can also write your HTML inline.
All standard security, loading, and feature-policy iframe attributes are supported and proxied automatically.
The following standard iframe attributes are observed and actively proxied to the inner iframe element.
If you sandbox the iframe and your HTML is inline or is a local file, the sandbox attribute must include allow-same-origin. Otherwise the iframe will not resize.
Chromium based browsers will log an error, "Blocked script execution ..." but a-iframe will work correctly. The error is simply telling you that the sandbox is preventing script execution within the iframe.
If the sandbox also includes allow-scripts, make sure you trust the content (or sanitize it before injecting it into a-iframe).
If both flags are present and the iframe content shares the parent's origin, the iframe's scripts can access window.parent.document. The script can then remove the sandbox attribute from its own iframe element or steal your site's cookies and local storage (XSS).