From b4a83e15f952824c34ff9ba1c4401db42807799a Mon Sep 17 00:00:00 2001 From: raon0211 Date: Mon, 12 Apr 2021 18:21:56 +0900 Subject: [PATCH] fix url --- lib/channel-postmessage/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/channel-postmessage/src/index.ts b/lib/channel-postmessage/src/index.ts index e696faba588..8f97f1359f5 100644 --- a/lib/channel-postmessage/src/index.ts +++ b/lib/channel-postmessage/src/index.ts @@ -231,8 +231,8 @@ const getEventSourceUrl = (event: MessageEvent) => { if (frame && remainder.length === 0) { const src = frame.getAttribute('src'); - const { origin, pathname } = new URL(src, document.location); - return origin + pathname; + const { protocol, host, pathname } = new URL(src, document.location); + return `${protocol}//${host}${pathname}`; } if (remainder.length > 0) {