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

58
Views
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
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!