TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Bookmarklet to filter HN by regex-enabled keywords.

3 点作者 CodeFoo将近 12 年前
This is a small bookmarklet that adds a background color to articles matching keywords, making it easier to distinguish links important to you. Tested in Chrome 27, Firefox 21 and Safari 6.0.5.<p>Preview: http:&#x2F;&#x2F;i.imgur.com&#x2F;6A3CU6T.png<p>1. Modify the OPTIONS.color and OPTIONS.keywords properties to your liking. You may use regex in the keywords. Keywords are case-insensitive.<p>2. Paste the bookmarklet below as the URL to a bookmark. You have to click this bookmark on every refresh, therefore you may want to place it on your &quot;Bookmarks Bar&quot; for quick access.<p>javascript:(function(){var OPTIONS={keywords:[&quot;surveillance&quot;,&quot;nsa&quot;,&quot;prism&quot;,&quot;privacy&quot;,&quot;government&quot;],color:&quot;#f4c3c3&quot;};NodeList.prototype.forEach=Array.prototype.forEach;document.querySelectorAll(&#x27;.title&gt;a&#x27;).forEach(function(e){if(e.firstChild.nodeValue==&#x27;More&#x27;)return;if(new RegExp(OPTIONS.keywords.join(&#x27;|&#x27;), &#x27;i&#x27;).test(e.firstChild.nodeValue)){e.parentNode.parentNode.style.backgroundColor=OPTIONS.color;e.parentNode.parentNode.nextSibling.style.backgroundColor=OPTIONS.color}})})()

暂无评论

暂无评论