MCPcopy Create free account
hub / github.com/altic-dev/Pilot / getPostMessageConfig

Method getPostMessageConfig

src/lib/picker-injector.ts:203–219  ·  view source on GitHub ↗

* Create a postMessage bridge configuration * * Returns configuration for setting up secure postMessage communication

(allowedOrigin: string = '*')

Source from the content-addressed store, hash-verified

201 * Returns configuration for setting up secure postMessage communication
202 */
203 static getPostMessageConfig(allowedOrigin: string = '*') {
204 return {
205 allowedOrigin,
206 messageTypes: {
207 // Messages FROM iframe TO parent
208 fromIframe: [
209 'component-selected',
210 'picker-ready',
211 'picker-error',
212 'picker-cancelled',
213 'picker-load-error',
214 ],
215 // Messages FROM parent TO iframe
216 toIframe: ['activate-picker', 'deactivate-picker', 'inject-script'],
217 },
218 };
219 }
220
221 /**
222 * Validate a postMessage event

Callers 1

GETFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected