

The Pain of Building a Gmail Chrome Extension - kirubakaran
http://blog.inboxhooks.com/86999859

======
allenc
Couldn't comment on the blog itself, but Gmail simply uses Google Closure and
its compiler to get minified Javascript + DOM.

And it so happens that Closure code tends to create a ton of extra DOM
structure within the JS code, so the 50-level-deep <div> tree isn't much of a
surprise, especially with something as complex as the Gmail UI.

------
dividuum
Do you know the greasemonkey API gmail provides? Maybe it solves some of your
problems: [http://code.google.com/p/gmail-
greasemonkey/wiki/GmailGrease...](http://code.google.com/p/gmail-
greasemonkey/wiki/GmailGreasemonkey10API)

I just poked around: there seems to be a 2.0 API.

In the web inspector console on any open gmail page:

    
    
      > gmonkey.info("2.0")
      "The "gmonkey" module is not officially supported and is subject 
      to change, we will support previous versions for at least 1-month.  
      Use gmonkey.load(v, callback) to load in the full API where v is 
      the version number of the API you want passed to calback.  Latest 
      set of the bindings is "2.0".  kthxbye"

~~~
nicholasreed
GmailGreasemonkey is definitely useful to any Gmail extension developer.
Unfortunately there really isn't much discussion happening around updates and
you end up running into little problems such as ready().

------
eli
Well.... I'm pretty sure Google doesn't want you doing that, so it's no
surprise they didn't make it easy (and perhaps even went out of their way to
make it hard)

------
wikyd
How does Baydin's Boomerang handle these complexities?

~~~
nicholasreed
They don't seem to be using GMonkey at all. The source for their plugin is at
[https://b4g.baydin.com/site_media/bookmarklet/b4g_bookmarkle...](https://b4g.baydin.com/site_media/bookmarklet/b4g_bookmarklet.js)

