From 9ae56779ea934e93a8de08df55a8d14dffbd9f1b Mon Sep 17 00:00:00 2001 From: eeelester <11475842+eeelester@users.noreply.github.com> Date: Mon, 16 Sep 2024 19:39:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20popup=E6=98=BE=E7=A4=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entrypoints/popup/App.tsx | 7 ++++++- wxt.config.ts | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) 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'; + }, + }, + }, });