From e03741a0f88ed7c3c4c618f7bd663debe791240f Mon Sep 17 00:00:00 2001 From: Astrian Zheng Date: Wed, 28 May 2025 13:17:02 +1000 Subject: [PATCH] feat(Manifest, Background): add action configuration for extension icon and click behavior --- public/background.js | 4 ++++ public/manifest.json | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/public/background.js b/public/background.js index 4bb49c7..6c6f25c 100644 --- a/public/background.js +++ b/public/background.js @@ -23,3 +23,7 @@ chrome.webRequest.onBeforeRequest.addListener( }, { urls: ['https://monster-siren.hypergryph.com/manifest.json'] }, ) + +chrome.action.onClicked.addListener(() => { + chrome.tabs.create({ url: chrome.runtime.getURL('index.html') }) +}) \ No newline at end of file diff --git a/public/manifest.json b/public/manifest.json index af0e735..b69b538 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -25,6 +25,14 @@ "48": "vite.svg", "128": "vite.svg" }, + "action": { + "default_title": "打开 MSR Mod", + "default_icon": { + "16": "vite.svg", + "48": "vite.svg", + "128": "vite.svg" + } + }, "background": { "service_worker": "background.js" },