# `Shopifex.Plug.LoadInIframe`
[🔗](https://github.com/ericdude4/shopifex/blob/main/lib/shopifex/plug/load_in_iframe.ex#L1)

Allows the response to render inside the Shopify admin iframe.

Phoenix's `put_secure_browser_headers/2` blocks cross-origin framing twice:
with `x-frame-options` and, since Phoenix 1.8, with a `frame-ancestors 'self'`
directive in its default `content-security-policy`. Browsers enforce every
CSP header on a response, so leaving that directive in place blocks the admin
even when `Shopifex.Plug.SetCSPHeader` adds its own policy alongside it.

This plug deletes `x-frame-options` and drops the `frame-ancestors` directive
from each `content-security-policy` header, keeping the policy's other
directives (such as `base-uri 'self'`). A header left with no directives is
removed. Pipe through `Shopifex.Plug.SetCSPHeader` (the `:shopify_embedded`
pipeline) afterwards to restrict framing to the Shopify admin.

# `call`

# `init`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
