mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Add simple origin check
This commit is contained in:
parent
265cca240a
commit
ab2fccd147
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue