Get clipboard type in Electron

I am using GitHub Electron to create a desktop application. I want to capture the type of the current contents of the clipboard in order to use it better (for example, if it is HTML, then I want to do something different than if it was just text).

Looking at the documents, there is no way to check the type, but it needs a type to read it correctly. Is there an easy way to get a type?

Relevant documents .

+7
javascript electron
source share
1 answer

clipboard.availableFormats() actually returns the intended mime type of clipboard content. So, for checking plain text just plain/text , for images something like the lines image/png or image/jpeg is expected.

+2
source share

All Articles