I'm using GitHub's Electron to build a desktop app. I want to grab the type of the current clipboard contents in order to better use it (eg. if it's HTML then I want to do something different than if it's just text).
Looking at the docs there's no way to check the type, but type is required to properly read it. Is there an easy way to get the type?
Relevant docs.
clipboard.availableFormats()
actually returns the assumed mime-type of the clipboard contents. So, to test for plain text, it's simply plain/text
, for images, something along the lines of image/png
or image/jpeg
is expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With