feat(extension): 侧边栏与 popup 用视频标题替代链接显示

在任务未完成的早期阶段(PENDING/DOWNLOADING 等),侧边栏和 popup
只能回退到 videoUrl,用户看到的是一长串链接,难以辨认。

改动:
- TaskRecord 新增 title 字段,用于存储浏览器标签页标题
- popup 创建任务时保存 tab.title
- background startTask 接收可选 title,右键菜单和悬浮按钮均传入
- 显示优先级:result.audio_meta.title > title > videoUrl
- 所有平台(Bilibili / YouTube / Douyin / Kuaishou)均受益

测试:
- pnpm typecheck 通过
- pnpm build 通过
- 在 B 站、YouTube 视频页提交任务,侧边栏和 popup 均显示标题而非链接
This commit is contained in:
techotaku39
2026-05-24 00:05:47 +08:00
parent 717df2af7b
commit 1eb213e215
5 changed files with 24 additions and 11 deletions

View File

@@ -19,6 +19,7 @@ async function trigger() {
const res = await sendMessage('bilinote-start', {
url: window.location.href,
platform,
title: document.title,
}, 'background')
const ok = res && (res as any).ok
toast.value = ok