feat: 更新2925邮箱邮件提取逻辑,增强对右侧邮件头的处理与测试
This commit is contained in:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user