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

307
Views
Obteniendo: No detectado (en promesa) TypeError: Algo salió mal al intentar abrir la ventana

Este es mi código en el trabajador de servicio para el evento de clic de notificación. Todos están funcionando bien. Pero este error de consola Uncaught (in promise) TypeError: Something went wrong while trying to open the window. aparece cuando hago clic en el botón de acción.

¿Por qué se muestra este error de la consola?

 self.addEventListener('notificationclick', e => { const nf = e.notification; nf.close(); if (!e.action) { if(nf.data && nf.data.url) { const url = nf.data.url; urltoopen(url,e); } return; } if(e.action === 'close'){ return; } if(nf.data && nf.data.listurl) { const listurl = nf.data.listurl; Object.keys(listurl).forEach((k) => { if(k===e.action) { const actionurl=listurl[k]; urltoopen(actionurl,e); } }); } }); function urltoopen(url,e) { const urlToOpen = new URL(url, self.location.origin).href; const promiseChain = clients.matchAll({ type: 'window', includeUncontrolled: true }) .then((windowClients) => { let matchingClient = null; for (let i = 0; i < windowClients.length; i++) { const windowClient = windowClients[i]; if (windowClient.url === urlToOpen) { matchingClient = windowClient; break; } } if (matchingClient) { return matchingClient.focus(); } else { return clients.openWindow(urlToOpen); } }); e.waitUntil(promiseChain); }
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!