File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
packages/signals/signals/src/core/processor Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ export class IframeSandbox implements SignalSandbox {
266266 void window . addEventListener ( 'message' , ( e ) => {
267267 if (
268268 e . source === this . iframe . contentWindow &&
269- e . data === 'iframe_ready '
269+ e . data === 'process_signal_loaded '
270270 ) {
271271 this . iframe . contentWindow ! . postMessage ( {
272272 type : 'init' ,
@@ -298,15 +298,6 @@ export class IframeSandbox implements SignalSandbox {
298298 const runtimeJs = `
299299 ${ processSignalFn ? `window.processSignal = ${ processSignalFn } ` : '' }
300300
301- const signalsScript = document.getElementById('edge-fn')
302- if (typeof processSignal === 'undefined') {
303- signalsScript.onload = () => {
304- window.parent.postMessage('iframe_ready')
305- }
306- } else {
307- window.parent.postMessage('iframe_ready')
308- }
309-
310301 class AnalyticsRuntimeProxy {
311302 constructor() {
312303 this.calls = new Map();
@@ -366,6 +357,17 @@ export class IframeSandbox implements SignalSandbox {
366357 event.source.postMessage({ type: 'execution_error', error: err });
367358 }
368359 }
360+
361+
362+ const signalsScript = document.getElementById('edge-fn')
363+ if (typeof processSignal === 'undefined') {
364+ signalsScript.onload = () => {
365+ window.parent.postMessage('process_signal_loaded')
366+ }
367+ } else {
368+ window.parent.postMessage('process_signal_loaded')
369+ }
370+
369371 });
370372
371373
You can’t perform that action at this time.
0 commit comments