I've written a couple of articles on the proper Gmail API, why doesn't this just use that instead of scraping the DOM?<p><a href="https://www.sitepoint.com/mastering-your-inbox-with-gmail-javascript-api/" rel="nofollow">https://www.sitepoint.com/mastering-your-inbox-with-gmail-ja...</a>
<a href="https://www.sitepoint.com/sending-emails-gmail-javascript-api/" rel="nofollow">https://www.sitepoint.com/sending-emails-gmail-javascript-ap...</a>
We used this for a project before, just be aware that the DOM changes regularly for gmail, and if an API you rely on breaks you will be SOL until someone fixes it.
This is a great library. Standardizes most of DOM manipulation/action triggering for everything Gmail does. Although Gmail's DOM changes sometimes like seibelj pointed out, you'll have the same issue if you roll your own implementation, so, for me, this is preferable.<p>If I remember right, it underwent a major rewrite a year or so ago, after which is has been very solid.
You may be interested to know Google has an official REST API and associated Javascript library. <a href="https://developers.google.com/gmail/api/" rel="nofollow">https://developers.google.com/gmail/api/</a>
<a href="https://developers.google.com/gmail/api/quickstart/js" rel="nofollow">https://developers.google.com/gmail/api/quickstart/js</a>
Now for somebody to use this to write a Gmail extension that removes the hundred-levels-deep signature and reply chains that Outlook appends (and which evades Gmail's currently reply-collapsing).
I want to thank the author. Like many users, to repeat this project entirely on my own would be a nightmare. The GMail HTML source produced from the server is "minified". Random, meaningless class and id names. Author took on the burden and made Gmail more accessible for browser extension/add-on. I implemented a FireFox addon (for accessibility purpose for my senior thesis) using Gmail.js. Furthermore, the code is very readable and the API is extremely intuitive and well-designed.
Thank you!