增加是否自动插入字幕列表选项

This commit is contained in:
IndieKKY
2024-10-04 21:45:47 +08:00
parent a02825b3eb
commit 38baf571b7
7 changed files with 97 additions and 38 deletions

View File

@@ -61,6 +61,16 @@ class ExtensionMessage {
})
}
broadcastMessageExact = async (tabIds: number[], target: string, method: string, params?: any) => {
for (const tabId of tabIds) {
try {
await chrome.tabs.sendMessage(tabId, {target, method, params})
} catch (e) {
console.error('send message to tab error', tabId, e)
}
}
}
broadcastMessage = async (ignoreTabIds: number[] | undefined | null, target: string, method: string, params?: any) => {
const tabs = await chrome.tabs.query({
discarded: false,