Gmail Conversation Preview Bubbles #
Update on 12/23/2005: The script has been updated to be compatible with Firefox 1.5. See this entry for more information.
Update on 8/28/2005: A bug that prevented the bubble from working correctly once a a conversation had been archived or trashed has been fixed. Please reinstall the script to use this updated version.
Short Version
Want preview bubbles for conversations in Gmail, as shown in the screenshot on the left? Then install the Gmail Conversation Preview Greasemonkey script. You can then right-click on any conversation to see its recent messages in a preview bubble. Greasemonkey 0.5 is required. Should work in Greasemonkey 0.3.5 or 0.5 (neither one has the security issues that plagued earlier versions).
Full Story
One of the things touted by the upcoming Yahoo Mail and Hotmail releases is that they will have a preview/reading pane which will let you see message contents at a glance without having to navigate to an entirely new view. Gmail offers a lightweight version of this already, by showing the first hundred or so characters of each message as a snippet next to the subject. While this is handy for one-liner emails, a full-blown preview pane is often more appropriate.
Given my past experiences with Gmail and Greasemonkey, I figured that adding a preview area to Gmail may just be possible. Ignoring the technical aspects, the first issue was deciding what it should look like. My main issue with traditional preview panes is that they take up a lot of room, even when they aren't needed. Eventually, I was inspired by Google Map's bubbles and decided to try that approach.
I initially triggered the bubbles on mouse hovering, but that was not a good fit: fetching the entire conversation is a heavy-weight operation with some latency while data that appears on hover should be light-weight and display instantaneously. I then tried inserting a small magnifying glass icon within each conversation row that when clicked showed the bubble. However, the icon was too small and hard to click on (Fitts' law and all that). I then considered a keyboard modifier plus mouse click as a trigger, but that seemed like too much effort on the part of the user. In the end, attaching it to right-click seemed like the best choice. Since Gmail doesn't use real links, the contextual menu triggered by the right mouse button is mostly useless, thus overriding it seemed like an acceptable tradeoff. Furthermore, this trigger means that the user does not have to take his/her hand off the mouse. To also facilitate those who use Gmail's many keyboard shortcuts, the V key was made to toggle the preview bubble for the current conversation.
Integrating the preview bubble as smoothly as possible with the rest of the Gmail interface was also a challenge. Given a message ID, it's reasonably easy to fetch its contents (making a GET
request for URLs of the form &view=cv&search=all&th=message-id&lvp=-1&cvp=2&qt=
). However, message IDs are not stored in the DOM directly. Instead, it turns out we can leverage Gmail's communication scheme in order to get this information. As others have documented, Gmail receives data from the server in form of JavaScript snippets. Looking at the top of any conversation list's source, we can see that the D()
function that receives data in turns calls a function P()
in the frame where all the JavaScript resides. Since all data must pass through this global P()
function, we can use Greasemonkey to hook into it. This is similar to the trap patching way of extending Classic Mac OS. Specifically, the Greasemonkey script gets a hold of the current P()
function and replaces it with a version that first records relevant data in an internal array, and then calls the original function (so that Gmail operations are not affected). Once we have the list of conversations (including IDs) in hand, we can easily map it to its corresponding DOM nodes (each conversation's row has the ID w_message-id
) and show the appropriate bubble.
The script also tries to do clever things by resizing the bubble so that it best fits the displayed messages. Since fetching a conversation implicitly marks it as read, a "Leave Unread" option is provided that actually does a POST
request to the server with the appropriate mark as unread command (LiveHTTPHeaders is indispensable for figuring this out). To parse data from a fetched conversation, we grab the appropriate JavaScript text and eval()
it while defining the appropriate D()
function that extracts the data. In general, the script code is architected the script reasonably cleanly, with a PreviewBubble
object with appropriate methods and comments for non-intuitive places, thus it should be ready to hacked on by other people.
There are still some rough edges, as well as some drawing bugs in Deer Park that may or may not be my fault. However, I have been using it for the past few weeks and it's very handy when going through lots of email quickly that needs to be read but not necessarily replied to.
(the usual) Disclaimer: I happen to work for Google. This script was produced without any internal knowledge of Gmail, and is not endorsed by Google in any way. If you have any problems with it, please contact only me.
76 Comments
This is, for me, hands down the best Greasemonkey script yet. It has changed the way I use Gmail, and I can't live without it.
You should get Google to add this into Gmail for real! :)
no matter what i do, i can't get this script to work. i have firefox 1.5 beta 1/greasemonkey 0.6.2
Also the bubble preview, even the updated version, does not worl for archived emails!!
Thanks for your time, and it looks like a great script and a nice addition, just wish I could try it.
The thing though is that once you switch conversation lists (ie, search, click on all mail, etc), it no longer works. I'm pretty sure its the same way using the script you posted without modifying it. Is that the intended behavior at this point?
Thanks again!
The thing though is that once you switch conversation lists (ie, search, click on all mail, etc), it no longer works. I'm pretty sure its the same way using the script you posted without modifying it. Is that the intended behavior at this point?
Thanks again!
Greasemonkey 0.62
Preview bubbles not working ?
Could you
for ( i =0 ; i < MAX_INT ; i++)
print (" Please ");
Fix this ?
Greasemonkey 0.62
Preview bubbles not working ?
Could you
for ( i =0 ; i < MAX_INT ; i++)
print (" Please ");
Fix this ?
http://www.mozdev.org/pipermail/greasemonkey/2005-October/006501.html
*but* it seem very easy to break (ie just open the span folder), and when it stops working, a refresh doesn't seems to fix it.
logging out and logging in to gmail does fix it though.
maybe this will get polished, or taken up by the official gmail team as a new feature.
right now, it's alpha quality for sure.
thanks very much anyway, makes life much nicer in gmail. :-)
darren.
//Johan
Suggestion for a future script: Let the user to decide to organize conversation(s) according to user. It would help organize ongoing collaborative projects. Of course, I have no idea if it is possible.
Thoughts?
(darren | November 21, 2005 03:36 PM
This great script doesn't seem to work with Firefox 1.5 and Greasemonkey 0.6.4 ...
//Johan
Posted by: Johan | December 2, 2005 01:36 AM
Having the same trouble as Johan. All I'm getting is the context menu on right click. Any chance of an updated script coming out?)
some suggestions?? please mi mail es damian38@gmail.com the anothers scripts run ok , but the prewiw bubbles not, is because my firefox is in spanish?? help!!!!!
Damian, make sure you have an updated version of the script (the initial release didn't work with Firefox 1.5, but the current one does).
As much as I love this script, a mouseover *option* would be very useful. I can see what you wouldn't want to have it as the only choice. But, it would allow for far quicker scanning of email if mouseover did exist.
I love your execution of this idea. The bubbles work great, as do the top line of options.
I hope your Gmail peers have taken notice of this at Google. It would amount to the best feature implementation yet, if they introduced it.
Nicely done!! Thank you!!!!!!!!
Rory
Best Gmail feature yet! Best Greasemonkey script yet! Now, if only Gmail would integrate the feature (with right-click and mouseover options) in to their feature set.
Nicely done! Thanks!
Rory
This would be really cool if it worked with the Gmail preview on the Google custom homepage."
Ooo... that's an awesome idea. Extend Gmail fucntionality on to the Google Personalized Homepage.
Sweet, idea.
R.
Thanks in any case! should be standard.
Thanks
Thanks
Thanks for the great script.
I get this error:
http://img59.imageshack.us/img59/3300/picture31fj.png
Thanks!
Is this the fault of the script, or is it working for you guys?
Problem: if you try to "Archive" selected msg, not only that msg but ANY OTHER CHECKED MSGS get archived! This is an unintentional side effect of clicking "Archive" while looking at a single msg...
Any way around this?
Thanks,
Aaron
http://s69.photobucket.com/albums/i54/DaComboMan/?sc=1&addtype=local
Just to say thanks for this script, it's so useful! Thanks again, and keep making cool scripts!
How difficult would it be to have a quick reply link
Any suggestions would be much appreciated.
Great script btw!
James
James
what am i doing wrong.
Anyone else having this problem?
Thanks.
Here is a screenshot when a mail item is right-clicked while in the inbox.
http://negativetwelve.com/images/gmailscreenshot.JPG
The bubble opens in the far right cornerand open in correct position only for conversations with labels
A little work is needed in the
function
getAbsolutePosition(node)
{
}
so as to accommodate Conversation entries with and without labels.
I concur, that this is indeed causing the same problem for me. Now I really love this plug-in, and would hate to stop its use. I really hope the issue can be resolved in a future update to the product.
Thanks for an otherwise great product.
I am in trouble with Conversation Preview.
I've installed it (through the BetterGmail package, but also individually) and it doesn't seem to work.
When I right-click on conversation, I see the bubble and inside it says 'loading...' and remains so forever. The actual contents of the conversation never show up.
Did anyone encounter this?
Using: FF2.0 plus BetterGmail 1.0 and a couple of other FF modules. I use Gmail old version.
Many thanks !!
Thanks in advance for any help you can offer.
I have Firefox 2.0.0.14 and GreaseMonkey 0.7.20080121.0 installed..
Pls update....
Hi, it seems that Gmail renamed its functions, and top.js.P is no longer the function through which all data is routed (or even a function). How can one find out the right function, or just find the message IDs?
Maybe this can be integrated into Better Gmail 2, don't know, but it seems to work pretty well.
I've tried to repair a few different ones, but didn't really know where to look or what to patch.
Post a Comment