0

If you see in the image, there is a "Remind me" button which comes up on installing any.do extension.

I am trying to come up with a chrome extension to add some functionality to gmail. I have been using any.do and wanted to understand how can we do something similar?

Do we inject our new div element in the DOM or are there any gmail apis through which I can add a new button and define action listener?

1
  • 2
    look at the code in that extension. no theres no api. Commented Feb 26, 2017 at 13:02

1 Answer 1

6

I offer to you to use in this Libraries:

  • InboxSdk - high level JavaScript library used to easily build browser extensions that interact with both Gmail and Inbox by Google.
  • Gmail library github - Great library that using the DOM for many options of gmail

Best option for you I think will be InboxSdk. First you need to register your app here ,Then on your content page of your chrome-extension set :

InboxSDK.load('1.0', 'YOUR_APP_ID_HERE').then(function(sdk){ 

In this function you need to perform all actions . You could register events ( like when you read/compose message etc.) but your purpose is to add button to tool bar so you need to add a toolbar event:

registerToolbarButtonForList(toolbarButtonDescriptor) 

or

registerToolbarButtonForThreadView(toolbarButtonDescriptor) 

or

addToolbarButtonForApp(appToolbarButtonDescriptor) 

If you want to know specific about every register event go to here

The object the event get it's all the deatils about the button(name, on click event etc) , see this here . From here you could set what ever you want from your button in the object .

Good luck

Sign up to request clarification or add additional context in comments.

3 Comments

It's really help sources and very easy to use them to his purpose .I could help more and improve the answer by step by step but everything write in their documentation there.
I change my answer. if it's not ok now I will delete it . just tell me . I don't want my rank will down because of this . I just try to help .
This answer is what I was looking for, thanks for sharing @OriEng

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.