Community-edition: No red dot notif for the new Gmail interface

Created on 11 May 2018  路  11Comments  路  Source: ramboxapp/community-edition

Steps to reproduce

  1. add Gmail service
  2. switch to new gmail interface

Expected behavior

a red dot should be on the rambox icon whenever there's an unread email.

Actual behavior

no red dot.

ENVIRONMENT

Rambox: v0.5.17

OS: macOS High Sierra 10.13.4

Arch: x64

Most helpful comment

for the element selection portion of the script, i made this change:

- var e = document.getElementsByClassName("bsU");
+ var e = document.querySelectorAll(".ain .bsU");

...which only selects the unread count from the "inbox" section. Seems to work for me.

I also didn't have to create the gmail tab as a "_Custom Service", the normal Gmail selection has a spot to enter custom code.

Thank you @ashvagan for the workaround! 馃嵒

All 11 comments

What is "new gmail interface"? Could you provide screenshot?

it looks like thise: image

bump

Here is how I fixed it:

  • Add Gmail as a _Custom Service
  • While adding, in advance custom code, add the following code:
function checkUnread() {
    var e = document.getElementsByClassName("bsU");
    var t = 0;
    for( i = 0; i < e.length; i++ ) t += parseInt(e[i].innerHTML.trim());
    updateBadge(t);
}

function updateBadge(e) {
    if (e && e >= 1) {
        rambox.setUnreadCount(e);
    } else {
        rambox.clearUnreadCount();
    }
}

setInterval(checkUnread, 3000);

One downside to the above hack is that it displays the total counter of all unread emails in all folders/labels in Gmail.

@ashvagan You can change it to show unread mail count only (not sum of all folders) by changing the for loop to this;

for( i = 0; i < e.length; i++ ) t += parseInt(e[i].innerHTML.trim());

if (e.length > 0) {
    t += parseInt(e[0].innerHTML.trim());
}

for the element selection portion of the script, i made this change:

- var e = document.getElementsByClassName("bsU");
+ var e = document.querySelectorAll(".ain .bsU");

...which only selects the unread count from the "inbox" section. Seems to work for me.

I also didn't have to create the gmail tab as a "_Custom Service", the normal Gmail selection has a spot to enter custom code.

Thank you @ashvagan for the workaround! 馃嵒

Why has this been closed? The code supplied is a workaround, not a fix. Rambox should support this natively.

Because the fix was already merged and will be shiped in next release??

@Ash258 when is the next released planned? Gmail is forcing everyone to move to the new design it would be nice to have rambox ready for it.

Soon. After @saenzramiro finish CI/CD problems / tweaks and relese it.

Soon

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

saalkom picture saalkom  路  3Comments

igalic picture igalic  路  3Comments

jamy015 picture jamy015  路  4Comments

julien-tmp picture julien-tmp  路  4Comments

soulchainer picture soulchainer  路  3Comments