I want to read the contents of Gmail messages and add some fancyness on links. Here's some code:
unsafeWindow.gmonkey.load("1.0", function(gmail){
gmail.registerViewChangeCallback(function(){
if (gmail.getActiveViewType && gmail.getActiveViewType() == "cv") {
var viewElement = gmail.getActiveViewElement()
// Do things with viewElement
}
})
})
The actual detection of links in the dom objects for the mails is the easy part. The problem is that the registerViewChangeCallback
only runs when you display a thread. Large threads will have most of it's messages hidden, only to be loaded by a users request. I haven't found a Gmail greasemonkey API method for this particular action (loading a individual message), which is when I need to run my script.
Any suggestions?