File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,15 @@ const createIframe = () => {
6666
6767 const iframeId = `sb__open-sandbox${ Math . floor ( Math . random ( ) * 100 ) } ` ;
6868 iframe . setAttribute ( 'id' , iframeId ) ;
69+
70+ clearInterval ( interval ) ;
71+ interval = setInterval ( ( ) => {
72+ // Check every second whether the button is still there
73+ if ( ! document . getElementById ( iframeId ) ) {
74+ createIframe ( ) ;
75+ }
76+ } , 1000 ) ;
77+
6978 const link = document . createElement ( 'a' ) ;
7079 setIframeStyle ( iframe ) ;
7180
@@ -94,14 +103,6 @@ const createIframe = () => {
94103 childList : true ,
95104 subtree : true ,
96105 } ) ;
97-
98- clearInterval ( interval ) ;
99- interval = setInterval ( ( ) => {
100- // Check every second whether the button is still there
101- if ( ! document . getElementById ( iframeId ) ) {
102- createIframe ( ) ;
103- }
104- } , 1000 ) ;
105106 } ;
106107
107108 document . body . appendChild ( iframe ) ;
You can’t perform that action at this time.
0 commit comments