This commit is contained in:
sickle committed 2025-01-13 17:17:41 +08:00
1 parent 918b97c8ce
commit 6b67692d42
6 files changed
+57 -8

No files matched your search

+4 -4
View File
@@ -20,9 +20,9 @@ const SCANNER_CONFIG = {
// API 相关配置
API: {
PATTERN: /['"](?:\/|\.\.\/|\.\/)[^\/\>\< \)\(\{\}\,\'\"\\]([^\>\< \)\(\{\}\,\'\"\\])*?[\'"]/g,
// 静态文件后缀
STATIC_FILE_PATTERN: /\.(js|css|ico|png|webp|jpg|jpeg|gif|svg|woff|woff2|ttf|eot|map|json)$/i
PATTERN: /['"](?:\/|\.\.\/|\.\/)[^\/\&\>\< \)\(\{\}\,\'\"\\]([^\>\< \)\(\{\}\,\'\"\\])*?[\'"]/g,
// 静态文件后缀 - 增强匹配规则
STATIC_FILE_PATTERN: /\.(js|css|ico|png|webp|jpg|jpeg|gif|svg|woff|woff2|ttf|eot|map|json|jsonp)(?:\?[^'"]*)?$/i
},
// 域名相关配置
@@ -181,7 +181,7 @@ const SCANNER_CONFIG = {
},
// 其他敏感信息匹配
PHONE: /(?:13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9]|198|199)\d{8}(?!\d)/g,
PHONE: /(?<!\d|\.)(?:13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9]|198|199)\d{8}(?!\d)/g,
EMAIL: /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(?:\.[a-zA-Z]{2,})?/g,
IDCARD: /((\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(\d{6}(18|19|20)\d{2}(0[1-9]|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)))/g,
URL: /https?:\/\/(?:[\w-]+\.)+[a-z]{2,}(?::\d{2,5})?(?:\/[^\s'"]*)?/gi,
+7
View File
@@ -210,10 +210,17 @@ function scanSources(sources) {
results.hashes[hashType] = Array.from(latestResults.hashes[hashType]);
}
// 发送扫描结果更新
chrome.runtime.sendMessage({
type: 'SCAN_UPDATE',
results: results
});
// 发送badge更新
chrome.runtime.sendMessage({
type: 'UPDATE_BADGE',
results: results
});
};
// 分块处理大文本