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

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

@@ -1,6 +1,6 @@
import {v4} from 'uuid'
import {handleTask, initTaskService, tasksMap} from './taskService'
import {MESSAGE_TO_EXTENSION_ADD_TASK, MESSAGE_TO_EXTENSION_GET_TASK} from '@/const'
import {MESSAGE_TARGET_INJECT, MESSAGE_TO_EXTENSION_ADD_TASK, MESSAGE_TO_EXTENSION_GET_TASK, MESSAGE_TO_INJECT_TOGGLE_DISPLAY} from '@/const'
import ExtensionMessage from '@/messaging/ExtensionMessage'
const methods: {
@@ -65,4 +65,9 @@ chrome.runtime.onMessage.addListener((event: MessageData, sender: chrome.runtime
}
})
//点击扩展图标
chrome.action.onClicked.addListener(async (tab) => {
extensionMessage.broadcastMessageExact([tab.id!], MESSAGE_TARGET_INJECT, MESSAGE_TO_INJECT_TOGGLE_DISPLAY).catch(console.error)
})
initTaskService()