We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08776b8 commit b017745Copy full SHA for b017745
index.html
@@ -165,8 +165,19 @@
165
.empty()
166
.append($iframe);
167
168
+ var tries = 0;
169
var sendSources = setInterval(function() {
- $iframe.get(0).contentWindow.postMessage(data, "*");
170
+ // Stop after 10 seconds
171
+ if (tries >= 100) {
172
+ return clearInterval(sendSources);
173
+ }
174
+ tries++;
175
+ var iframe = $iframe.get(0).contentWindow;
176
+ if (iframe) {
177
+ iframe.postMessage(data, "*");
178
+ } else {
179
+ console.warn("Frame is not available");
180
181
}, 100);
182
183
window.addEventListener("message", function() {
0 commit comments