feat: support 126 mail provider routing and shared NetEase verification flow
- 合并 PR #112 的核心改动:新增 126 邮箱 provider,并复用 163 / 163 VIP 的网页邮箱接码链路 - 本地补充修复:吸收 126 子域名注入与来源识别修正,以及新版 ChatGPT 登录验证码邮件匹配适配 - 影响范围:sidepanel mail provider、background navigation/source routing、content mail polling、相关回归测试
This commit is contained in:
@@ -16,6 +16,26 @@ 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
|
||||
);
|
||||
});
|
||||
|
||||
test('navigation utils support codex2api mode and url normalization', () => {
|
||||
const source = fs.readFileSync('background/navigation-utils.js', 'utf8');
|
||||
const globalScope = {};
|
||||
|
||||
Reference in New Issue
Block a user