refactor: 暂时移除图片二维码识别功能
- 删除 qrCode-image 右键菜单配置 - 删除 parseQrCodeFromUrl 函数 - 删除 QrCodeToUrlSection 中的 useContextMenuData 相关代码 - 更新相关测试用例
This commit is contained in:
@@ -52,12 +52,6 @@ export const CONTEXT_MENU_CONFIGS: ContextMenuItemConfig[] = [
|
||||
contexts: [chrome.contextMenus.ContextType.SELECTION],
|
||||
parentId: PARENT_MENU_ID,
|
||||
},
|
||||
{
|
||||
id: 'qrCode-image',
|
||||
title: '🖼️ 识别图中的二维码',
|
||||
contexts: [chrome.contextMenus.ContextType.IMAGE],
|
||||
parentId: PARENT_MENU_ID,
|
||||
},
|
||||
{
|
||||
id: 'storageCleaner',
|
||||
title: '🧹 清理当前网站存储',
|
||||
@@ -89,22 +83,6 @@ export function parseContextMenuClick(
|
||||
): ParseResult {
|
||||
const featureKey = menuItemId as PageType;
|
||||
|
||||
if (menuItemId === 'qrCode-image') {
|
||||
const srcUrl = info.srcUrl || '';
|
||||
|
||||
if (srcUrl.startsWith('data:image/')) {
|
||||
return {
|
||||
success: false,
|
||||
error: '无法识别 Base64 内联图片,请使用图片文件 URL',
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
data: { featureKey: 'qrCode', payload: srcUrl },
|
||||
};
|
||||
}
|
||||
|
||||
if (menuItemId === 'qrCode-page') {
|
||||
return {
|
||||
success: true,
|
||||
|
||||
Reference in New Issue
Block a user