From da5e76aae7120ef55efa5783b00507ea5ec132b6 Mon Sep 17 00:00:00 2001 From: johnathan <952508490@qq.com> Date: Wed, 25 Jun 2025 14:59:37 +0800 Subject: [PATCH] Register AppContext & Format style cell --- shim.d.ts | 4 -- src/background/main.ts | 2 + src/components/AmazonDetailDescription.vue | 2 +- src/components/ImageLink.vue | 2 +- src/components/Logo.vue | 2 +- src/components/ReviewCard.vue | 2 +- src/components/ReviewPreview.vue | 2 +- src/composables/useAppContext.ts | 4 -- src/composables/useWebExtensionStorage.ts | 4 +- src/contentScripts/index.ts | 1 + src/global.d.ts | 4 ++ src/logic/common-setup.ts | 5 +- src/options/main.ts | 3 + src/options/views/AmazonResultTable.vue | 2 +- src/router/index.ts | 22 +++--- src/sidepanel/main.ts | 3 + .../views/AmazonEntries/ReviewPageEntry.vue | 2 +- .../views/AmazonEntries/SearchPageEntry.vue | 2 +- src/sidepanel/views/HomedepotSidepanel.vue | 2 +- webext-bridge/src/sidepanel.ts | 69 +------------------ 20 files changed, 39 insertions(+), 100 deletions(-) delete mode 100644 src/composables/useAppContext.ts diff --git a/shim.d.ts b/shim.d.ts index df546da..d49e992 100644 --- a/shim.d.ts +++ b/shim.d.ts @@ -17,7 +17,3 @@ declare module 'webext-bridge' { >; } } - -declare global { - type AppContext = 'options' | 'sidepanel'; -} diff --git a/src/background/main.ts b/src/background/main.ts index dbe4f85..c5422b7 100644 --- a/src/background/main.ts +++ b/src/background/main.ts @@ -11,6 +11,8 @@ if (import.meta.hot) { import('./contentScriptHMR'); } +Object.assign(self, { appContext: 'background' }); + // remove or turn this off if you don't use side panel const USE_SIDE_PANEL = true; diff --git a/src/components/AmazonDetailDescription.vue b/src/components/AmazonDetailDescription.vue index 34f77c8..e832f4b 100644 --- a/src/components/AmazonDetailDescription.vue +++ b/src/components/AmazonDetailDescription.vue @@ -36,7 +36,7 @@ defineProps<{ model: AmazonDetailItem }>(); -