File tree Expand file tree Collapse file tree
packages/mcp/src/renderer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { APP_MESSAGE_TYPE } from '@lemoncode/quickmock-bridge-protocol' ;
22import { createServer , type Server } from 'node:http' ;
33import type { AddressInfo } from 'node:net' ;
4- import { QUICKMOCK_URL } from './app-url.consts' ;
4+ import { QM_APP_ORIGIN , QUICKMOCK_URL } from './app-url.consts' ;
55
66export interface BridgeServer {
77 server : Server ;
@@ -28,6 +28,7 @@ export function startBridgeServer(): Promise<BridgeServer> {
2828function buildBridgeHtml ( ) : string {
2929 const READY = JSON . stringify ( APP_MESSAGE_TYPE . READY ) ;
3030 const RENDER_COMPLETE = JSON . stringify ( APP_MESSAGE_TYPE . RENDER_COMPLETE ) ;
31+ const QM_ORIGIN = JSON . stringify ( QM_APP_ORIGIN ) ;
3132
3233 return /* html */ `<!DOCTYPE html>
3334<html lang="en">
@@ -65,7 +66,7 @@ function buildBridgeHtml(): string {
6566
6667 // Messages coming DOWN from Puppeteer (page.evaluate) → forward to iframe
6768 if (iframe.contentWindow) {
68- iframe.contentWindow.postMessage(event.data, '*' )
69+ iframe.contentWindow.postMessage(event.data, ${ QM_ORIGIN } )
6970 }
7071 })
7172 </script>
You can’t perform that action at this time.
0 commit comments