Hacking Chromium for drag-out!


Hey all! First post here. I created an issue on libchromiumcontent that may be interesting to some, and I would greatly appreciate any advice. Sorry for the double posting, but would love to have a few smart eyes on it. If posting this here is against any rules, feel free to reprimand =)

The gist of it: we previously hacked at Chromium to support drag-to-desktop functionality, and would love to switch to Electron, but Chromium code has shuffled around.



For some reason, it wouldn’t let me post the full link in my original post: https://github.com/atom/libchromiumcontent/issues/140


It is spam protection for new users. I fixed it for you :grinning:


Hi Dan,
I notice you closed that issue.

Did you solve to drag an image outside Electron?



I was able to port our node webkit hacks into the newer chromium source, so yup!


Is it ok to share some more informations. I’d like to do the same. Thank you very much.


We actually posted something online somewhere, but I am having trouble tracking it down. I’ll try and find something soon to share.

The gist of it was hooking into a few files where Chromium checks the dragData, and detecting a magic string provided from javascript.


hey quicksnap,
sounds interesting. And i would love to get some more information…? :slightly_smiling:

The best way to handle the drag out that I figured out, is the drag event downloadURL.
Its not that bad. But works only nice for images and pdf.
If I drag-out other files in an application to open that directly, It doesn’t work…
but I need that! :frowning:

I think that is the way how the awesome nylas n1 mailclient deals with that:

But thats not a full solution for me.


For all interested, this is our patch against libchromiumcontent which enables dragging out native files via the ‘dragStart’ event: https://gist.github.com/quicksnap/c30f2219a8e36bd81fe2

Edit: Wrong link posted


Awesome! :slight_smile:
But can you give some information about how to apply that?

Or i’m on the wrong way?