Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

135
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda