From 11037a5d18a10133be72f1e34868bc03aa1fc51b Mon Sep 17 00:00:00 2001 From: pipopotamasu Date: Tue, 17 Jun 2025 10:27:04 -0400 Subject: [PATCH 1/2] allow clipboard access from the embed app --- src/iframe/iframe.spec.ts | 7 +++++++ src/iframe/iframe.ts | 1 + 2 files changed, 8 insertions(+) diff --git a/src/iframe/iframe.spec.ts b/src/iframe/iframe.spec.ts index 1ff6634..0c13a6c 100644 --- a/src/iframe/iframe.spec.ts +++ b/src/iframe/iframe.spec.ts @@ -28,4 +28,11 @@ describe("iframe util", () => { expect(iframe.style.height).toEqual("100%"); }); }); + + it("returns an iframe with the allow attribute set to clipboard-read and clipboard-write", () => { + return import("./iframe").then(({ createIframe }) => { + const iframe = createIframe(mockSrc) as HTMLIFrameElement; + expect(iframe.allow).toEqual("clipboard-read; clipboard-write"); + }); + }); }); diff --git a/src/iframe/iframe.ts b/src/iframe/iframe.ts index 6b80e6c..0ce7398 100644 --- a/src/iframe/iframe.ts +++ b/src/iframe/iframe.ts @@ -5,6 +5,7 @@ const createIframe = (src: string): HTMLElement => { iframe.style.setProperty("width", "100%"); iframe.style.setProperty("height", "100%"); iframe.style.setProperty("border", "none"); + iframe.allow = "clipboard-read; clipboard-write"; iframe.src = src; return wrapWithLoader(iframe); From 16bae2b32316486114f139a708737a3e0a346fbc Mon Sep 17 00:00:00 2001 From: pipopotamasu Date: Tue, 17 Jun 2025 15:40:34 -0400 Subject: [PATCH 2/2] removed 'clipboard-read' --- src/iframe/iframe.spec.ts | 2 +- src/iframe/iframe.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/iframe/iframe.spec.ts b/src/iframe/iframe.spec.ts index 0c13a6c..0a75bb1 100644 --- a/src/iframe/iframe.spec.ts +++ b/src/iframe/iframe.spec.ts @@ -32,7 +32,7 @@ describe("iframe util", () => { it("returns an iframe with the allow attribute set to clipboard-read and clipboard-write", () => { return import("./iframe").then(({ createIframe }) => { const iframe = createIframe(mockSrc) as HTMLIFrameElement; - expect(iframe.allow).toEqual("clipboard-read; clipboard-write"); + expect(iframe.allow).toEqual("clipboard-write"); }); }); }); diff --git a/src/iframe/iframe.ts b/src/iframe/iframe.ts index 0ce7398..3de8f9b 100644 --- a/src/iframe/iframe.ts +++ b/src/iframe/iframe.ts @@ -5,7 +5,7 @@ const createIframe = (src: string): HTMLElement => { iframe.style.setProperty("width", "100%"); iframe.style.setProperty("height", "100%"); iframe.style.setProperty("border", "none"); - iframe.allow = "clipboard-read; clipboard-write"; + iframe.allow = "clipboard-write"; iframe.src = src; return wrapWithLoader(iframe);