Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/stats.js

Issue 29721684: Issue 5241 - Don't update the badge text again for frame navigations (Closed)
Patch Set: Created March 13, 2018, 3:28 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/stats.js
diff --git a/lib/stats.js b/lib/stats.js
index ae586b8f0989cc15b3da1271051b629ac8b6b380..887118ac50a2c9730350809dbc473d8b6591a23b 100644
--- a/lib/stats.js
+++ b/lib/stats.js
@@ -41,13 +41,16 @@ exports.getBlockedPerPage = page => blockedPerPage.get(page) || 0;
// blocked beforehand we display those on the badge now.
browser.webNavigation.onCommitted.addListener(details =>
{
- let page = new ext.Page({id: details.tabId});
- let blocked = blockedPerPage.get(page);
+ if (details.frameId == 0)
+ {
+ let page = new ext.Page({id: details.tabId});
+ let blocked = blockedPerPage.get(page);
- page.browserAction.setBadge(blocked && {
- color: badgeColor,
- number: blocked
- });
+ page.browserAction.setBadge(blocked && {
+ color: badgeColor,
+ number: blocked
+ });
+ }
});
FilterNotifier.on("filter.hitCount", (filter, newValue, oldValue, page) =>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld