Gmail has a seemingly simple but actually powerful filtering system. The "Has the words" input field can be used for arbitrary queries. However, the one line input is very cramped when trying to filter multiple mailing lists at once. A textarea would be more appropriate.
Initially, this seemed like a job for Greasemonkey. However, since the filter input form is created dynamically, it's hard to detect when it's visible without resorting to polling. Instead, it seemed easier to find the right node with a CSS selector like input[name="cf1_has"]
. Then, XBL can be used to replace the input node with a textarea node (styled appropriately). All that's really necessary is to insert the following in userContent.css
:
@-moz-document domain(mail.google.com) { input[name="cf1_has"] { display: none; -moz-binding: url(http://persistent.info/files/gmail-filter.xml#filter); } }
The XBL file is pretty straightforward (it didn't look like I could use the <content>
element to insert the textarea, since that would've placed it as a child of the input node).
For the paranoid (or merely careful), it's best to make a local copy of the XBL file, otherwise you're always going to be loading code from my site. I tried to use a data:
URL, to make things self-containde, but it didn't seem to work.
5/1/2006 8:47:21 PM Post by[persistent.info]
评论