I try this code bu't cannot use..
chrome.tabs.onCreated.addListener((tab) => {
// 在新标签页创建时,发送消息到内容脚本
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
const activeTab = tabs[0]
if (activeTab) {
chrome.tabs.sendMessage(activeTab.id, {
action: TabEvent.updateTabList,
tab,
})
}
})
})