diff --git a/core/state-manager.js b/core/state-manager.js index ba7d472fa87a8d2b389bb50c93c536c3425fb9f9..8f4639bd8e03f40537c15a381313fddd50a55e12 100644 --- a/core/state-manager.js +++ b/core/state-manager.js @@ -44,6 +44,14 @@ stateManager.registerInjection = function (tabIdentifier, injection) { } } + if (injectionCount > 0) { + let title = 'Decentraleyes (' + injectionCount.toString() + ')'; + wrappers.setTitle({ + 'title': title, + 'tabId': tabIdentifier + }); + } + if (isNaN(interceptor.amountInjected)) { chrome.storage.local.get(Setting.AMOUNT_INJECTED, function (items) { diff --git a/modules/internal/wrappers.js b/modules/internal/wrappers.js index faf1033a70484c8c4171f133672b216209cb5fec..5ea28dd827af49246448de04430d810b3c25897f 100644 --- a/modules/internal/wrappers.js +++ b/modules/internal/wrappers.js @@ -36,3 +36,13 @@ wrappers.setBadgeText = function (details) { chrome.browserAction.setBadgeText(details); } }; + +// In firefox android, browser action shows as a menu entry instead of icon. +// Use the below 'setTitle' to show injected count in menu entry. + +wrappers.setTitle = function (details){ + + if (chrome.browserAction.setTitle !== undefined) { + chrome.browserAction.setTitle(details); + } +};