Javascript chrome扩展chrome.tabs.update回调函数选项卡加载状态始终为;“装载”;
我正在尝试通过chrome.tabs.update使用新的URL更新当前选项卡idJavascript chrome扩展chrome.tabs.update回调函数选项卡加载状态始终为;“装载”;,javascript,google-chrome,google-chrome-extension,Javascript,Google Chrome,Google Chrome Extension,我正在尝试通过chrome.tabs.update使用新的URL更新当前选项卡id chrome.tabs.update(tabpid, {url: "https://www.google.com"}, function(tab){ console.log(tab.status);//This is always in loading status console.log("Load Pending");
chrome.tabs.update(tabpid, {url: "https://www.google.com"}, function(tab){
console.log(tab.status);//This is always in loading status
console.log("Load Pending");
if(tab.status == "complete"){
console.log("Load complete");
//Do something
}
});
我想知道选项卡何时完成加载
tab.status始终处于挂起状态…如何知道该选项卡何时通过chrome.tabs.update完成加载
我尝试了chrome.tabs.onupdated.addlistener,它似乎可以和tabid一起工作,但每次用户打开任何选项卡时它都会触发
我只需要回调函数的状态,这是否可行?或者使用调用chrome.tabs.get的简单setInterval,或者使用调用chrome.tabs.get的简单setInterval