From 6743b694c8ff334cbd0b2873b76a6358cb2910cb Mon Sep 17 00:00:00 2001 From: Astrian Zheng Date: Sat, 24 May 2025 22:53:21 +1000 Subject: [PATCH] =?UTF-8?q?refactor(Player):=20=E5=B0=86=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E5=99=A8=E7=BB=84=E4=BB=B6=E4=BB=8EApp.vue=E4=B8=AD=E6=8F=90?= =?UTF-8?q?=E5=8F=96=E5=88=B0=E7=8B=AC=E7=AB=8B=E7=9A=84Player.vue?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 提取播放器逻辑到独立的Player.vue组件,以提高代码的可维护性和复用性。同时,更新了相关依赖和样式,确保功能不受影响。 --- public/manifest.json | 29 ++++++++++++++++++-------- src/App.vue | 22 +++----------------- src/apis/index.ts | 5 ++--- src/components/Player.vue | 44 +++++++++++++++++++++++++++++++++++++++ src/pages/AlbumDetail.vue | 14 ++++++++----- src/vite-env.d.ts | 3 ++- 6 files changed, 80 insertions(+), 37 deletions(-) create mode 100644 src/components/Player.vue diff --git a/public/manifest.json b/public/manifest.json index 80914d9..0aba2e7 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -5,12 +5,20 @@ "description": "A Vue-based browser extension.", "content_scripts": [ { - "matches": ["https://monster-siren.hypergryph.com/"], - "js": ["content.js"], + "matches": [ + "https://monster-siren.hypergryph.com/" + ], + "js": [ + "content.js" + ], "run_at": "document_end" } ], - "host_permissions": ["https://monster-siren.hypergryph.com/*", "http://localhost:5173/*"], + "host_permissions": [ + "https://monster-siren.hypergryph.com/*", + "http://localhost:5173/*", + "https://res01.hycdn.cn/*" + ], "icons": { "16": "vite.svg", "48": "vite.svg", @@ -19,9 +27,12 @@ "background": { "service_worker": "background.js" }, - "permissions": ["tabs", "webRequest"], - "content_security_policy": { - "extension_pages": "default-src 'self'; script-src 'self' http://localhost:5173; style-src 'self' 'unsafe-inline'; connect-src 'self' ws://localhost:5173 https://monster-siren.hypergryph.com; img-src 'self' https://web.hycdn.cn;", - "sandbox": "sandbox" - } -} + "permissions": [ + "tabs", + "webRequest" + ], + "content_security_policy": { + "extension_pages": "default-src 'self'; script-src 'self' http://localhost:5173; style-src 'self' 'unsafe-inline'; connect-src 'self' ws://localhost:5173 https://monster-siren.hypergryph.com; img-src 'self' https://web.hycdn.cn; media-src 'self' https://res01.hycdn.cn;", + "sandbox": "sandbox" + } +} \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 0529b19..a2e8ff3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,10 +1,9 @@