fix: 补齐126邮箱子域名来源识别

This commit is contained in:
Ryan Liu
2026-04-25 11:30:55 +08:00
parent 70f3ffb266
commit 9c3de546c0
2 changed files with 17 additions and 0 deletions
+1
View File
@@ -15,6 +15,7 @@ function detectScriptSource({
|| hostname.endsWith('.mail.163.com')
|| hostname === 'webmail.vip.163.com'
|| hostname === 'mail.126.com'
|| hostname.endsWith('.mail.126.com')
) return 'mail-163';
if (hostname === 'mail.google.com') return 'gmail-mail';
if (hostname === 'www.icloud.com' || hostname === 'www.icloud.com.cn') return 'icloud-mail';
+16
View File
@@ -64,3 +64,19 @@ return { detectScriptSource };
'mail-163'
);
});
test('detectScriptSource maps 126 mail subdomains to the shared 163 mail source', () => {
const bundle = [extractFunction('detectScriptSource')].join('\n');
const api = new Function(`
${bundle}
return { detectScriptSource };
`)();
assert.equal(
api.detectScriptSource({
url: 'https://app.mail.126.com/js6/main.jsp',
hostname: 'app.mail.126.com',
}),
'mail-163'
);
});