You've already forked bilibili-subtitle
fix
This commit is contained in:
@@ -1,3 +1 @@
|
|||||||
VITE_ENV=web-dev
|
VITE_ENV=web-dev
|
||||||
|
|
||||||
VITE_EXTENSION_ID=nejipfbcnfhckfpmlgibfommbnahchko
|
|
@@ -1,4 +1,3 @@
|
|||||||
NODE_ENV=production
|
NODE_ENV=production
|
||||||
|
|
||||||
VITE_ENV=chrome
|
VITE_ENV=chrome
|
||||||
VITE_EXTENSION_ID=bciglihaegkdhoogebcdblfhppoilclp
|
|
@@ -62,7 +62,7 @@ class InjectMessaging<AllExtensionMessagesType extends ExtensionMessage, AllInje
|
|||||||
[K in AllInjectMessagesType['method']]: (params: Extract<AllInjectMessagesType, { method: K }>['params'], context: MethodContext) => Promise<any>
|
[K in AllInjectMessagesType['method']]: (params: Extract<AllInjectMessagesType, { method: K }>['params'], context: MethodContext) => Promise<any>
|
||||||
}) {
|
}) {
|
||||||
this.methods = methods
|
this.methods = methods
|
||||||
this.port = chrome.runtime.connect(import.meta.env.VITE_EXTENSION_ID, {
|
this.port = chrome.runtime.connect({
|
||||||
name: 'bilibili-inject',
|
name: 'bilibili-inject',
|
||||||
})
|
})
|
||||||
this.l1protocol = new Layer1Protocol<L2ReqMsg, L2ResMsg>(this.messageHandler, this.port)
|
this.l1protocol = new Layer1Protocol<L2ReqMsg, L2ResMsg>(this.messageHandler, this.port)
|
||||||
|
@@ -63,7 +63,7 @@ const useMessagingService = <AllAPPMessagesType extends AppMessage>(methods?: {
|
|||||||
}, [methods])
|
}, [methods])
|
||||||
|
|
||||||
const port = useMemo(() => {
|
const port = useMemo(() => {
|
||||||
return chrome.runtime.connect(import.meta.env.VITE_EXTENSION_ID, {
|
return chrome.runtime.connect({
|
||||||
name: 'bilibili-app',
|
name: 'bilibili-app',
|
||||||
})
|
})
|
||||||
}, [])
|
}, [])
|
||||||
|
1
src/vite-env.d.ts
vendored
1
src/vite-env.d.ts
vendored
@@ -1,7 +1,6 @@
|
|||||||
/// <reference types="vite/client" />
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
interface ImportMetaEnv {
|
interface ImportMetaEnv {
|
||||||
readonly VITE_EXTENSION_ID: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ImportMeta {
|
interface ImportMeta {
|
||||||
|
Reference in New Issue
Block a user