<p dir="auto">My use case is to better integrate my Electron app into the desktop environment. This includes being able to copy a file to clipboard and paste it to the native OS explorer/finder as well as to drag and drop between the app and the desktop.</p>
<p dir="auto">As of today the closest I can get is by leveraging Chrome's own support for dragging out files to the desktop (<a href="http://www.thecssninja.com/javascript/gmail-dragout" rel="nofollow">http://www.thecssninja.com/javascript/gmail-dragout</a>). However this support seems limited to the OS explorer/finder and does not work to drag something into another application (eg. Sublime).</p>
<p dir="auto">Opening this issue to gather some ideas how to support this kind of feature and maybe other developers have found solutions already?</p>
<p dir="auto">i want to get image file from clipboard.</p>
<p dir="auto">when right-click an image on a web page and copy it, i can get the image file from both browser's <code class="notranslate">onpaste</code> event and <code class="notranslate">clipboard</code> module that electron provided.</p>
<p dir="auto">when it came to <strong>files(images) in finder</strong>, <code class="notranslate">cmd+c</code> copy it, browser's <code class="notranslate">onpaste</code> event can only give you a preview icon of this file.</p>
<p dir="auto">like this:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/2055081/8722431/48302d14-2bf7-11e5-9ec2-e465279aa6db.png"><img src="https://cloud.githubusercontent.com/assets/2055081/8722431/48302d14-2bf7-11e5-9ec2-e465279aa6db.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">i hope electron can give me more power to access clipboard data. but after i look through the api doc of clipboard and native-image, tryed in devtool of electron, the result still the same, i can only get the preview icon of the image.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/2055081/8722485/b69c1c18-2bf7-11e5-85f3-e61a59cf4c46.png"><img src="https://cloud.githubusercontent.com/assets/2055081/8722485/b69c1c18-2bf7-11e5-85f3-e61a59cf4c46.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">how can i access to image data copyed from finder, not from web page?</p>
<p dir="auto">here is some code, paste those code to devtool of electron, copy an image file in finder, back to devtool, press enter.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var clipboard = require('clipboard');
var img = clipboard.readImage('png');
document.body.innerHTML += '&lt;img src=&quot;' +img.toDataUrl()+ '&quot;&gt;';"><pre class="notranslate"><code class="notranslate">var clipboard = require('clipboard');
var img = clipboard.readImage('png');
document.body.innerHTML += '&lt;img src="' +img.toDataUrl()+ '"&gt;';
</code></pre></div>