diff --git a/entrypoints/popup/App.tsx b/entrypoints/popup/App.tsx index cca82c4..98a8cc7 100644 --- a/entrypoints/popup/App.tsx +++ b/entrypoints/popup/App.tsx @@ -16,16 +16,19 @@ function App() { active: true, currentWindow: true, }) + console.log('tab',tab) setIsMatch(MATCH_URL.test(tab.url as string)) })() }, [setIsMatch]) useLayoutEffect(() => { (async () => { + console.log('changeIcon',isMatch) if (!isMatch) { changeIcon(false) } else { - setSwitchState(await storage.getItem('session:switchState') ?? POPUP_INITIAL_STATE) + let tmp:boolean|null|undefined = await storage.getItem('session:switchState') + setSwitchState(tmp ?? POPUP_INITIAL_STATE) } })() }, [isMatch]) @@ -42,6 +45,8 @@ function App() { if (!switchState && prevSwitchState) onSwitch(false) + + console.log('switchState/prevSwitchState',switchState,prevSwitchState) },[switchState]) return isMatch ? : diff --git a/wxt.config.ts b/wxt.config.ts index f763ef3..08364f8 100644 --- a/wxt.config.ts +++ b/wxt.config.ts @@ -15,4 +15,11 @@ export default defineConfig({ runner: { startUrls: ["https://live.bilibili.com/7777"], }, + hooks: { + build: { + manifestGenerated(_,manifest: any) { + manifest.action.default_title = '在B站看直播全屏时展示SC'; + }, + }, + }, });