Hi there. I'm on my way to creating a greasemonkey script for gmail.
The first thing I want to play with is reducing the size of 'main' pane. This is where either the list of emails are or where the email message is being displayed.
Using Firebug, I can find two separate instances of a "<div class="nH nn" style="width: 1013px;">
" tag. One changes the width of the background of the relevant pane, the other changes the width of the messages contained in the pane. Using Firebug I can change the width values in each of these tags to have the middle pane take up half the available space, for example.
How should I do this using Greasemonkey? Is the gmailAPI the way to go? The wiki here:
http://code.google.com/p/gmail-greasemonkey/wiki/GmailGreasemonkey10API
doesn't give much description for each method. Would gmail.getMastheadElement() maybe be it?
Or would more of a standard DOM transverse approach be better than dealing with the API? If so, I'm not sure how to target those particular divs. They're only using the classes "nH nn" for identification, which seem to be reused multiple times throughout the gmail code.
Thanks.
UPDATE: Wish we could put code in replies to answers... here's the thing that I'm trying. Where is this going wrong?
window.addEventListener('load', function() {
if (unsafeWindow.gmonkey) {
unsafeWindow.gmonkey.load('1.0', function(gmail) {
gmail.getActiveViewElement().style.width = "500px";
});
}
}, true);