diff --git a/background.js b/background/background.js similarity index 100% rename from background.js rename to background/background.js diff --git a/content.js b/content.js index 0b5dc4a..e1c1a43 100644 --- a/content.js +++ b/content.js @@ -1,6 +1,3 @@ -// content.js - -// 1. 注入 main.js const script = document.createElement('script'); script.type = 'module'; script.src = chrome.runtime.getURL('main.js'); diff --git a/main.js b/main.js index d1488bb..5952e2f 100644 --- a/main.js +++ b/main.js @@ -1,7 +1,7 @@ -import { createPanel } from './panel.js'; -import { handleCommand, COMMANDS } from './commands.js'; -import { initVoice } from './voice.js'; -import { translateToCommand } from './ai.js'; +import { createPanel } from './scripts/panel.js'; +import { handleCommand, COMMANDS } from './scripts/commands.js'; +import { initVoice } from './scripts/voice.js'; +import { translateToCommand } from './scripts/ai.js'; // 等待页面加载完成 const init = async () => { diff --git a/manifest.json b/manifest.json index e255e97..3c294e9 100644 --- a/manifest.json +++ b/manifest.json @@ -4,10 +4,10 @@ "version": "0.1.0", "permissions": ["activeTab", "storage"], "background": { - "service_worker": "background.js" + "service_worker": "background/background.js" }, "action": { - "default_popup": "popup.html", + "default_popup": "popup/popup.html", "default_title": "AI 配置" }, "content_scripts": [ @@ -19,7 +19,7 @@ ], "web_accessible_resources": [ { - "resources": ["*.js", "*.css"], + "resources": ["main.js", "scripts/*.js"], "matches": ["*://1718cloud.com/*"] } ] diff --git a/popup.html b/popup/popup.html similarity index 100% rename from popup.html rename to popup/popup.html diff --git a/popup.js b/popup/popup.js similarity index 91% rename from popup.js rename to popup/popup.js index 41b85bf..9cc26e2 100644 --- a/popup.js +++ b/popup/popup.js @@ -1,7 +1,3 @@ -// 设置默认值 -const DEFAULT_URL = "https://dashscope.aliyuncs.com/compatible-mode/v1"; -const DEFAULT_MODEL = "qwen-plus"; - // 页面加载时读取存储的配置 document.addEventListener('DOMContentLoaded', () => { chrome.storage.sync.get(['aiConfig'], (result) => { diff --git a/ai.js b/scripts/ai.js similarity index 100% rename from ai.js rename to scripts/ai.js diff --git a/commands.js b/scripts/commands.js similarity index 100% rename from commands.js rename to scripts/commands.js diff --git a/panel.js b/scripts/panel.js similarity index 100% rename from panel.js rename to scripts/panel.js diff --git a/voice.js b/scripts/voice.js similarity index 100% rename from voice.js rename to scripts/voice.js