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

203
Views
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
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!