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

230
Views
Sonidos de notificación de extensiones de Google Chrome que devuelven un error de DOM

Soy un poco nuevo en esto, así que si me falta información pertinente, pido disculpas.

Estoy trabajando en una extensión de Chrome que usa el método setInterval para verificar una API y reproducir un sonido de notificación cuando ocurre un cambio determinado. En este momento me encuentro con el error: DOMException: play() failed because the user didn't interact with the document first

Sé que esto es algo agregado en Chrome para evitar que los videos se reproduzcan automáticamente, solo me pregunto si hay algo que pueda hacer para solucionar esto en el contexto de esta extensión.

content.js :

 url = "https://queue.square-9.com/data/support-page.json"; //let myAudio = new Audio(chrome.runtime.getURL("coin.wav")); var coin = new Audio("coin.wav"); //coin.crossOrigin = "anonymous"; let lastCount = 0; let newCount = 0; setInterval(function () { fetch(url) .then(function (resp) { return resp.json(); }) .then(function (data) { newCount = data.currentQueueCountiOS; console.log(data.currentQueueCountiOS); if (newCount > lastCount) { coin.play(); console.log("New case in queue!"); } lastCount = newCount; }); }, 5000);

manifest.josn :

 { "manifest_version": 2, "name": "Square9 SalesForce Notifications", "version": "1.0.0", "content_scripts": [ { "matches": ["https://na156.lightning.force.com/*"], "js": ["content.js"] } ], "icons": {"128": "icon_128.png"}, "browser_action": { "default_icon": "icon.png", "default_pop": "popup.html" }, "permissions": ["activeTab"], "web_accessible_resources": [ "coin.wav" ] }

Gracias de antemano por cualquier ayuda.

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!