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

141
Views
Reading from Clipboard on Chrome Extension returns "pending" Promise

I'm trying to read from the clipboard on my Chrome extension. I'm using the navigator.clipboard.readText() method from the ClipboardAPI to do so (because document.execCommand('paste') is deprecated). However, not only does the method fail to ask for user permission to read from clipboard (as done on regular web apps), but all it returns is a "pending" promise that does not get fulfilled nor rejected.

Here's the code block I'm running on a function. Neither the clipboardString variable nor err variable gets logged on the console. And the method itself returns a promise that remains "pending" forever.

    navigator.clipboard
      .readText()
      .then((clipboardString) => {
        console.log('Clipboard Contains: ', clipboardString);
      })
      .catch((err) => {
        console.log('Clipboard Error: ', err);
      });

Any solutions to this problem? Either what's happening with this pending promise or how to read from clipboard on a Chrome extension? Thank you.

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!