Chrome 擴展監聽頁面更新

首先在 manifest.json 中聲明相關權限,然後在背景頁中加入如下代碼:

chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
	console.log(tabId + ' ' + tab.url + ' ' + changeInfo.status);
});
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章