File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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-read; clipboard-write" ) ;
36+ } ) ;
37+ } ) ;
3138} ) ;
Original file line number Diff line number Diff 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-read; clipboard-write" ;
89 iframe . src = src ;
910
1011 return wrapWithLoader ( iframe ) ;
You can’t perform that action at this time.
0 commit comments