Skip to content

Commit

Permalink
fix: add MessageEvent origin check for visual editor initialization (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tyiuhc authored Oct 28, 2024
1 parent cccbc72 commit 05c2c38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/experiment-tag/src/messenger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class WindowMessenger {
}>,
) => {
const match = /^.*\.amplitude\.com$/;
if (!match.test(new URL(e.origin).hostname)) {
if (!e.origin || !match.test(new URL(e.origin).hostname)) {
return;
}
if (e.data.type === 'OpenOverlay') {
Expand Down

0 comments on commit 05c2c38

Please sign in to comment.