security: Code clean up.

This commit is contained in:
Akash Nimare
2018-03-22 14:15:19 +05:30
parent 9dde6fb6e4
commit ea6665cd10

View File

@@ -1,14 +1,17 @@
'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 => {
console.log(event);
event.preventDefault();
});
document.addEventListener('drop', event => {
console.log(event);
event.preventDefault();
});
};
preventDragandDrop();
preventDragAndDrop();