Gmail API extension / gadget - how to add a button to the layout toolbar?

I am trying to figure out how to add a button to the Gmail layout window.

In Gmail Labs, they have some extensions that add specific buttons. For example, the "Send and Archive" button and the "Insert Images" button, so I assume that this is possible.

I checked their API here and it seems that you can either add the gadget to the left sidebar or use contextual gadgets depending on the context of the messages. I am looking for a way to add a button to the toolbar of the layout window, and both options do not seem to support it.

Do you know how to do this?

If this is not possible using the Gmail API, is there any other way to achieve this? Perhaps creating a Google Chrome extension or custom scripts?

I would be grateful for any information that could direct me in the right direction.

Thank.

+17
google-chrome google-chrome-extension userscripts gmail gmail-contextual-gadgets
Dec 31 '11 at 18:43
source share
1 answer

Gmail Labs have special permissions because they were written by Google, unfortunately we don’t have that power. Of course, there is a way, and you correctly pointed out that this is done with the Chrome Extension or UserScript. If you decide to make the Chrome extension it will just be a wrapper for UserScript anyway

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).

Without additional information about what you want to do, I cannot provide much more help, but I can immediately help you with one problem. You have to make your script until the Gmail download process is completed, which is the problem. This is the solution that I am currently using in Minimalist:

function bootstrap() { target = document.querySelectorAll('.vt:not(.SFzvCe)'); if (document.querySelectorAll('html.xiu1Fc, html.aao')[0] == null) { return; } if (target.length > 0) { // loaded, do stuff } else { window.setTimeout(bootstrap, 200); } } window.addEventListener('DOMSubtreeModified', bootstrap); 

This version is waiting for a full chat download. Let me know if you have other questions: @anstosa

+23
Jan 01 '11 at 23:52
source share



All Articles