mirror of
				https://github.com/zulip/zulip-desktop.git
				synced 2025-11-04 05:53:21 +00:00 
			
		
		
		
	security: Code clean up.
This commit is contained in:
		@@ -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();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user