gmail.js icon indicating copy to clipboard operation
gmail.js copied to clipboard

Add a new button in toolbar(Question)

Open SudarsananS opened this issue 7 years ago • 6 comments

Hello I am looking for a way to add a new button in toolbar next to More Dropdown.I had a look at the gmail.js and see that api.tools.add_toolbar_button is available to do the same.

Is that the right method to use?Please let me know.

SudarsananS avatar Jul 26 '18 16:07 SudarsananS

Try it and see if it fits your needs?

If you need to fool around, try compiling the extension in the boilerplate project, and just play around with the gmail-variable available in the developer console.

josteink avatar Jul 28 '18 09:07 josteink

Also has anyone tested this in new Gmail UI?We are trying to add a button in Gmail UI(old) and making sure the new UI wont break it.

SudarsananS avatar Aug 02 '18 17:08 SudarsananS

I tried with this:

gmail.tools.add_toolbar_button("zeh click", () => { console.log("ZEH CLICK!"); });

Tested and works for fine for me in both old and new Gmail.

josteink avatar Aug 03 '18 07:08 josteink

toolbar button seems to disappear when you navigate away from inbox view for me (click a mail, go to sent emails, etc).

ckarcz avatar Aug 23 '18 14:08 ckarcz

That’s a known issue with a known workaround. Please search closed issues for a way to handle this.

josteink avatar Aug 23 '18 14:08 josteink

@josteink yup, thanks. i just found that after i wrote my comment.

workaround is detailed here for those needing it

ckarcz avatar Aug 23 '18 14:08 ckarcz

toolbar button seems to disappear when you navigate away from inbox view for me (click a mail, go to sent emails, etc).

I am getting the same problem, I tried the workaround (checking for element then removing it and adding it again) but it didn't work. Another problems I spotted is, if you don't start browsing from inbox (let's say you open your gmail in the sent folder) even if you go to inbox, the button won't render, the element is there, just invisible, any new fixes for it?

MattIrineu avatar Jan 23 '23 15:01 MattIrineu

I tried with this:

gmail.tools.add_toolbar_button("zeh click", () => { console.log("ZEH CLICK!"); });

Tested and works for fine for me in both old and new Gmail.

I doesn't work for me can you explain me how to use this properly

VarshiniV11 avatar Sep 10 '23 10:09 VarshiniV11

Old issue is old. Closing! :)

josteink avatar Oct 11 '23 08:10 josteink