Skip to content

Commit f606fd1

Browse files
committed
wip
1 parent 1e43b82 commit f606fd1

File tree

1 file changed

+4
-5
lines changed
  • packages/signals/signals/src/core/processor

1 file changed

+4
-5
lines changed

packages/signals/signals/src/core/processor/sandbox.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,10 @@ export class IframeSandbox implements SignalSandbox {
266266

267267
const doc = this.iframe.contentDocument!
268268
doc.open()
269-
doc.write(this.getIframeInitialDoc(processSignalFn))
269+
doc.write(this.getIframeHTML(processSignalFn))
270270
doc.close()
271271

272-
const runtimeJs = this.getRuntimeJSForIframe(processSignalFn)
272+
const runtimeJs = this.getIframeRuntimeJSForBlob(processSignalFn)
273273
const blob = new Blob([runtimeJs], { type: 'application/javascript' })
274274
const runtimeScript = doc.createElement('script')
275275
runtimeScript.src = URL.createObjectURL(blob)
@@ -292,12 +292,11 @@ export class IframeSandbox implements SignalSandbox {
292292
})
293293
}
294294

295-
private getIframeInitialDoc(processSignalFn?: string): string {
295+
private getIframeHTML(processSignalFn?: string): string {
296296
return [
297297
`<!DOCTYPE html>`,
298298
`<html>`,
299299
`<head>`,
300-
// this could probably also be loaded dynamically (in getRuntimeJS etc)
301300
processSignalFn
302301
? ''
303302
: `<script id="edge-fn" src=${this.edgeFnUrl}></script>`,
@@ -307,7 +306,7 @@ export class IframeSandbox implements SignalSandbox {
307306
].join(',')
308307
}
309308

310-
private getRuntimeJSForIframe(processSignalFn?: string): string {
309+
private getIframeRuntimeJSForBlob(processSignalFn?: string): string {
311310
// External signal processor script
312311
// Inject runtime via Blob (CSP-safe)
313312
return `

0 commit comments

Comments
 (0)