How to disappear badge from the chrome extension

202 views
Skip to first unread message

nikita tank

unread,
Aug 31, 2018, 5:16:44 PM8/31/18
to Chromium-extensions

Hello everyone,

when user will click on the chrome extension it will display new courses from the feed and it will count the number of courses and set as a badge on the chrome extension. 


I want to make this functionality like Facebook notification. meaning when user will click on the chrome extension that badge should be disappear until new items are loaded on the news feed

--
Sincerely,
Nikita Tank
Computer Science Student at CSUF

PhistucK

unread,
Aug 31, 2018, 5:48:14 PM8/31/18
to nikita tank, Chromium-extensions
Did you try setting the badge text to an empty string?

PhistucK


--
You received this message because you are subscribed to the Google Groups "Chromium-Extensions-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/CA%2BBk488MkCVCq8SMOz2Nc%3Du_oAUnDaUBr-E3frSiTigD_HA0ag%40mail.gmail.com.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

nikita tank

unread,
Aug 31, 2018, 6:02:59 PM8/31/18
to Chromium-extensions
Do u mean{ text : “” } !!!

I am loading all the title from rss feed and am printing that as chrome.browserAction.setBadgeText({text:count}). 

But that count is not disappearing after i click on icon and bot apeearing after installtion of the extension. 

PhistucK

unread,
Aug 31, 2018, 6:22:03 PM8/31/18
to nikita tank, Chromium-extensions
Is count the empty string at that point?
Maybe {text: count || ''} would do it?

PhistucK


--
You received this message because you are subscribed to the Google Groups "Chromium-Extensions-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-extensions/.

nikita tank

unread,
Aug 31, 2018, 6:27:15 PM8/31/18
to PhistucK, Chromium-extensions
no

PhistucK

unread,
Sep 2, 2018, 3:19:24 AM9/2/18
to nikita tank, Chromium-extensions
This is what I did and it works -
var count = message.count;
count = count < 0? 0: count;
chrome.browserAction.setBadgeText({text: (count || "").toString()});

PhistucK

Reply all
Reply to author
Forward
0 new messages