How do we add new button to gmail compose bar in chrome extension? Is it through javascript or some gmail apis? [closed]

旧城冷巷雨未停 提交于 2019-12-06 16:08:41

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!