This commit is contained in:
Norbert de Langen 2020-03-27 18:05:41 +01:00
parent d051e3e56e
commit d22d2d1059
No known key found for this signature in database
GPG Key ID: 976651DA156C2825

View File

@ -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;
});