Adding Persistent Searches to Gmail


 

I’ve never found the need for persistent searches in my email, but that doesn’t mean you guys haven’t. Here is a great tutorial by the persistent.info guy (a Google employee) that shows you how to setup persistent searches in your Gmail accounts.

The user script has a pretty straightforward implementation. It looks for the “Labels” box, and if it finds one, it inserts a “Searches” one. As previously mentioned, I store all the searches in a cookie. To actually perform a search, I created a an XMLHttpRequest object and use it to fetch the search results for each saved search. The response contains in it the total number of messages that matched the query. It would’ve been nice to use the DOM (and then a JavaScript eval()) to parse it, but this turned out to be more difficult than expected (XMLHttpRequest only provides a parsed DOM for XML documents).


 

Leave a Comment

Your email address will not be published.

*