Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions src/chrome/content/toolbar_button.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,21 +181,29 @@ httpsEverywhere.toolbarButton = {
}
// Make sure the list is up to date
alist.populate_list();

var counter = 0;

var totalCounter = 0;
for (var x in alist.all) {
++totalCounter;
}
var activeCounter = 0;
for (var x in alist.active) {
if (!(x in alist.breaking)) {
++counter;
++activeCounter;
}
}
for (var x in alist.moot) {
if (!(x in alist.active)) {
++counter;
++activeCounter;
}
}

toolbarbutton.setAttribute('rulesetsApplied', counter);
HTTPSEverywhere.log(INFO, 'Setting icon counter to: ' + counter);
if (totalCounter != activeCounter) {
var counterLabel = activeCounter + '/' + totalCounter;
} else {
var counterLabel = totalCounter;
}
toolbarbutton.setAttribute('rulesetsApplied', counterLabel);
HTTPSEverywhere.log(INFO, 'Setting icon counter to: ' + counterLabel);
},

/**
Expand Down