fix: 修复右键菜单跳转目标为 popup 页面

- 将 fallback 页面从 options.html 改为 popup.html
- popup 页面使用 RouterProvider,可以正确处理 URL 参数并跳转到对应功能页面
- options 页面是独立设置页,不支持 URL 参数路由
This commit is contained in:
雨霖铃
2026-05-20 21:03:55 +08:00
parent 8ec584c85f
commit 5868316c3a
+2 -2
View File
@@ -32,9 +32,9 @@ export default defineBackground(() => {
// sidepanel 未打开或无法通信,继续执行其他方案
}
const optionsUrl = chrome.runtime.getURL('/options.html');
const popupUrl = chrome.runtime.getURL('/popup.html');
const params = new URLSearchParams({ feature: featureKey, payload });
await browser.tabs.create({ url: `${optionsUrl}?${params.toString()}` });
await browser.tabs.create({ url: `${popupUrl}?${params.toString()}` });
});
// 监听扩展图标点击事件,打开侧边栏