diff --git a/src/iframe/iframe.spec.ts b/src/iframe/iframe.spec.ts index 0a75bb1..03f18e8 100644 --- a/src/iframe/iframe.spec.ts +++ b/src/iframe/iframe.spec.ts @@ -29,10 +29,11 @@ describe("iframe util", () => { }); }); - it("returns an iframe with the allow attribute set to clipboard-read and clipboard-write", () => { + it("returns an iframe with the allow attribute set to clipboard-read, clipboard-write, and local-network-access", () => { return import("./iframe").then(({ createIframe }) => { const iframe = createIframe(mockSrc) as HTMLIFrameElement; - expect(iframe.allow).toEqual("clipboard-write"); + expect(iframe.allow).toContain("clipboard-write"); + expect(iframe.allow).toContain("local-network-access"); }); }); }); diff --git a/src/iframe/iframe.ts b/src/iframe/iframe.ts index 3de8f9b..9113b44 100644 --- a/src/iframe/iframe.ts +++ b/src/iframe/iframe.ts @@ -5,7 +5,8 @@ const createIframe = (src: string): HTMLElement => { iframe.style.setProperty("width", "100%"); iframe.style.setProperty("height", "100%"); iframe.style.setProperty("border", "none"); - iframe.allow = "clipboard-write"; + iframe.allow = "clipboard-write; local-network-access"; + iframe.src = src; return wrapWithLoader(iframe);