Skip to content

Commit 656b308

Browse files
author
jagdeep sidhu
committed
check origin for non-empty falling back to '*'
1 parent 2d1b1f9 commit 656b308

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

source/scripts/ContentScript/inject/BaseProvider.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,18 @@ export class BaseProvider extends EventEmitter {
322322
// Browser will automatically clean up when user navigates away or closes tab
323323
// This prevents authentication timeouts and provides better UX
324324

325+
const targetOrigin =
326+
window.location.origin && window.location.origin !== 'null'
327+
? window.location.origin
328+
: '*';
329+
325330
window.postMessage(
326331
{
327332
id,
328333
type,
329334
data,
330335
},
331-
window.location.origin
336+
targetOrigin
332337
);
333338
});
334339
}

0 commit comments

Comments
 (0)