gmail-app-badge-notification icon indicating copy to clipboard operation
gmail-app-badge-notification copied to clipboard

Support multiple Gmail accounts

Open aertmann opened this issue 4 years ago • 5 comments

Currently the extension only works for the primary Gmail account since the endpoint URL is hardcoded. I'd like use the extension for a secondary account (https://mail.google.com/mail/u/1/feed/atom). Not sure how this should be configured, but a flexible solution would be ideal.

aertmann avatar Jan 27 '21 21:01 aertmann

@aberonni do you have any pointers on how to implement this? I can give it a shot.

binarylogic avatar Feb 18 '21 16:02 binarylogic

@binarylogic that would be great!

You need to give the user the option to configure the URL that is used here: https://github.com/aberonni/gmail-app-badge-notification/blob/master/src/content.js#L22

I don't know how that should be configured, as I don't use multiple accounts and I don't fully understand the use case.

What I can tell you is that the default should not change, and that you can easily add an options page where users can configure options. I've done something similar with another extension here: https://github.com/aberonni/open-in-vscode/blob/master/src/manifest.json#L20

aberonni avatar Feb 18 '21 17:02 aberonni

@binarylogic @aberonni I'm not a JS developer, so I'm not surprised that I'm having issues. I just did a quick edit on a fork to change the URL to 'https://mail.google.com/mail/u/1/feed/atom?_='. What breaks then is that the badges show up on the app icon for the first gmail account, not the second.

hjrrockies avatar Mar 08 '21 17:03 hjrrockies

I've tried a different approach now that I've understood how the different URLs are built. You might want to give this branch a try and let me know whether it works: https://github.com/aberonni/gmail-app-badge-notification/pull/7

I haven't tested it at all so there might by typos, breaking changes, etc...

aberonni avatar Mar 08 '21 17:03 aberonni

@aberonni The badge for the second inbox is still displaying on the first inbox's app icon. See the attached screenshot. My guess is that it's an issue with the call to navigator.setAppBadge?

EDIT: I should clarify that the badge displays the unread count for whichever of the two inboxes updated the count most recently. gmail-badge-extension-issue

hjrrockies avatar Mar 08 '21 19:03 hjrrockies