Skip to content

Commit e22306b

Browse files
authored
Merge pull request #36 from Fullscript/allow-clipboard-access
Allow clipboard access from the embed app
2 parents 429f0b3 + 16bae2b commit e22306b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/iframe/iframe.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,11 @@ describe("iframe util", () => {
2828
expect(iframe.style.height).toEqual("100%");
2929
});
3030
});
31+
32+
it("returns an iframe with the allow attribute set to clipboard-read and clipboard-write", () => {
33+
return import("./iframe").then(({ createIframe }) => {
34+
const iframe = createIframe(mockSrc) as HTMLIFrameElement;
35+
expect(iframe.allow).toEqual("clipboard-write");
36+
});
37+
});
3138
});

src/iframe/iframe.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ 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";
89
iframe.src = src;
910

1011
return wrapWithLoader(iframe);

0 commit comments

Comments
 (0)