This commit is contained in:
IndieKKY
2024-10-04 15:31:51 +08:00
parent 6ffb9073ab
commit 564f032e3a
6 changed files with 27 additions and 9 deletions

View File

@@ -5,6 +5,7 @@ import { useCallback } from 'react'
const useMessage = () => {
const sendExtension = useCallback(async <T = any>(method: string, params?: any) => {
return await chrome.runtime.sendMessage<MessageData, MessageResult>({
from: 'app',
target: MESSAGE_TARGET_EXTENSION,
method,
params: params ?? {},