File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
packages/signals/signals/src/core/processor Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -266,10 +266,10 @@ export class IframeSandbox implements SignalSandbox {
266
266
267
267
const doc = this . iframe . contentDocument !
268
268
doc . open ( )
269
- doc . write ( this . getIframeInitialDoc ( processSignalFn ) )
269
+ doc . write ( this . getIframeHTML ( processSignalFn ) )
270
270
doc . close ( )
271
271
272
- const runtimeJs = this . getRuntimeJSForIframe ( processSignalFn )
272
+ const runtimeJs = this . getIframeRuntimeJSForBlob ( processSignalFn )
273
273
const blob = new Blob ( [ runtimeJs ] , { type : 'application/javascript' } )
274
274
const runtimeScript = doc . createElement ( 'script' )
275
275
runtimeScript . src = URL . createObjectURL ( blob )
@@ -292,12 +292,11 @@ export class IframeSandbox implements SignalSandbox {
292
292
} )
293
293
}
294
294
295
- private getIframeInitialDoc ( processSignalFn ?: string ) : string {
295
+ private getIframeHTML ( processSignalFn ?: string ) : string {
296
296
return [
297
297
`<!DOCTYPE html>` ,
298
298
`<html>` ,
299
299
`<head>` ,
300
- // this could probably also be loaded dynamically (in getRuntimeJS etc)
301
300
processSignalFn
302
301
? ''
303
302
: `<script id="edge-fn" src=${ this . edgeFnUrl } ></script>` ,
@@ -307,7 +306,7 @@ export class IframeSandbox implements SignalSandbox {
307
306
] . join ( ',' )
308
307
}
309
308
310
- private getRuntimeJSForIframe ( processSignalFn ?: string ) : string {
309
+ private getIframeRuntimeJSForBlob ( processSignalFn ?: string ) : string {
311
310
// External signal processor script
312
311
// Inject runtime via Blob (CSP-safe)
313
312
return `
You can’t perform that action at this time.
0 commit comments