页面关键词高亮助手

一键高亮网页关键词,提升检索效率 · 安全本地运行

v1.0.30

💡 Edge 用户可直接安装;Chrome 用户请下载离线包后,在 chrome://extensions 开启“开发者模式”并加载解压后的文件夹。

📖 详细介绍

页面关键词高亮助手 是一款轻量、安全、免费的浏览器扩展。无论你是阅读长文、分析数据报表,还是检索内部知识库,只需输入一组关键词,它就会立刻将所有匹配文字标上醒目的黄色背景,让关键信息一目了然。

🔍 多词同步高亮:支持同时高亮多个关键词,一次性标记所有目标。
去符号替换:智能忽略标点符号,输入 AB 即可匹配 A,B、A B 等,且不会误把汉字当成符号。
🎯 通配符 | 匹配:用 | 匹配同一行内的任意字符,如“移动|开发”匹配“移动端开发”。
🛡️ 白名单过滤:设置不希望高亮的词汇,精准排除干扰。
🌐 跨标签高亮:即使文字被加粗、换行、斜体等打断,也能完整高亮整个词组。
📤📥 配置导入/导出:可将关键词、白名单和所有设置导出为 JSON 文件,方便备份或迁移。
🔒 隐私第一:所有数据仅保存在本地,无任何网络请求,绝不收集隐私。

Page Keyword Highlighter is a lightweight, secure, and free browser extension. Whether you are reading long articles, analyzing reports, or searching internal knowledge bases, simply enter a set of keywords and it will instantly highlight all matching text with a prominent yellow background, making key information clear at a glance.

🔍 Multi-keyword highlighting: Highlight multiple keywords at once, marking all targets simultaneously.
Symbol removal: Intelligently ignore punctuation marks. Enter "AB" to match "A,B", "A B", etc., without treating Chinese characters as symbols.
🎯 Wildcard | matching: Use | to match any characters within the same line, e.g., "mobile|dev" matches "mobile app dev".
🛡️ Whitelist filtering: Set words you do not want highlighted, precisely eliminating interference.
🌐 Cross-element highlighting: Even if text is interrupted by bold, line breaks, italics, etc., the entire phrase can be highlighted completely.
📤📥 Import/Export config: Export keywords, whitelist, and all settings as a JSON file for backup or migration.
🔒 Privacy first: All data is stored locally. No network requests, no privacy collection.

✨ 核心功能

🔍 智能高亮

多关键词一次高亮,黄色背景+黑字,清晰醒目。

⚡ 去符号替换

跨标点匹配,不误伤中文,纯文本检索利器。

🎯 通配符 |

段落内模糊匹配,灵活应对不同写法。

🛡️ 白名单过滤

排除不需要高亮的词汇,精准控制范围。

🌐 跨节点匹配

无视加粗、换行等标签,智能合并高亮。

📤📥 导入/导出

一键备份或迁移所有设置,便于多设备同步。

🔒 100%本地运行

无网络请求,无数据收集,隐私安全有保障。

📸 功能截图
📘 使用指南

1. 安装扩展

前往 Microsoft Edge 加载项商店 搜索“页面关键词高亮助手”并安装(完全免费),或下载离线安装包手动加载。

2. 打开设置面板

点击工具栏中的插件图标,弹出控制面板。面板顶部是“开启高亮”开关,下方为关键词输入框。

3. 输入关键词

在文本框内输入需要高亮的词语,多个关键词用空格分隔(例如:苹果 香蕉 机器学习)。
💡 如果需要匹配含空格的词组,请使用 通配符 | 或开启“去符号替换”后输入连续字符即可。

4. 立即生效

确认“开启高亮”开关处于开启状态,当前页面会自动高亮所有匹配的关键词。输入完成后无需手动刷新,配置会自动保存并即时同步。

5. 高级设置(可选)

点击面板底部的 ⚙️ 高级设置,展开更多选项:

  • 去符号替换:开启后,输入 AB 可匹配被标点、空格分隔的 A 和 B(如 A,B),仅识别标点,不误伤汉字。
  • 通配符 | 匹配:在关键词中使用 | 可匹配同一段落内的任意字符。例如 移动|开发 匹配“移动端开发”。使用 \| 可匹配字面竖线。
  • 白名单:在此输入不希望被高亮的词(同样用空格分隔),这些词即使匹配也会被跳过。
  • 导入/导出配置:点击“导出”将当前所有设置保存为 JSON 文件;点击“导入”可快速恢复先前备份的配置。

所有高级设置默认开启,你可以根据需求随时关闭或调整。

6. 关闭或修改

关闭总开关,所有高亮立即消失;重新打开开关,高亮立即恢复。修改关键词或白名单后,页面会实时更新。

1. Install the extension

Go to the Microsoft Edge Add-ons Store and search for "Page Keyword Highlighter" to install (completely free), or download the offline installation package and load it manually.

2. Open the settings panel

Click the extension icon in the toolbar to open the control panel. At the top is the "Enable Highlight" toggle, and below is the keyword input field.

3. Enter keywords

Enter the words you want to highlight in the text box. Separate multiple keywords with spaces (e.g., apple banana machine learning).
💡 If you need to match phrases containing spaces, use the wildcard | or enable "Symbol Replacement" and enter continuous characters.

4. Immediate effect

Ensure the "Enable Highlight" toggle is on, and the current page will automatically highlight all matching keywords. No manual refresh is needed; configurations are saved and synced instantly.

5. Advanced settings (optional)

Click the ⚙️ Advanced Settings at the bottom of the panel to expand more options:

  • Symbol Replacement: When enabled, entering AB will match A and B separated by punctuation or spaces (e.g., A,B). Only punctuation is recognized, without affecting Chinese characters.
  • Wildcard | Matching: Use | in keywords to match any characters within the same paragraph. For example, mobile|dev matches "mobile app dev". Use \| to match a literal vertical bar.
  • Whitelist: Enter words you do not want highlighted (also separated by spaces). These words will be skipped even if matched.
  • Import/Export Config: Click "Export" to save all current settings as a JSON file; click "Import" to quickly restore a previously backed up configuration.

All advanced settings are enabled by default; you can disable or adjust them at any time.

6. Turn off or modify

Turning off the master switch will immediately remove all highlights; turning it back on will restore them. Modifying keywords or the whitelist will update the page in real time.

📋 v1.0.27 → v1.0.30 更新日志

v1.0.30 2025-06-09

  • 🔄 重构代码结构:内容脚本与弹窗文件更名,路径扁平化,提升可维护性。
  • 📥📤 新增配置导入/导出:支持导出关键词、白名单及所有开关状态为 JSON 文件,并可随时导入恢复。
  • 🐛 修复多标签页配置刷新失效问题:引入心跳键机制,保证所有标签页同步更新。
  • 🖱️ 优化开关交互:点击文字说明即可切换开关,操作更符合直觉。
  • 🎯 通配符与去符号增强:含通配符的关键词内每个片段均可独立应用去符号规则,匹配更精准。
  • 🌐 本地化完善:新增西班牙语、法语、俄语支持,并补全导入导出相关提示文案。
  • 🛡️ 页面卸载保护:监听 pagehide 事件,及时释放资源,防止内存泄漏。

v1.0.27 – v1.0.29 2025-05 → 2025-06

  • ⚡ 多项稳定性与性能优化,包括防抖保存、无效输入过滤等。
  • 🐛 修复因 CSP 拦截、特殊空格等引发的高亮异常。
  • 📌 最小化权限声明,仅保留 storage 与 activeTab。

v1.0.30 2025-06-09

  • 🔄 Refactored code structure: flattened paths for content script and popup, improving maintainability.
  • 📥📤 Added configuration import/export: export keywords, whitelist, and switch states as JSON, and import anytime.
  • 🐛 Fixed multi-tab config refresh issue with heartbeat mechanism, ensuring all tabs stay in sync.
  • 🖱️ Improved toggle interaction: clicking label text now toggles the switch, matching native behavior.
  • 🎯 Enhanced wildcard & symbol removal: each segment in a wildcard keyword can independently apply symbol removal for better precision.
  • 🌐 Locale updates: added Spanish, French, Russian support, and import/export strings across all languages.
  • 🛡️ Page unload protection: listens to pagehide to clean up resources, preventing memory leaks.

v1.0.27 – v1.0.29 2025-05 → 2025-06

  • ⚡ Various stability and performance optimizations, debounced save, invalid input filtering.
  • 🐛 Fixed highlight failures caused by CSP blocks, special whitespace, etc.
  • 📌 Minimized permissions, keeping only storage and activeTab.
📋 v1.0.26 更新日志

🚀 新功能

  • 通配符 | 匹配:同一段落内任意字符匹配,可独立开关。
  • 去符号替换模式:智能忽略标点,不再将中文视为符号。
  • 白名单过滤:添加不希望高亮的词,排除干扰。
  • 中英文自动切换:根据浏览器语言自动切换界面。
  • 跨节点词组匹配:重写引擎,支持跨标签高亮。
  • Shadow DOM 穿透:兼容 Web Components 页面。
  • 严格 CSP 支持:安全注入样式,适配高安全网站。

⚡ 优化

  • 输入防抖保存,失焦即时生效。
  • 通配符与去符号开关放入高级设置,界面更清爽。
  • 过滤纯通配符等无效输入,防止卡顿。
  • 状态提示更准确,失败后自动恢复“已就绪”。
  • 移除未使用权限,仅保留 storage 和 activeTab。

🐛 修复

  • 修复操作失败时错误显示“操作成功”。
  • 修复跨节点文本高亮失败。
  • 修复不间断空格( )等特殊空白匹配问题。
  • 修复高安全站点 CSP 拦截导致高亮失效。
  • 修复去符号替换误伤汉字导致全篇高亮。
  • 修复空通配符输入导致页面卡死。

🚀 New Features

  • Wildcard | matching: match any characters within a paragraph, toggleable independently.
  • Symbol removal mode: intelligently ignore punctuation without treating Chinese as symbols.
  • Whitelist filtering: add words you don't want highlighted.
  • Auto language switch: UI changes based on browser language.
  • Cross-element phrase matching: rewritten engine supports highlighting across tags.
  • Shadow DOM penetration: compatible with Web Components pages.
  • Strict CSP support: safely inject styles for high-security websites.

⚡ Improvements

  • Debounced save on input, effective on blur.
  • Wildcard and symbol removal moved to advanced settings for a cleaner interface.
  • Filter invalid inputs like pure wildcards to prevent lag.
  • More accurate status messages, auto-recover to "Ready" on failure.
  • Removed unused permissions, only storage and activeTab remain.

🐛 Fixes

  • Fixed false "Operation successful" message on failure.
  • Fixed cross-node text highlighting failure.
  • Fixed non-breaking space ( ) and other special whitespace matching.
  • Fixed CSP blocking on high-security sites causing highlight failure.
  • Fixed symbol removal mistakenly treating Chinese characters, causing full-page highlighting.
  • Fixed page freezing on empty wildcard input.
📋 v1.0.12 → v1.0.16 更新日志

v1.0.16 2025-04-10

  • 新增通配符匹配基础支持。
  • 去符号替换(初版)。
  • 优化性能,减少高亮闪烁。
  • 修复多关键词空格处理异常。

v1.0.15 2025-04-05

  • 修复特殊字符页面高亮失效。

v1.0.14 2025-04-01

  • 加入白名单基础逻辑。
  • 界面微调。

v1.0.13 2025-03-28

  • 修复某些网站下样式注入失败。

v1.0.12 2025-03-25

  • 初始公开发布:基本关键词高亮、开关控制、本地存储。

v1.0.16 2025-04-10

  • Added basic wildcard matching support.
  • Initial version of symbol removal.
  • Performance optimization, reduced flickering.
  • Fixed abnormal handling of multiple keyword spaces.

v1.0.15 2025-04-05

  • Fixed highlight failure on pages with special characters.

v1.0.14 2025-04-01

  • Added basic whitelist logic.
  • Minor UI adjustments.

v1.0.13 2025-03-28

  • Fixed style injection failure on some websites.

v1.0.12 2025-03-25

  • Initial public release: basic keyword highlighting, toggle control, local storage.
💬 开发者的心路历程
从 v1.0.16 到 v1.0.30,这个小小的关键词高亮助手几乎被重写了一大半。回想起来,整个过程充满了“按下葫芦浮起瓢”的焦灼和最终啃下硬骨头的欣慰。 最初,我只是想让插件支持词组高亮,比如能高亮“machine learning”这样含空格的术语。本以为加个引号解析、改改正则就完事,但很快就被现实教育了:有用户反馈内部系统里带空格的词完全不高亮,而百度首页却正常。我一查,发现高安全网站有严格的 CSP 策略,内联 style 被直接干掉;还有一些页面把文本藏在 Shadow DOM 里,传统的 TreeWalker 根本进不去。更离谱的是,有些企业系统里 <b>A</b>BCD 这样的写法随处可见,旧引擎只能高亮 A 或 BCD,整个 ABCD 就是死活标不上。 于是,我只能把最核心的文本遍历逻辑全部推倒重来:用深度优先递归收集所有文本节点,拼成一整个全局文本,记录每个节点的偏移映射,正则匹配后再倒推回各个节点中切出高亮范围。光这一块就迭代了四五个版本,每一次都离“正确跨节点匹配”更近一步,但也每次都在边缘 case 上翻车。 更大的坑是“去符号替换”。早期为了兼容任意符号分隔的词组,我简单用了 [\W_]* 来匹配字符间的任意非单词符号。这在英文页面里工作完美,但一放到纯中文内部系统上,整个操作台全黄了——因为汉字在正则里根本不是 \w,全被当成了符号。用户反馈说“内幕”和“作业”两个词把屏幕染成了一片黄色,那一刻我真的头皮发麻。后来我专门整理了一份中英文标点与空白的 Unicode 范围,替换掉宽泛的 \W,才终于让插件既能忽略真正的标点,又不会误伤汉字。这个改动也让我对 Unicode 字符类有了更深的敬畏。 白名单、通配符开关、高级设置折叠、导入导出……这些功能其实都是和用户“对话”出来的。有人希望在某些词上例外,有人觉得开关太多需要藏起来,还有人担心自己会误输入。每一次反馈,都是一次“还能更好”的鞭策。 最终,当我把所有高级开关收进“⚙️ 高级设置”、让界面重回简洁,并且确认内部系统、英文博客、Shadow DOM 页面、CSP 严格站点全部能稳稳当当高亮时,那种“终于拿下了”的感觉,真的比什么都踏实。 这个插件的代码量不大,但每一行几乎都经历过挣扎和推敲。我很感激那些积极反馈 bug 和使用场景的用户,是你们让这个免费小工具一点点长成了真正耐用的模样。v1.0.30 是一个里程碑,但肯定不会是终点。如果还有什么让你抓狂的问题,请一定告诉我,我们继续打磨。
☕ 支持开发者