Clarify Shields Scripts Blocked Count Mismatch

I posted this in early December in the trouble shooting section but didn’t get any response and figured it was ignored because the topic was probably better suited to this section.

I don’t think this is a bug or a glitch per se but something that likely has an explanation I’ve been unable to find (I also tried searching Brave’s github page).

If I’m on a site and want to unblock scripts or subset of scripts for that session only (“apply once”), I click the drop down arrow by the number (next to scripts blocked). This will display the list of individual scripts that are blocked and I can pick & choose which to temporarily unblock.

I’ve noticed that frequently the number of individual scripts listed doesn’t match the number blocked on the main shields menu. For example, in the attached images you’ll see indicates 8 scripts blocked in the main shields window but only displays 4 individual scripts in the detailed window.

Why is this?
It would be nice if some explanation was given or included in maybe a popup next when “Scripts on this site” is hovered over with the mouse.

I’ve also noticed that sometimes after selecting “allow once” in the detailed shields window, the site will reload and the detailed shields/scripts window will reload and display additional scripts that are blocked (but were not previously displayed) which sometimes then also need to be allowed for the site to properly load. I assume that is because allowing the first set of scripts results in those allowed scripts attempting to load other scripts which are then blocked and displayed in the detailed scripts menu. Is that right?

cc @Mattches @sriram on this

Thanks for reaching out. Great questions!

:point_up: This is just a bug - these numbers should match. Devs are working on a fix already, issue captured here:

To me, this sounds both right and wrong. I’m actually unsure what the correct reasoning is here. Let me reach out to the team and see if I can get some additional input.
Can you provide a link to a site in which you can easily view this behavior?

Can you provide a link to a site in which you can easily view this behavior?

Sure @Mattches, happy to! Here are two examples I just looked at: - after it loads and clicking the shields drop down it shows about 4 scripts. Click “Allow all” then “Apply Once”. When the page refreshes, 2 new scripts appear that are blocked:
Capture3 - same process but it shows about 12 scripts and after clicking “Allow all” the page refreshes and 14 new scripts appear that are blocked:
Capture1 Capture2

1 Like

Excellent report! Appreciate the information and screens!
I’m going to test this on my end and see what shakes out. May have to open an issue for this - will let you know when I have more info.

1 Like

Alright so here’s what I’ve found:
Basically, this is intended behavior. The additional scripts you’re seeing are very likely “hiding” or behind parent scripts also loaded on the page. When you block these parent scripts, their children may subsequently be revealed and then blocked blocked (visibly) because Shields only targeted the parents path.

You can imagine this as something like a “trojan horse” (not to be confused with a “trojan virus”). If Troy had somehow magically removed the big giant horse, they may find several Greek warriors in its place.

Let me know if any of this is unclear.

1 Like

Yes, I think you made it clear for me. I like the Trojan Horse analogy.
If I have it right, it’s like a directory structure:
Scripts may be thought of as set of folders like Website/ScriptFolder/Script1/ScriptA and Website/ScriptFolder/Script1/ScriptB etc.
Shields initially looks at the parent script (Website/ScriptFolder/Script1/) and counts it when in reality there are three (1, A & B). Once I allow Script1, the site and Shields reload ‘opening/running’ Script1 which reveals ScriptA and ScriptB stored ‘behind it’ (the Greek warriors run out!) which the shield identifies and blocks by default.

1 Like

I think @Mattches did a fine job explaining it but for something on simpler terms here’s what happens

Script blocking shows count of all items that are blocked on the page. But on details view it only shows the top level domain and not individual scripts that are blocked.