When reading forums, I'd like to be able to have customizable keyword filters to hide certain rows.
For example on this forum, I'd like to hide any rows for certain usernames (3rd column).
Is it difficult to write a Greasemonkey script that could do this, only on this site?
Or is there a Firefox addon that does this kind of thing?
It is not hard to write a userscript to hide rows by keyword.
Suppose you had a table like this:
And you wanted to hide rows that contained
Fred
.Using the awesome power of jQuery, you could do that with one line:
If you wanted to restrict the match to the 3rd column (Author, in this case), you could use:
Please note that
:contains()
is case-sensitive.Online demo: (Show and run the code snippet.)
Use this in a userscript, like so:
IMPORTANT: You need to replace
.filterMe
with a valid selector for your site. Use tools like Firebug to help you determine a unique jQuery selector for your desired table.Also alter the
nth-of-type()
index as needed.Or, for an AJAX-driven site:
For multiple keywords: