uBlock-LLC / uBlock

uBlock: a fast, lightweight, and lean blocker for Chrome, Firefox, and Safari.
https://ublock.org/
GNU General Public License v3.0
8.19k stars 439 forks source link

requests blocked by httpsb is shown as allowed request in uBlock statistics tab.. #106

Closed harshanvn closed 2 years ago

harshanvn commented 10 years ago

Not sure if this a bug or not. When visited tomshardware.com, i see ga.js is blocked by httpsb (and confirmed thru F12->Network tab), But i can see it as an allowed request in uBlock.

Not sure if its due to #101 change..

gorhill commented 10 years ago

Yes, due to change as per #101.

uBlock lives in its own world, when a request is blocked by HTTPSB, Ghostery, ABP, Privacy Badger or whatever else, it doesn't know this. Extensions are not warned that another extension blocked a request, this applies to uBlock or whatever blocker. It's true the other way: when uBlock blocks a request, whatever else blocker will not report these request as blocked unless they block them themselves.

Theoretically, according to the doc, I could install a listener for when a request results in an error (which is the case when it is blocked par whatever means or when a network error occur), and report these unfulfilled requests as "blocked externally", so that a user is not fooled into thinking it was blocked by uBlock. But I don't know if it's worth the overhead (and maybe unwanted side effects).

harshanvn commented 10 years ago

Ok I see. How come if an extension A blocks a request, another extension can see that request, since it is already blocked? Is it that Chrome webrequest API exposes this information at the same time to all these extensions?

Typically i like to see uBlock to report these requests as blocked by Other if its blocked by other extension such as HTTPSB in this case. However i do not want to jeopardize the fastness/leanness of this extension, since it does not impact anything wrt to blocking.

gorhill commented 10 years ago

Is it that Chrome webrequest API exposes this information at the same time to all these extensions?

Probably, since on Chromium each extension is in its own process, just like each tab.

Long term, what is something to look into, is to have HTTPSB and uBlock communicate together so that uBlock could query HTTPSB about what it blocked, and subtract that count from its own block count. The count badge is all async already, so latency of communication between two extensions I don't think that would be a problem. But that is long term, and feasibility needs to be figured, etc. to be sure they can work nice together, and that the messaging between both doesn't lead to adverse consequences.

fysics commented 10 years ago

I don't think requests blocked by HTTSB should be logged by uBlock. They are separate extensions, afterall.

gorhill commented 10 years ago

Extensions can send messages to each other, as per API (I never tried it). Since I emphasize that uBlock is complementary to yet-to-come uMatrix, having them work together more tightly is a good thing.