fix: 补齐126邮箱子域名注入范围
This commit is contained in:
+2
-1
@@ -70,7 +70,8 @@
|
||||
"https://mail.163.com/*",
|
||||
"https://*.mail.163.com/*",
|
||||
"https://webmail.vip.163.com/*",
|
||||
"https://mail.126.com/*"
|
||||
"https://mail.126.com/*",
|
||||
"https://*.mail.126.com/*"
|
||||
],
|
||||
"js": [
|
||||
"content/activation-utils.js",
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
|
||||
test('manifest 为网易邮箱内容脚本覆盖 126 子域名', () => {
|
||||
const manifest = JSON.parse(fs.readFileSync('manifest.json', 'utf8'));
|
||||
const mail163Script = manifest.content_scripts.find((script) => (
|
||||
Array.isArray(script.js) && script.js.includes('content/mail-163.js')
|
||||
));
|
||||
|
||||
assert.ok(mail163Script, '应存在 mail-163 内容脚本声明');
|
||||
assert.equal(
|
||||
mail163Script.matches.includes('https://mail.126.com/*'),
|
||||
true,
|
||||
'应覆盖 mail.126.com'
|
||||
);
|
||||
assert.equal(
|
||||
mail163Script.matches.includes('https://*.mail.126.com/*'),
|
||||
true,
|
||||
'应覆盖 *.mail.126.com'
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user