Disable redirection when dragging an image or link
The problem is this:
I am using tinymce editor (not related to the issue) and an external image manager utility. We are using the drag & drop function for users to simply drag and drop an image from the image manager to the tinymce content area.
However, an issue arises when the user inadvertently drags the image outside the content area. The browser opens a link inside the window it was dragged into, losing the shape the user had in front of him.
I am wondering if there is a way to catch this forwarding event in order to disable browser redirection. If you want to see the problem, just start 2 windows and drag the image from one window to another.
The permission can also be html / css, if possible, not necessarily in JS.
a source to share
Use the onbeforeunload event on the body. Basically, it pops up a dialog saying (you specify a line) "Are you sure you want to leave the page?". If they click Cancel, they will stay on the current page. This method is used by StackOverflow itself (among other sites).
a source to share