Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

132
Views
Retrieve screenshot as file from clipboard via JS

With JS, one can loop though the clipbard data items to check if the type of the item is an image, as follows:

...

var items = pasteEvent.clipboardData.items;

for (var i = 0; i < items.length; i++) {
    if (items[i].type.indexOf("image") === -1) {
        return false;
    }

var blob = items[i].getAsFile();

...

But this only works when I copy the file from the system. Instead, using the "Copy screenshot to clipboard" functionality, it won't work.

The item type in that case is called "MULTIPLE".

Do you know if there is a way to get the image as blob if it's coming from "Copy screenshot to clipboard"?

Note that I am testing this on Manjaro Linux with the preinstalled screenshot app. I don't know if the screenshot lives in the clipboard in a different format using other OS or Apps.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!