私は onUpdate イベントリスナーを使用していますが、ロードが完了する前と後に異なる tabId を取得しています:
chrome.tabs.onCreated.addListener(function(tab){
var i=ta.length;
ta[i]=new Array(5);
chrome.tabs.onUpdated.addListener(function(tid, changeInfo, tabO){
console.log(tid + " " + changeInfo.status);
console.log(tab.id + " " + tabO.title); //tab.id is form onCreated event
if( tid == tab.id && changeInfo.status === "complete" && tabO.title !== "New Tab") {
console.log(tabO.title+"******"+tabO.url);//then do stuff
}
}
}
console.log
>200 loading script_new.js:12
>200 stackoverflow.com/questions/ask script_new.js:13
>200 undefined script_new.js:12
>194 stackoverflow.com/questions/ask script_new.js:13
>200 undefined script_new.js:12
>198 stackoverflow.com/questions/ask script_new.js:13
>200 undefined script_new.js:12
>200 stackoverflow.com/questions/ask script_new.js:13
>200 complete script_new.js:12
>194 Ask a Question - Stack Overflow