Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

59
Vistas
clipboardItems.types not containing all data

I'm copying some text from a google doc to the clipboard and inspecting its content.

I've tried inspecting it by using the paste event and by using the clipboard API.

When inspecting with the paste event, it exposes 3 items, but when using the clipboard API, only two items are available.

Here's my code for clipboard API, this only prints two items:

navigator.clipboard.read().then(clipboardItems => {
    for (const clipboardItem of clipboardItems) {

        for (const type of clipboardItem.types) {
            clipboardItem.getType(type).then(blob => blob.text())
                .then(console.log);
        }

    }
})

And here's my code using the paste event. Three items are available.

target.addEventListener('paste', (event) => {
let items = event.clipboardData.items
for(let  i of  items){
if(i.kind==='string'){
i.getAsString(console.log)
}
}
    event.preventDefault();
});

Basically when using the paste event there's a new item of type application/x-vnd.google-docs-document-slice-clip+wrapped. Why doesn't it come up when using clipboard API?

This tool might be helpful to inspect the clipboard.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda