Persistent Persistent Searches
Introducing persistent searches in Gmail that are…persistent. First off, props to Mihai Parparita who did all the hard work for adding persistent searches to Gmail. I’ve added to Mihai’s script, so that the saved searches are stored in a special Gmail contact. Previously they were stored in a cookie. The advantages are two fold:
- You can access your saved searches (and only yours) from any computer as long as your browser has this script installed.
- Multiple people can use the same computer and browser while their saved searches remain separate and distinct from the other person’s.
Installation Instructions:
- Install Greasemonkey (only works with Firefox).
- Open up this user script (in Firefox).
- From the “Tools” menu, select “Install User Script..” and confirm all of the various prompts.
- Logout of Gmail and log back in.
FWIW, I hope to eventually add a few more unrelated features to Gmail via this script. For an overview of how my modifications work see my post on Cookies and Contacts.
Update: Gmail apparently changed a few things in their code this evening. I’ve updated one of the regex’s to work with this change. If you see that your saved searches aren’t being saved or restored properly, you’ll want to reinstall the script.
Update (December 1, 2005): The script has been updated to work with Firefox 1.5 and Greasemonkey 0.6.4.
thanks for this ….it’s really where it’s at!!
Javed
28 May 05 at 4:15 am
THX FOR THIS
Praveen
15 Jun 05 at 4:03 am
Very nice…but I’m not sure it’s “where it’s at.”
MJM
18 Jun 05 at 5:29 am
Well, it sort of works. I can save a persistent search, but every user of my computer ends up with the same saved searches. The first time I try to save any search I get a JavaScript error box that says something about contact operation resulted in error 500. This reappears when I click OK, then the second time goes for good. It looks as if the search is then saved in a cookie, since it isn’t available from another computer accessing the same account but remains available in any account from the same computer.
Mark
23 Jun 05 at 11:34 pm
Hmm, looks like you’re right. This must have to do with the change made to Gmail recently. I’ll have to take a look at this. Thanks for the heads-up.
Luke
24 Jun 05 at 7:42 am
Great plugin! Works really well. I’m only using it with one user on my machine, but it does the trick. Thanks for updating it!
Arian
24 Jun 05 at 9:36 pm
This works great. Thanks a lot.
Ben
4 Aug 05 at 9:47 am
[...] Suite à ma précédente note au sujet des plugins pour Firefox que j’utilise, voici une liste complémentaire d’extensions que j’utilise pratiquement chaque jour: – Feed your reader: cette extension permet d’utiliser le système de découverte automatique des flux RSS non plus pour s’abonner à des flux dans Firefox, mais pour pouvoir s’abonner directement dans l’un des clients RSS supportés. – Greasemonkey : cette extension permet d’utiliser des scripts qui modifient et/ou enrichissent des sites web existants… J’utilise pour le moment essentiellement des scripts modifiant GMail et me permettant d’avoir en permanence un bouton Delete ainsi qu’un système de recherches persistantes (l’équivalent des dossiers de recherche sous Outlook). – Keyconfig: cette extension permet de changer les raccourcis clavier de Firefox. – SpellBound: c’est un correcteur orthographique. Il permet de vérifier l’orthographe de ce que vous saisissez dans des formulaires. Je m’en sert essentiellement dans Gmail, car j’utilise l’interface en anglais de Gmail (il y a plus de fonctionnalités que dans la version française), et le correcteur de Gmail est directement lié à la langue de l’interface. Autrement dit, sous Gmail, on ne peut pas avoir une interface web en anglais et un correcteur en français! SpellBound est donc la solution presque idéale (la solution idéale, c’est de se souvenir de tout ce qu’on a appris à l’école, et de ne pas faire de fautes;)) – Tab Mix Plus: en remplacement de Tab Mix que j’utilisais avant, et qui dispose de plus de possibilités de personnalisation des onglets de Firefox. – Yoono: des suggestions, encore des suggestions, toujours des suggestions;) [...]
Veille Perso » Firefox et plugins - 2ème partie
6 Oct 05 at 12:31 pm
Now that FireFox 1.5 has been released, is there any chance you can update this to work with GM 0.6.x?
Thanks!
Alan Morgan
30 Nov 05 at 5:23 am
Yeah, I’ll try to find some time to figure out why it isn’t working in Firefox 1.5.
Luke
30 Nov 05 at 8:28 am
The script has been updated to work with Firefox 1.5 and Greasemonkey 0.6.4. Enjoy!
Luke
1 Dec 05 at 1:01 pm
Plugin works with new Firefox, new Greasemonkey and new script thx.
But I have one problem: I don’t see the little pictures in the search box. Whats wrong?
acidham
2 Dec 05 at 3:55 am
I’m not sure I know what you mean by “the little pictures in the search box”. Care to explain more or provide a screenshot? Thanks.
Luke
2 Dec 05 at 8:28 am
The little arrow in top left and the reload picture in right top corner. These pictures are broken. I saw you used base64 image inside the script. I always have problem with those images.
acidham
13 Dec 05 at 6:00 am
Great idea, thx. Looks like there is an issue with persistent searches that contain a ‘+’ character. I’m trying to save a search of the form “to:+teststr” (without the quotes), which is retreived as “to: teststr” when I use it.
arathorn
13 Dec 05 at 12:08 pm
I love this script. However I am seeing problems with an icon as shown here: http://static.flickr.com/42/81673428_dfb0293b5c.jpg?v=0. The little arrow loading icon stays in place no matter what. Any ideas?
Additionally, when I click on the yellow search bar nothing happens, I have to click on the arrow to expand the div, while the other gmail divs (labels and invites) allow you to click anywhere.
The ‘+’ character issue would be a nice fix as well. For Mihai’s script that adds the search parameters to whatever is already in the search box.
For what it’s worth, these are minor issues, and I plan on using this script regardless of their resolution. Maybe I’ll figure something out on my own.
sewpafly
3 Jan 06 at 4:13 pm
It’s great. But the Label “Today” which query “after:today” seems wrong (will be tomorrow?). The correct query is “after:yesterday”.
planetoid
15 Feb 06 at 9:58 pm
First of all, thanks for making a great Greasemonkey script even greater!
I’m using your version of the script since I move around to several different computers during the day. I’ve noticed it’s missing a few features from the original. Most important for me are the “additive” searches (include ++ to append a persisting search to the present query) and the up/down arrows to re-order the queries. Any reason why these features didn’t end up in your version? Thanks for the help!
Chad
20 Feb 06 at 11:12 am
Thanks for the terrific script.
I was looking through the code to try to make a small change so that the saved searches appear above my labels. I can tell the change should be made to the initializePersistentSearches function, and probably to the line
var labelsBlock = getNode(“nb_0″);
do you know the div id for the quick contacts box? if I were to change “nb_0″ to the quick contacts id do you think it would work correctly?
thanks
Michael
30 Apr 06 at 3:10 pm
nevermind, I got it… for anyone else wanting to know, change all occurences of nb_0 to nb_3 in the script to get the searches box to appear between the labels box and the quick contacts box.
Michael
30 Apr 06 at 3:29 pm
Got this working in my Gmail account, but I use Gmail hosted as well and it’s not working in there.
I don’t know the first thing about greasemonkey scripts, but I figured pulling out all instances of “/mail” (left the trailing slash), resaving as ssearch.user.js and installing it would do the trick.
No dice.
No box, no nada. Any ideas on how to get it working?
Jk
28 Jun 06 at 3:08 am
Currently I have: “Labels”, “Searches”, “Invite a friend”, in this order. I would like to put “Searches” above “Labels”. Can you help? I tried a few obvious tricks but could not get this to work. (Replacing nb_0 by nb_3 for example makes “Searches” completely dissapear). Thank you in advance.
Vern
3 Jul 06 at 10:46 am
First of all, Excellent work.
Upon creating a new search manually, I am able to create a persistent search record. Its working fine.
Mozilla version 2.0.0.3
Greasemonkey version 0.6.7.20070131.0
Upon performing Mail Search, the search is not stored are saved. I want the recent searches to be saved automatically, not sure if this is one of the feature of your greasemonkey script, and if yes, is it working fine. Pls advise, waiting..
Rachit
Rachit Shah
22 Mar 07 at 8:09 am
Can I increase the cookie time period, I dont need actually worry for stealth of cookie information. Can you spot the line number in the userscript to edit for increasing cookie expiration period.
Thanks
Rachit Shah
22 Mar 07 at 8:10 am
Mihai’s script actually has a functionality where the recent searches are saved automatically, I am not sure if its same with your script and if, is it working correctly. I tested Mihai’s script for this, its working fine, Your script I would like to use for persistent searches, but above feature is not working, my browser and addon versions are mentioned above posts. Pls advise.
Rachit
Rachit Shah
22 Mar 07 at 8:12 am
Hi!
Great work! Google says search instead of sort, but doesn’t provide features to enhance search…
Why not upload your work for http://userscripts.org? That is the place for greasemonkey scripts. Or am I wrong?
pihentagy
8 Apr 07 at 11:05 am
[...] Saved Searches (contact)ç¬¬äº”é …ã€Œé€²éšŽæœå°‹å¿«é€Ÿéµã€çš„å¦ä¸€å€‹ç‰ˆæœ¬ã€‚ [...]
《純æ•é”康》 » Firefox + Better Gmail:油猴速æˆå¯†æŠ€
19 Apr 07 at 8:15 am
Is there any way to make this work with Google Apps? I tried adding mail.google.com/a/* to the places it could run but it doesn’t create the fake contact in the contact section.
Thanks
Blake
2 Jun 07 at 3:08 pm
It is glad to a meeting!
;)
Theodore
9 Jul 07 at 5:51 am
Hope you’re still monitoring this. I love your script and have been using it faithfully in gmail. However, I’ve just moved to google apps mail and it seems not to work – the original cookie version does. Any ideas on an upgrade to cope with google apps mail?
Gary Lane
8 Aug 07 at 2:20 am
The search (contact) Seems to have broken with the new gmail. :(
Michael Bierman
6 Nov 07 at 6:26 pm
Indeed, it seems to cause some problems as of late.
It seems this happens:
An error saying “Contact creation failed” OR “You have been signed out
of this account. This may have happened automatically because another
user signed in from the same browser. To continue using this account,
you will need to sign in again. This is done to protect your account
and to ensure to privacy of your information.” Sometimes my inbox loads,
and then either immediately gives me one of the two above mentioned
error messages and sends me to the gmail login screen, OR my inbox
loads, and I can click on a message and then it gives me one of the two
errors and kicks me back to the login screen. Hmm.
Dustmo
8 Nov 07 at 7:59 am
Unfortunately, this Greasemonkey script no longer works with the newest version of Gmail. I’m told that the URLs for searches are now bookmarkable, so it seems like the use of this script is lessened. Right now, it is unlikely that I will update the script to work with the new version of Gmail.
Luke
8 Nov 07 at 8:45 am
Hmm, so bookmarking search URLs eh? Any way of getting them on the sidebar all spiffy like your script had them? :]
Dustmo
8 Nov 07 at 8:50 am