0

I don't understand why this code always returns false when it passes well in the condition.

function checkTabs(urlTab){
    let res = false;
    chrome.tabs.query({currentWindow: false, active: false}, function(tabs){
        for(var i = 0; i < tabs.length; i++){           
            if(tabs[i].url == urlTab){
                res = true;
                break;
            }
        }
    });

    return res;
}
Xuline
  • 1
  • 1

0 Answers0