您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Enhanced keywords highlight for Search Engines and All !
当前为
A powerful word highlight script that can do not just highlight. | 这是一个强大的高亮关键词脚本,强大不只是高亮!
Tested under Firefox with Greasemonkey. Some enhanced functions may not be available in other browsers(see "For Chrome Users" below). | 仅在搭配 Greasemonkey 扩展的 Firefox 上测试通过。有些增强功能可能无法在其他浏览器上运作(请见下“给 Chrome 用户的提醒”)。 |
If you are a Readability addon user, note that the script will only work when activated AFTER activating Readability. Good solution is not currently available. | 如果你使用 Readability 扩展,要注意这脚本必须在激活 Readability 后才能激活,否则不能起作用。目前还没很好的解决方案。 |
Since Firefox4 uses Ctrl-/ to toggle Addon bar, I change the shortcut keys to activate the keyword input box to Alt-/ , while Alt-. (that is Alt key and Period key) replace the old shortcut Alt-/ to edit keywords. | 因为 Firefox4 使用了 Ctrl-/ 开闭附加组件栏,所以将调用关键词输入框的快捷键更换为Alt-/,而原来编辑关键词用的 Alt-/ 更改为 Alt-.(Alt键加句点键)。 |
Better install this Chrome extension: Tampermonkey before installing this script to enable the script's full function in Chrome. | 请安装这个 Chrome 扩展再安装该脚本,以使该脚本全功能可用:Tampermonkey。 |
Behavior change: now you can only move the panel by dragging the left handler; Behavior change: now you cannot drag the panel when it's minimized; Add an option in code to provide initial-minimized-state panel for auto-highlight; Change the shortcut keys to activate the keyword input box: Alt-/ to activate, while Alt-. (that is Alt and Period) to edit keywords (fully available in the last update). | 行为变更:现在只能通过拖动左边的手柄来移动面板;行为变更:面板最小化后不能拖动;增加代码中设置项:为自动高亮提供面板初始最小化状态;调用关键词输入框的快捷键更换,Alt-/为调用关键词输入,Alt-.为编辑关键词(最新修正可用)。 |
Enhanced word highlight is an enhanced version of "word highlight" script, which has the original features below:
| Enhanced word highlight 是 “word highlight” 脚本的增强版本,除了原脚本的如下特性外:
|
Part I: Basic Settings | 第一部分:基本设定项
By selecting the "Enhanced word highlight Advanced Config" item from the Greasemonkey menu, you can change the following configs to your preference. If you are not using Greasemonkey, you may need to change them in "// #### Config II #### " section in code. Since the code include Chinese characters, an editor that supports multiple text encoding is required. | 从 Greasemonkey 的菜单中选择“Enhanced word highlight 高级设置”项,然后就可以根据你自己需要可以更改以下设置。如果你没有使用 Greasemonkey,你可能需要在代码中的“// #### Config II #### ”区修改相应的代码。因为代码包含中文字符,编辑代码需要的编辑器必须支持多种文本编码。 |
What auto-pager tool do you mostly use?The script originally supports Autopagerize GM script. If you use Autopagerize, select the first option (default). With AutoPager Firefox Extension, the new page content will be highlighted instantly; by selecting the second option will enable the script to also refresh the map and keyword count. If you are using other auto-pager tools, such as GoogleMonkeyR GM script, select the last option to let the script detect page change and totally refresh the highlight. # The script uses an economical way to detect page height change in options two and three, thus there will be some delay between page change and highlight renewal. However, since the script has to go over all the content every time the new page is inserted, as page grows longer, the time required to renew will increase. | 你主要用那种自动翻页工具?脚本本身支持 Autopagerize GM脚本 ,所以使用 Autopagerize 的用户请选择第一项(默认)。 使用 Firefox 扩展 AutoPager 的话,自动翻页页面会被自动高亮;选择第二项的话将允许脚本刷新分布图和计数。 如果你使用的是其他自动翻页工具,例如 GoogleMonkeyR GM脚本,可选择第三项让脚本检测页面变化刷新高亮。 # 选择第二或第三项的话,脚本会使用一种较经济的手段检测页面高度变化,所以高亮更新会相对于页面变化稍有延迟。不过,由于每次插入自动翻页页面脚本都要检查全部页面内容,在随着自动翻页不断增长的页面上,更新高亮需要会消耗越来越长的时间。 |
Turn off highlight of short keywords by default?Not highlight short keywords, i.e. words formed by only one or two letters and numbers, but still leave them on the panel. | 是否默认停用短关键词的高亮?不对一个或两个字母/数字的关键词进行高亮,但仍在高亮面板上保留。不对中文字起作用。 |
Disable auto-highlight (auto-capture keywords for highlight) ?Stop auto-highlight function, including on search results and subsequent pages. Selecting the third option will only stop auto-highlight function on subsequent pages from search results, while the fourth does the opposite. This config does not affect inherit-highlight and highlight for locked keywords. | 是否禁用自动高亮(自动抓取关键词来高亮)?关闭自动高亮,也就是在搜索结果页及从中打开的页面中不再自动高亮搜索关键词。选择第三个选项时仅对从搜索结果页中打开的页面关闭自动高亮,第四项则相反。此设置项不影响继承高亮和对锁定关键词的高亮。 |
☐ Sort keyword for more accurate highlight (Recommended, except for regular expression users)Sort keywords will arrange longer keyword first, which presents a more reasonable result, which however, will need a bit longer time to process when adding and changing keywords, although that normally will not be noticeable. Nevertheless, there are always circumstances that you prefer "straight-forward" highlighting, or "short word first" rule, or you are on an old computer, or to enable adding regular expressions, under which you would like to turn this option off instead. | ☐ 排列关键词以更准确高亮(推荐;需要高亮正则表达式的用户除外)默认设置是将关键词按长到短排列后再高亮,这样高亮结果会比较合理;但这种处理会稍微多用一点点时间(一般不明显),特别是添加关键词的时候。总存在这样的情况:你想按输入的顺序高亮、或想要先高亮短词、或者电脑比较老、或者希望能够添加正则表达式,那样的话可以将这项关闭。 |
☐ Save panel positionJust to save the panel position the last time you move it. | ☐ 保存面板位置选中的话高亮面板会记住并恢复上一次的位置 |
☐ Show indicator bar when navigatingDisplay a long semi-transparent bar when navigating through keywords, indicating which row the current keyword is in. | ☐ 查找关键词时显示指示条当你查找高亮关键词的时候显示一条横贯屏幕的半透明条,用以指示当前关键词所在的行。 |
--------------
Part II: Special Settings | 第二部分:特殊设定项
Warning: Changing the advanced configs below requires editing the script source code. You should only change the code according the following instruction within the "// #### Config I ####" section. Since the code include Chinese characters, an editor that supports multiple text encoding is required (e.g. Notepad++). | 警告:修改以下高级设置需要编辑脚本源代码,请按照说明修改代码中“// #### Config I ####”区。因为代码包含中文字符,编辑代码需要的编辑器必须支持多种文本编码(例如 Notepad++)。 |
// List of url patterns; Array('NAME', 'KEYWORD_PREFIX', 'URL_PATTERN') urlArr[0] = ['Google', 'q=', 'www.google.']; ......
Identifying search sites with url patterns to get search keywords for highlight. | 用于从特定url特征中提取搜索关键词用于高亮。 |
// List of IDs of query input boxes; Array('#SEARCHBOX_ID#', 'SEARCHPAGE SPEC_URL') query_id[0] = new Array('query', '');// most common ......
Identifying the search box in other websites with url filter to get search keywords for highlight. | 用于在特定网址下的页面中找到搜索输入框并提取搜索关键词用于高亮。 |
// keybinds var KEY_NEXT = 'n';// "n"Next occurrence ......
Set the shortcut keys to launch certain functions. | 设置指定功能的快捷键。 |
// delay of highlighting (ms) var delay = 500;
Delay set to postpone highlight action, avoid conflict. | 设置脚本将延迟多久开始高亮,以免发生冲突。 |
// instant highlight selected keywords var instant = true;
Set whether pressing Alt-/ instantly add selected text as keywords to highlight. | 设置是否在按下 Alt-/ 快捷键时自动将选中文本作为关键词高亮。 |
// restore focus and scroll position after closing keyword input box with shortcut key? // mainly useful for keyboard navigation, not recommend for mouse navigation. var refocus = false;
Useful for keyboard navigation (such as arrow key scrolling), which retore focus after using "Esc" to exit keyword input box. If you don't feel any trouble, do touch it. | 仅适用于使用键盘操作的用户,用于纠正用快捷键关闭关键词输入框时焦点跳到页尾而妨碍方向键滚动页面的问题。如果你不是因为这个问题而烦恼,绝不要更改这设置。 |
// minimize the panel initially? var panel_hide = false;
provide initial-minimized-state panel for auto-highlight. | 为自动高亮提供面板初始最小化状态。 |
--------------
Part III: Calling Functions with Mouse Gesture | 第三部分:用鼠标手势调用功能
For heavy users of mouse gesture, requires a mouse gesture addon that support gesture comand customization. | 此部分适合鼠标手势重度使用者,需要支持自定义手势命令的鼠标手势组件配合使用。 |
content.window.wrappedJSObject.EWH_iSearch();
Call the keyword input box. | 调出关键词输入框。 |
content.window.wrappedJSObject.EWH_cClose();
Call the disable-highlight command. | 调用停用高亮命令。 |
This script cannot be born without the original script (Version 1.0.9) by os0x. Thank grea for code and idea contribution. And many who offer tips, ideas, references and suggestions. | 多谢原作者 os0x ,在它的原脚本(版本1.0.9)基础上才能诞生这脚本。 多谢网友 grea 提供代码和好主意。 以及很多很多提供提示、主意、参考和建议的朋友。 |
2010.08.15:
Version 1.5.0: Add support for more search sites other than Google, as well as their subsequent pages; add config option to disable auto-highligh in search result pages; add in-code config for restore focus after using Esc key exiting keyword input; change behavior, pressing Ctrl-/ when focused in keyword input box will close the box; fix behavior, now quoted keywords can sustain; code refinement; since I have to add encoding convertion functions to handle Baidu keywords, the size of the script grows significantly. | 为更多搜索网站、以及从他们打开的页面提供自动高亮支持;添加在搜索结果页禁用自动高亮的设置项;在代码中添加“按Esc退出关键词输入框”时恢复焦点的选项;行为变更,在焦点在关键词输入框时按 Ctrl-/ 组合键将关闭该框;行为修正,现在用半角双引号引住的关键词不会再被拆散;代码优化;由于要添加转换代码页的函数去处理百度的关键词,脚本的体积现在大了很多。
2010.11.30:
Version 1.5.5: Behavior change: pressing Ctrl-./ when text is selected outside of text input area now will instantly add selected text as keywords to highlight; "Add/New" keyword input status will last until web page refresh; when highlight is disabled, existing keywords now will not automatically be added to the new keywords for highlight in the same window / tab, but by pressing Ctrl-/ without selecting text, they will be shown in the keyword input box; period dot is no longer a keyword separator; quoted keywords now work properly (finanlly); Add external calling code (for like mouse gesture) "content.window.wrappedJSObject.EWH_iSearch();" to call the keyword input box; Other bug fixes and code improvement.| 行为变更:当有文本框外的文本被选中时按 Ctrl-/ 组合键将自动将选中文本作为关键词高亮;“Add/New”(添加/全新)输入关键词状态将持续至页面刷新;在禁用高亮后,下次在同一窗口/标签页添加高亮关键词时不再自动将之前的关键词加上,但在不选中文本按 Ctrl-/ 组合键时这些关键词仍会显示在关键词输入框中;句点不再作为关键词分隔符使用;半角双引号(")括住的关键词终于正常处理了;添加外部调用代码(用于鼠标手势调用)“content.window.wrappedJSObject.EWH_iSearch();”调出关键词输入框;其他修正和代码改进。
2010.12.02:
Version 1.5.5a: Fix a bug that cause an error that halt the script when running in non-GM environment; Fix a bug that cause keyword cleaning-up failure in some circumstances; Add external calling code (for like mouse gesture) "content.window.wrappedJSObject.EWH_cClose();" to call the disable-highlight command.| 修正一个会导致脚本在非GM环境中出错不能运行的问题;修正一个会在某些情况下导致清理关键词失败的问题;添加外部调用代码(用于鼠标手势调用)“content.window.wrappedJSObject.EWH_cClose();”调用停用高亮命令。
2010.12.16:
Version 1.5.6: Fix and improve the function to toggle all highlight, which makes it work under Opera (11 beta); Add a button to lock highlight map; Behavior change: now on non main-search-engine pages, inherited keywords will have higher priority. | 修正和改进切换所有关键词高亮的函数,使其在 Opera (11 beta) 下可用;添加锁定高亮分布图的按钮;行为变更:现在在非主要搜索引擎页面内,继承的关键词拥有更高优先级。
2011.06.19:
Version 1.5.7: Add support to new addon.mozilla.org search pages; Refine styles; Behavior change: now you can only move the panel by dragging the left handler; Behavior change: now you cannot drag the panel when it's minimized; Add an option in code to provide initial-minimized-state panel for auto-highlight; Add a line to improve language determination (thanks SoIN); Change the shortcut keys to activate the keyword input box: Alt-/ to activate, while Alt-. (that is Alt and Period) to edit keywords. | 添加对新 addon.mozilla.org 搜索页面的支持;改进样式;行为变更:现在只能通过拖动左边的手柄来移动面板;行为变更:面板最小化后不能拖动;增加代码中设置项:为自动高亮提供面板初始最小化状态;添加一行代码增强语言判断(多谢SoIN);调用关键词输入框的快捷键更换,Alt-/为调用关键词输入,Alt-.为编辑关键词。
2011.07.20:
Version 1.5.7a: Fix the key shortcut problem, now the shortcut for editing keyword work, and the shortcut for toggling all highlight changed to Alt-, ; Refine style; Enable the script to work in iframes (test); other small fixes. | 修正快捷键问题,现在编辑关键词的快捷键可正常使用了,而切换全部高亮的快捷键改为 Alt-, ;样式改进;在 iframe 中启用脚本(测试);其他小修正。
2011.11.10:
Version 1.5.7b: Fix the keyword getting issue for Google's redirection. | 修正 Google 重定向造成提取关键词的问题。
2017.09.22:
Version 1.5.9: 修复百度utf-8字符集问题。
Version 1.6.0: 添加对Google Map的https排除。
2022.01.15:
Version 1.6.2: 感谢 YFdyh000 ,修正了原脚本在新版Firefox按键失效的问题。
2022.02.03:
Version 1.6.3: 修正了原脚本在新版Firefox高亮地图的失效的问题。
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址