How to process blob data in Electron?

I use Github Electron, which creates my own desktop applications in HTML / JS. I need to process some blob data from the clipboard, but there are only methods for reading text, HTML, images (JPG and PNG) and RTF data. ( http://electron.atom.io/docs/v0.37.3/api/clipboard/ )

I do not mind that I cannot process the BLOB data in any particular way, I just need to be able to store it in a local database and then reload it to the clipboard. I suggested that I can do this with readText and writeText , but I'm not sure if this is possible. For example, when I copy a PSD file and print it using writeText I get 0 bytes.

I see blob data as something other than the formats listed above. So, such things: .psd, .doc, .img, .bin or something with binary data that cannot be read in plain text.

How can I read, store and put this data on the clipboard?

+5
source share
1 answer

In your scenario, I suggest using the Electron API file and save the file path to the clipboard for later use.

0
source

Source: https://habr.com/ru/post/1246212/


All Articles