Implementing additional drag and drop, clip/pasteboard source types


I’d like to implement additional drag and drop clipboard/pasteboard data types, when dragging an image from inside an Electron webview, to a different application (e.g. Chrome). I’m looking for advice here: should I try to implement this inside Electron or inside Chromium? It may only be possible in Chromium, if libChromium (or whatever it’s called) does not supply the necessary hooks to customize dragging/clipboard behavior.

Motivation: Images can be dragged from Electron webviews into Google Docs, but they cannot be dragged into Google Hangouts, because Google Hangouts does not support the data types offered in a Chromium-originated image drag. Google Hangouts does however support images dragged from the Finder. So I’d like to mimic the data type contained in a Finder-originated image drag, if possible.


I’m also looking for a way to add additional formats to drag & drop payload to support a legacy windows application. Would be great if the datatransfer object was extended to support arbitrary formats. I wrote a custom node native addon that handles this use case in windows since the legacy drop target is a windows application. I’m looking for a more elegant solution to solve this problem.