Skip to content
This repository has been archived by the owner on Jun 8, 2018. It is now read-only.

Commit

Permalink
Show injected count in menu entry title in Firefox Android
Browse files Browse the repository at this point in the history
  • Loading branch information
gkrishnaks committed Jun 2, 2018
1 parent a8550f5 commit 9a65fe5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/state-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 10 additions & 0 deletions modules/internal/wrappers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};

0 comments on commit 9a65fe5

Please sign in to comment.