This commit is contained in:
IndieKKY
2024-10-05 20:03:02 +08:00
parent b283695b02
commit d52231227e
33 changed files with 44 additions and 51 deletions

View File

@@ -1,4 +1,4 @@
import { MESSAGE_TARGET_EXTENSION, MESSAGE_TARGET_INJECT, MESSAGE_TO_EXTENSION_ROUTE_MSG } from '@/const'
import { MESSAGE_TARGET_EXTENSION, MESSAGE_TO_EXTENSION_ROUTE_MSG } from '@/consts/const'
import PortMessageHandler from './PortMessageHandler'
export type PortContext = {

View File

@@ -1,5 +1,4 @@
import { MESSAGE_TARGET_APP, MESSAGE_TARGET_EXTENSION, MESSAGE_TARGET_INJECT, MESSAGE_TO_EXTENSION_ROUTE_MSG } from '@/const'
import { PostMessagePayload, PostMessageResponse, startListening } from 'postmessage-promise'
import { MESSAGE_TARGET_APP, MESSAGE_TARGET_EXTENSION, MESSAGE_TARGET_INJECT, MESSAGE_TO_EXTENSION_ROUTE_MSG } from '@/consts/const'
import PortMessageHandler from './PortMessageHandler'
class InjectMessage {

View File

@@ -1,4 +1,4 @@
import { MESSAGE_TARGET_EXTENSION, MESSAGE_TARGET_INJECT, MESSAGE_TO_EXTENSION_ROUTE_MSG } from '@/const'
import { MESSAGE_TARGET_EXTENSION, MESSAGE_TARGET_INJECT, MESSAGE_TO_EXTENSION_ROUTE_MSG } from '@/consts/const'
import { injectWaiter } from './useMessageService'
import { useCallback } from 'react'
import PortMessageHandler from './PortMessageHandler'

View File

@@ -1,10 +1,7 @@
import { useCallback, useEffect, useMemo } from 'react'
import { useCallback, useMemo } from 'react'
import {
MESSAGE_TARGET_APP,
MESSAGE_TARGET_EXTENSION,
MESSAGE_TARGET_INJECT,
} from '@/const'
import { callServer, PostMessagePayload, PostMessageResponse } from 'postmessage-promise'
} from '@/consts/const'
import { Waiter } from '@kky002/kky-util'
import PortMessageHandler from './PortMessageHandler'