I'm trying to develop a chrome extension to interact with an email inside gmail inbox. Currently I'm using page action to show the icon of the extension and when user clicks on the icon, the plugin assumes the opened page is an email inside gmail inbox and it interacts with the email.
But it seems to be better if I can add a button to gmail web interface instead of the page action icon like below (notice the add button added by a plugin called todoist). 
One way to do this is to observe html in other buttons provided by gmail, and injecting a new button with the content script. But the classes used in elements in gmail seems to be have no verbal meaning and not sure the classes change dynamically. For example to define an icon, the html is like below.
<div class="ase T-I-J3 J-J5-Ji"></div> Injecting may not work if the classes are changing dynamically. Also the button structure may change if the user changes different themes. (Or may be they are always the same and I can continue injecting)
Is there a standard way to do this? Or else, a stable way to inject the button?
Note: Contextual gadgets is not a solution as I want to get the attachment.


actattribute which might contain a relatively permanent action ID.