@wixc3/engine-core
Advanced tools
Comparing version 49.3.0 to 49.4.0
@@ -43,4 +43,4 @@ import type { Communication } from '../communication.js'; | ||
export declare function startIframe({ com, iframe, instanceId, src, envReadyPromise }: StartIframeParams): Promise<void>; | ||
export declare function installRunOptionsInitMessageHandler(target: Window, getRunOptionsParams: () => URLSearchParams): () => void; | ||
export declare function installRunOptionsInitMessageHandler(target: Window, callback: (postBack: (params: string) => void) => void): () => void; | ||
export {}; | ||
//# sourceMappingURL=iframe.d.ts.map |
@@ -75,9 +75,10 @@ import { WindowInitializerService } from '../window-initializer-service.js'; | ||
} | ||
export function installRunOptionsInitMessageHandler(target, getRunOptionsParams) { | ||
export function installRunOptionsInitMessageHandler(target, callback) { | ||
function listenForRunOptionsRequest(evt) { | ||
if ('kind' in evt.data && evt.data.kind === RUN_OPTIONS_REQUESTED_KIND && evt.source === target) { | ||
evt.source.postMessage({ | ||
const { source, origin } = evt; | ||
callback((params) => source.postMessage({ | ||
kind: RUN_OPTIONS_PROVIDED_KIND, | ||
runOptionsParams: getRunOptionsParams().toString(), | ||
}, evt.origin); | ||
runOptionsParams: params, | ||
}, origin)); | ||
} | ||
@@ -84,0 +85,0 @@ } |
{ | ||
"name": "@wixc3/engine-core", | ||
"version": "49.3.0", | ||
"version": "49.4.0", | ||
"type": "module", | ||
@@ -18,3 +18,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@wixc3/isomorphic-worker": "^1.2.5", | ||
"@wixc3/isomorphic-worker": "^2.0.0", | ||
"@wixc3/patterns": "^18.0.0", | ||
@@ -21,0 +21,0 @@ "promise-assist": "^2.0.1", |
@@ -134,11 +134,17 @@ import type { Communication } from '../communication.js'; | ||
export function installRunOptionsInitMessageHandler(target: Window, getRunOptionsParams: () => URLSearchParams) { | ||
export function installRunOptionsInitMessageHandler( | ||
target: Window, | ||
callback: (postBack: (params: string) => void) => void, | ||
) { | ||
function listenForRunOptionsRequest(evt: MessageEvent) { | ||
if ('kind' in evt.data && evt.data.kind === RUN_OPTIONS_REQUESTED_KIND && evt.source === target) { | ||
evt.source.postMessage( | ||
{ | ||
kind: RUN_OPTIONS_PROVIDED_KIND, | ||
runOptionsParams: getRunOptionsParams().toString(), | ||
}, | ||
evt.origin, | ||
const { source, origin } = evt; | ||
callback((params) => | ||
source.postMessage( | ||
{ | ||
kind: RUN_OPTIONS_PROVIDED_KIND, | ||
runOptionsParams: params, | ||
}, | ||
origin, | ||
), | ||
); | ||
@@ -145,0 +151,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
465212
7754
+ Added@wixc3/isomorphic-worker@2.0.0(transitive)
- Removed@wixc3/isomorphic-worker@1.2.5(transitive)