mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 18:41:06 +08:00
FIX
This commit is contained in:
parent
d051e3e56e
commit
d22d2d1059
@ -205,16 +205,16 @@ const getEventSourceUrl = (event: MessageEvent) => {
|
||||
try {
|
||||
return element.contentWindow === event.source;
|
||||
} catch (err) {
|
||||
//
|
||||
// continue
|
||||
}
|
||||
|
||||
const src = element.getAttribute('src');
|
||||
let origin;
|
||||
|
||||
try {
|
||||
({ origin } = new URL(src));
|
||||
} catch (err) {
|
||||
({ origin } = new URL(src, document.location));
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
return origin === event.origin;
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user