Chrome 扩展监听页面更新

首先在 manifest.json 中声明相关权限,然后在背景页中加入如下代码:

chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
	console.log(tabId + ' ' + tab.url + ' ' + changeInfo.status);
});
posted @ 2022-03-28 22:47  Higurashi-kagome  阅读(313)  评论(0编辑  收藏  举报