Small UI Feature request: "Display default items count badge"

Bug reports and enhancement requests
Post Reply
Posts: 1
Joined: Wed Mar 23, 2022 2:31 pm

Small UI Feature request: "Display default items count badge"

Post by RonSijm »

Hey there!

Over at the Appearance Options (moz-extension://f25a899b-ce6c-4e19-9cd5-67a5de51d18c/ui/options.html#;tab-main-tabs=2)
there's an option "Display blocked items count badge".

This badge doesn't really mean anything besides how many items are either on default or are blocked.

My flow is generally that I go to a website, and unblock the scripts needed by making them trusted, and blocking the sites I don't need by making them untrusted. If all the scripts on a website are already either trusted or untrusted, I don't really need to open the NoScript dropdown to change anything.

If there are still options left to default, there is something to do in the NoScript Dropdown...

I tried to see if I could fix it myself, and I assume I'll have to fiddle with this part in the `RequestGuard.js` a bit:

Code: Select all

    let showBadge = ns.local.showCountBadge && numBlocked > 0;
    let browserAction = browser.browserAction;
    if (!browserAction.setIcon) { // Fennec
      browserAction.setTitle({tabId, title: `NoScript (${numBlocked})`});
    (async () => {
      let iconPath = (await Themes.isVintage()) ? '/img/vintage' : '/img';
      browserAction.setIcon({tabId, path: {64: `${iconPath}/ui-${icon}64.png`}});
    browserAction.setBadgeText({tabId, text: showBadge ? numBlocked.toString() : ""});
But I figured if I do that, then I'm going to have to do it again after every update, or stop upgrading all together

I imagine my "workflow" is pretty common, and suspect other people would like to have the icon serve as an "call to action" indicator rather than seeing how much is blocked. If I missed some option to that makes it easier to see things are still left to default, lemme know, thanks
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0
Post Reply