Dragging and dropping events in Firefox can prevent a from opening a new window, but dragging in instead of dragging out will open a new window.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
    -sharpbox{
        width: 500px; height: 500px; border: 1px solid black;
    }
</style>
<script>
window.onload = function (){
    var box = document.getElementById("box");

    box.addEventListener("dragenter",function (){
        console.log("");
    },false);

    box.addEventListener("dragover",function (e){
        e.preventDefault();
        e.stopPropagation();;
        console.log("");
    },false);

    box.addEventListener("dragleave",function (e){
        e.preventDefault();
        e.stopPropagation();
        console.log("");
    },false);

    box.addEventListener("drop",function (e){
        e.preventDefault();
        e.stopPropagation();
        console.log("");
    },false);

    a.addEventListener("click",function (e){
        e.preventDefault();
    },false)
};
</script>
</head>
<body>
    <a href="http://www.baidu.com" id="a"></a>
    <div id="box">
        
    </div>
</body>
</html>
Mar.03,2021

I have solved this problem, blocking the default behavior and canceling bubbling in the dragend event of the dragged element will solve this problem

Menu