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

216
Visualizações
In this script to mute Spotify ads, why the unmute doesn't work?

I've been searching for an extension to mute (not block) ads on platforms. The following lines are from a script intended to do that on Spotify, but the remute section doesn't work; I tried to use the setSeconds() method after setting it up, but that also failed. Code from GitHub:

var addTitleText = "Spotify";

function checkTabs(tabId, changeInfo, tab) {
    if(tab.url.includes(spotifyUrl) && tab.audible){
        var actionExecuted = false;
        console.log("Inspect Spotify tab change.", tab.title);
        if(tab.title.includes(addTitleText)){
            if(!tab.mutedInfo.muted){
                chrome.tabs.update(tab.id, {muted: true});
                console.log("SOUND OFF");
            }
            actionExecuted = true;
        }
        if(!actionExecuted){            
            chrome.tabs.query({url: "https://open.spotify.com/*"}, function(tabs) {
              chrome.tabs.sendMessage(tabs[0].id, {action: "getSource"}, function(response) {
                checkAnotherAds(response, tabs[0]);
              });
            }); 
        }
    }
};

function checkAnotherAds(source, checkedTab){
    if(source.includes("control-button--disabled")){
        if(!checkedTab.mutedInfo.muted){
            chrome.tabs.update(checkedTab.id, {muted: true});
            console.log("SOUND OFF");
        }
    }else if(source.includes("control-button")){
        if(checkedTab.mutedInfo.muted){
            chrome.tabs.update(checkedTab.id, {muted: false});
            console.log("SOUND ON");
        }
    }
}

async function start() {
    chrome.tabs.onUpdated.addListener(checkTabs);       
}
start();

Any suggestions?

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