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

252
Views
obteniendo un error al intentar reproducir audio desde la URL en la extensión de Chrome

Probé muchas formas de reproducir un sonido desde la URL, pero no funciona.

Cuando inspeccioné la página tengo errores en la consola:

chrome-extension://invalid/:1 OBTENER chrome-extension://invalid/ net::ERR_FAILED

No capturado (en promesa) DOMException: no se pudo cargar porque no se encontró una fuente compatible.

manifiesto.json:

 "options_page": "./html/content.html", "permissions": [ "activeTab", "storage", "contextMenus", "http://*/*", "https://*/*", "tabs" ], "web_accessible_resources": [ "*.mp3", "*.ogg" ]

Estoy haciendo esto en options_page que es content.html. También le he dado permiso a 'web_accessible_resources' para el script, pero aún no he tenido éxito. Todos los enlaces de audio se almacenan en Chrome Storage.

Script que se adjunta en content.html:

 document.addEventListener('click', function (e) { e.preventDefault(); if (e.target.matches('.audioBtn')) { chrome.storage.local.get({ meanifyWords: [] }, (result) => { let getWordsObj = result.meanifyWords; let getAudio = getWordsObj[e.target.id].audio; //getAudio="//ssl.gstatic.com/dictionary/static/sounds/20200429/experience--_gb_1.8.mp3" let sound = new Audio(getAudio); sound.play(); }) } });

Indíqueme cualquier cambio en el código anterior que resuelva este problema. Gracias por adelantado.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Agregar esquema a la URL:

 let getAudio = "https:" + getWordsObj[e.target.id].audio;
about 4 years ago · Juan Pablo Isaza Report
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!