fix: 补齐 126 邮箱 host 家族识别

This commit is contained in:
Ryan Liu
2026-04-23 09:57:29 +08:00
parent 45546dcb85
commit b89d5389ee
4 changed files with 30 additions and 0 deletions
@@ -15,3 +15,23 @@ test('navigation utils module exposes a factory', () => {
assert.equal(typeof api?.createNavigationUtils, 'function');
});
test('navigation utils treat 126 mail hosts as part of the shared NetEase mail family', () => {
const source = fs.readFileSync('background/navigation-utils.js', 'utf8');
const globalScope = {};
const moduleApi = new Function('self', `${source}; return self.MultiPageBackgroundNavigationUtils;`)(globalScope);
const navigationUtils = moduleApi.createNavigationUtils({
DEFAULT_SUB2API_URL: 'https://example.com/admin/accounts',
normalizeLocalCpaStep9Mode: value => value,
});
assert.equal(navigationUtils.is163MailHost('mail.126.com'), true);
assert.equal(
navigationUtils.matchesSourceUrlFamily(
'mail-163',
'https://mail.126.com/js6/main.jsp',
'https://mail.163.com/js6/main.jsp'
),
true
);
});