Skip to content

Commit 829156b

Browse files
committed
feat(iframe) Add permissions for local network access
1 parent 566b45f commit 829156b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/iframe/iframe.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ describe("iframe util", () => {
2929
});
3030
});
3131

32-
it("returns an iframe with the allow attribute set to clipboard-read and clipboard-write", () => {
32+
it("returns an iframe with the allow attribute set to clipboard-read, clipboard-write, and local-network-access", () => {
3333
return import("./iframe").then(({ createIframe }) => {
3434
const iframe = createIframe(mockSrc) as HTMLIFrameElement;
35-
expect(iframe.allow).toEqual("clipboard-write");
35+
expect(iframe.allow).toContain("clipboard-write");
36+
expect(iframe.allow).toContain("local-network-access");
3637
});
3738
});
3839
});

src/iframe/iframe.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ const createIframe = (src: string): HTMLElement => {
55
iframe.style.setProperty("width", "100%");
66
iframe.style.setProperty("height", "100%");
77
iframe.style.setProperty("border", "none");
8-
iframe.allow = "clipboard-write";
9-
iframe.allow = "local-network-access"
10-
iframe.src = src;
8+
iframe.allow = "clipboard-write; local-network-access";
119

10+
iframe.src = src;
1211

1312
return wrapWithLoader(iframe);
1413
};

0 commit comments

Comments
 (0)