mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-08 16:02:00 +00:00
security: Code clean up.
This commit is contained in:
@@ -1,14 +1,17 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const preventDragandDrop = () => {
|
// This is a security fix. Following function prevents drag and drop event in the app
|
||||||
|
// so that attackers can't execute any remote code within the app
|
||||||
|
// It doesn't affect the compose box so that users can still
|
||||||
|
// use drag and drop event to share files etc
|
||||||
|
|
||||||
|
const preventDragAndDrop = () => {
|
||||||
document.addEventListener('dragover', event => {
|
document.addEventListener('dragover', event => {
|
||||||
console.log(event);
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
document.addEventListener('drop', event => {
|
document.addEventListener('drop', event => {
|
||||||
console.log(event);
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
preventDragandDrop();
|
preventDragAndDrop();
|
||||||
|
|||||||
Reference in New Issue
Block a user