gmail-app-badge-notification
gmail-app-badge-notification copied to clipboard
Support multiple Gmail accounts
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.
@aberonni do you have any pointers on how to implement this? I can give it a shot.
@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
@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.
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 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.