We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 429f0b3 + 16bae2b commit e22306bCopy full SHA for e22306b
2 files changed
src/iframe/iframe.spec.ts
@@ -28,4 +28,11 @@ describe("iframe util", () => {
28
expect(iframe.style.height).toEqual("100%");
29
});
30
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
38
src/iframe/iframe.ts
@@ -5,6 +5,7 @@ const createIframe = (src: string): HTMLElement => {
5
iframe.style.setProperty("width", "100%");
6
iframe.style.setProperty("height", "100%");
7
iframe.style.setProperty("border", "none");
8
+ iframe.allow = "clipboard-write";
9
iframe.src = src;
10
11
return wrapWithLoader(iframe);
0 commit comments