Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

390
Visualizações
Uncaught ReferenceError: Audio is not defined in Chrome Extension JS Script

I'm trying to create a local script that loads a specific page, checks for contents and plays an audio if something is found but as soon as I load the extension in the dev mode it keeps saying "Uncaught ReferenceError: Audio is not defined"...

This is the code of the script:

chrome.tabs.create({ url: "URL"});
var snd = new Audio('https://www.soundjay.com/misc/sounds/bell-ringing-04.mp3');
var res = document.querySelector('[colspan="10"]');
if (res == null) {
 snd.play();
 chrome.tabs.create({ url: "URL"});
 chrome.tabs.getCurrent(function(tab) {
 chrome.tabs.remove(tab.id, function() { });
 });
}

Some explanations: the page I'm loading contains a list of to-do tasks. What I'm doing in the script is simply check if that list exists: if it does than there's no task, if it does not than the alert is played cause there's something to do (I know the logic is upside-down but blame it on the website creator xD).

Any suggestion?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda