Add simple origin check

This commit is contained in:
Matt Bierner 2022-02-01 12:48:49 -08:00
parent 265cca240a
commit ab2fccd147
No known key found for this signature in database
GPG key ID: 099C331567E11888

View file

@ -319,6 +319,11 @@
});
window.addEventListener('message', e => {
if (e.origin !== window.origin) {
console.error('Dropping message from unknown origin in image preview');
return;
}
switch (e.data.type) {
case 'setScale':
updateScale(e.data.scale);