From 8e8df8897c7660faa874cfb11b1f29a13a957b18 Mon Sep 17 00:00:00 2001 From: luke Date: Sat, 24 May 2025 17:04:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BF=AB=E6=8D=B7=E9=94=AE?= =?UTF-8?q?=E5=94=A4=E8=B5=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- background.js | 10 ++++++++++ manifest.json | 13 ++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 background.js diff --git a/background.js b/background.js new file mode 100644 index 0000000..4cc32a3 --- /dev/null +++ b/background.js @@ -0,0 +1,10 @@ +chrome.commands.onCommand.addListener(function (command) { + if (command === "open_plugin") { + chrome.windows.create({ + url: "popup.html", + type: "popup", + width: 640, + height: 800 + }); + } +}); diff --git a/manifest.json b/manifest.json index 533c736..aa80ec3 100644 --- a/manifest.json +++ b/manifest.json @@ -1,13 +1,24 @@ { "manifest_version": 3, "name": "渠道应用开发部知识库", - "version": "0.6", + "version": "1.0.1", "description": "通过关键词快速搜索内部文档", "permissions": [], "host_permissions": [ "http://app.wisdompulse.cn/*", "http://share.wisdompulse.cn/*" ], + "background": { + "service_worker": "background.js" + }, + "commands": { + "open_plugin": { + "suggested_key": { + "default": "Alt+K" + }, + "description": "打开渠道应用开发部知识库插件" + } + }, "action": { "default_popup": "popup.html", "default_icon": {