Closed n457 closed 7 years ago
You may look at this Stackoverflow suggestion : http://stackoverflow.com/questions/31670803/prevent-electron-app-from-redirecting-when-dragdropping-items-in-window
Hey @clementlamoureux, waddup ? ;)
Your link did help to definitely solve this major issue 🎉
The marked answer of the stackoverflow topic wasn't the solution : we need the user to be able to drag & drop elements (like images) from the editor to the editor. the marked answer code prevent that as well.
BUT, the piece of code I needed was :
MainWindow.webContents.on('will-navigate', (Event) => {
Event.preventDefault();
return false;
});
In the main process, it prevent the app from changing its current view.
Thanks a lot.
Now, it creates another minor thing : I need to clear external editor-compatible elements when they're dropped into the editor.
Fine @n457 ! That's the solution :) Great project btw !
Thanks 👍
Drag & drop feature disabled for external assets only due to possible XSS attack through the app & the document.
Dropping external assets in the application open the asset in a new view (webpage) in the app, and triggers the closing event of the app.
Screenshot of the bug :