From dda1e4ae45e0715696cf314054a9cb463bd65a81 Mon Sep 17 00:00:00 2001 From: sickle <2628797272@qq.com> Date: Tue, 14 Jan 2025 17:53:04 +0800 Subject: [PATCH] v0.2.2.0 --- README.md | 1 + content/content.js | 21 ++++------------- popup/highlight.css | 25 ++++++++++++++++++++ popup/popup.js | 56 ++++++++++++--------------------------------- 4 files changed, 45 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 6a06188..4ec058c 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,7 @@ - 内网 IP 匹配 - 完善了 URL 的匹配,使其能够匹配 IP 以及更多协议 - 设计了 Logo,优化文档排版样式 +- 修复配置信息不能展示的问题 --- diff --git a/content/content.js b/content/content.js index e473366..4e1c92c 100644 --- a/content/content.js +++ b/content/content.js @@ -495,23 +495,12 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { }); return true; // 保持消息通道打开 } else if (request.type === 'GET_CONFIG') { - // 返回配置信息,将正则表达式转换为字符串 - const config = { - WHITELIST: SCANNER_CONFIG.WHITELIST, - API: { - PATTERN: SCANNER_CONFIG.API.PATTERN.toString(), - STATIC_FILE_PATTERN: SCANNER_CONFIG.API.STATIC_FILE_PATTERN.toString() - }, - DOMAIN: { - BLACKLIST: SCANNER_CONFIG.DOMAIN.BLACKLIST, - SPECIAL_DOMAINS: SCANNER_CONFIG.DOMAIN.SPECIAL_DOMAINS - }, - IP: { - PRIVATE_RANGES: SCANNER_CONFIG.IP.PRIVATE_RANGES.map(pattern => pattern.toString()), - SPECIAL_RANGES: SCANNER_CONFIG.IP.SPECIAL_RANGES.map(pattern => pattern.toString()) + // 只返回白名单配置 + sendResponse({ + config: { + WHITELIST: SCANNER_CONFIG.WHITELIST } - }; - sendResponse({ config }); + }); } }); diff --git a/popup/highlight.css b/popup/highlight.css index 93e3187..2289aed 100644 --- a/popup/highlight.css +++ b/popup/highlight.css @@ -543,4 +543,29 @@ body { .fingerprint-group:hover { transform: translateX(2px); } + +/* 白名单域名展示样式 */ +.whitelist-domains { + margin-top: 10px; + background: #f8f9fa; + border-radius: 6px; + padding: 12px; +} + +.domain-item { + display: inline-block; + padding: 6px 12px; + background: #fff; + border-radius: 4px; + margin: 4px; + font-size: 13px; + color: #495057; + box-shadow: 0 1px 3px rgba(0,0,0,0.1); +} + +.config-content { + color: #868e96; + font-size: 13px; + margin-bottom: 8px; +} \ No newline at end of file diff --git a/popup/popup.js b/popup/popup.js index 90ebd33..3ab9cd5 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -22,7 +22,7 @@ function switchPage(pageName) { // 显示配置信息 function displayConfig(config) { - const container = document.querySelector('.config-page'); + const container = document.querySelector('.config-page .container'); if (!config) { container.innerHTML = '