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

587
Views
Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context

I'm trying to copy the results of a game to the clipboard upon completion of the game, but I'm receiving the following error when running in Safari: "Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."

The following function is called when the game is finished, and the clipboard api is called towards the bottom. Every related question I've been able to find has had to do with playing audio, but I'm not sure what applies here. Thanks for any help!

function generateScoreCard () {
let result = ``;
result = result + "Circuit " + GetFormattedDate() + "\n\n";

for( var i=0; i< pastGuesses.length; i++ )
{
  console.log(pastGuesses[i].color)
  switch (pastGuesses[i].color) {
    case '#51ff45':
      result = result + 'โœ…';
      break;
    case '#c1ff4d':
      result = result + '๐ŸŸข';
      break;
    case '#fceb4c':
      result = result + '๐ŸŸก';
      break;
    case '#ffa647':
      result = result + '๐ŸŸ ';
      break;
    case '#ff774a':
      result = result + '๐ŸŸ ';
      break;
    default:
      result = result + '๐Ÿ”ด';
      break;
  }
}

var clip_result = result + " = " + numGuesses;
//await navigator.permissions.query({ name: 'clipboard-read' });
await navigator.clipboard.writeText(clip_result);

}

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!