feat: 更新2925邮箱邮件提取逻辑,增强对右侧邮件头的处理与测试

This commit is contained in:
QLHazyCoder
2026-04-23 00:45:19 +08:00
parent c906e4434d
commit 7ba9e609ab
2 changed files with 19 additions and 6 deletions
+12 -4
View File
@@ -32,13 +32,14 @@ const MAIL2925_AGREEMENT_PATTERNS = [];
const document = {
querySelectorAll(selector) {
if (selector === '.mail-item') return [];
if (selector === 'body *') return [headerEmail];
if (selector.includes('[class*="user"]')) return [headerEmail];
if (selector === 'body *') return [headerEmail, wrongHeader];
if (selector === '.right-header' || selector.includes('right-header')) return [headerEmail];
if (selector.includes('[class*="user"]')) return [];
return [];
},
body: {
innerText: 'QLHazycoder qlhazycoder@2925.com',
textContent: 'QLHazycoder qlhazycoder@2925.com',
innerText: 'QLHazycoder qlhazycoder@2925.com tm1.openai.com@foo.example',
textContent: 'QLHazycoder qlhazycoder@2925.com tm1.openai.com@foo.example',
},
};
const window = {
@@ -54,6 +55,13 @@ const headerEmail = {
getBoundingClientRect() { return { top: 40, left: 400, width: 120, height: 20 }; },
closest() { return null; },
};
const wrongHeader = {
hidden: false,
textContent: 'tm1.openai.com@foo.example',
innerText: 'tm1.openai.com@foo.example',
getBoundingClientRect() { return { top: 48, left: 430, width: 150, height: 20 }; },
closest() { return null; },
};
function detectMail2925LimitMessage() { return ''; }
function findMail2925LoginPasswordInput() { return null; }
function findMail2925LoginEmailInput() { return null; }