I'm thinking of developing a Chrome extension for Gmail, and I want to know what are the current best practices.
For example:
- binding of the default GPG signature to each letter
- adding an extra button that does something (I already have)
- capturing email sending actions and prompting me to do something complete
- ...
- (only examples to help me find out what is possible)
There are many notable extensions that greatly enhance the functionality of gmail:
One option is to look at their source, which is located here ~/Library/Application Support/Google/Chrome/Default
But maybe there is (wishful thinking) a good tutorial / lots of practice on how to mess with the gmail interface and functionality?
Gmail extension / gadget API - how to add a button to the layout toolbar?
You will need to create and enter the program programmatically. This will include quite a bit of cleaning up the Gmail source code (spoiler: it's ugly).
How to create a chrome extension to add a panel to gmail windows?
The biggest long-term challenge that you will face is that the gmail layout will suddenly change and disrupt email detection or a changed interface. Both of these questions require some trick to resolve or require you to stay at night, wondering if Google will suddenly break your extension.
http://www.jamesyu.org/2011/02/05/introducing-gmailr-an-unofficial-javscript-api-for-gmail/
They all build complex APIs with similar functionality that can all break independently if Gmail decides to significantly change the structure of their application (which will inevitably happen).
Gmail runs its code through the closure compiler, thereby confusing everything. In addition, Gmail is probably one of the most complex javascript applications.
Parse founder's library - https://github.com/jamesyu/gmailr - but did not update after 1.5 years.
I can show you what I got so far and just know that I donโt particularly like selectors like .oh.JZI.J-J5-Ji.TI-ax7
Note: http://anurag-maher.blogspot.co.uk/2012/12/developing-google-chrome-extension-for.html (he also does this, he also uses such confusing selectors)
manifest.json
"content_scripts": [ { "matches": ["https://mail.google.com/*"], "css": ["mystyles.css"], "js": ["jquery-2.1.0.js", "myscript.js"] } ]
myscript.js
var icon = jQuery(".oh.JZI.J-J5-Ji.TI-ax7") var clone = icon.clone(); clone.attr("data-tooltip", "my tooltip"); clone.on("click", function() { jQuery(".aDg").append("<p class='popup'>... sample content ...</p>"); }); icon.before(clone);
(reusing existing user interface elements, so my functions look initially)
https://developers.google.com/gmail/gadgets_overview
There are sidebar gadgets and contextual gadgets, but they donโt offer what I want to achieve.
Gmail Labs is a testing ground for experimental features that aren't quite ready for prime time. They can change, break or disappear at any time.
https://groups.google.com/forum/#!forum/gmail-labs-suggest-a-labs-feature It seems that the ability to develop Gmail Labs is blocked for Google employees.
https://developers.google.com/gmail/
Help is needed? Find us in qaru under the gmail tag.
So, yes, I would really like to know if there are textbooks / reference materials there?
(I looked at many โsimilar questions,โ and I'm afraid my options here are limited, but I would be very happy if I strengthened my enlightenment on me)