uBlockOrigin / uBlock-issues

This is the community-maintained issue tracker for uBlock Origin
https://github.com/gorhill/uBlock
949 stars 81 forks source link

no-large-media has no effect on images loaded through 3p CSS #3134

Open emanruse opened 9 months ago

emanruse commented 9 months ago

Prerequisites

I tried to reproduce the issue when...

Description

no-large-media has no effect when CSS is blocked but 3p for the domain is noop

A specific URL where the issue occurs.

https://github.com

Steps to Reproduce

  1. Use the following settings
{
  "version": "1.55.0",
  "userSettings": {
    "externalLists": "",
    "firewallPaneMinimized": false,
    "importedLists": []
  },
  "selectedFilterLists": [
    "user-filters"
  ],
  "hiddenSettings": {},
  "whitelist": [
    "about-scheme",
    "moz-extension-scheme"
  ],
  "dynamicFilteringString": "* * * block\n* * inline-script block\n* * 1p-script block\n* * 3p-script block\n* * 3p-frame block\n* * image block\n* * 3p block\nbehind-the-scene * * block\ngithub.com * * noop\ngithub.com * 3p noop",
  "urlFilteringString": "",
  "hostnameSwitchesString": "no-popups: * true\nno-remote-fonts: * true\nno-large-media: * true\nno-csp-reports: * true\nno-scripting: * true",
  "userFilters": "*$stylesheet\n*$document,csp=style-src\n"
}

*The value for "Block media elements larger than" is 0 KB.

  1. Open uBO's logger
  2. Visit e.g. https://github.com

Expected behavior

Images > 0 KB should not be loaded.

Actual behavior

Images are loaded.

uBO version

1.55

Browser name and version

Tor Browser 13.0.9 (based on Firefox 115.7.0esr)

Operating System and version

Whonix 17

gwarser commented 9 months ago

Are you sure they are not loaded from cache?

image

This is on ESR with your settings imported + 0kB large media. Also tried with advanced settings enabled and it's fine.

Also fine in Tor Browser 13.0.9.

emanruse commented 9 months ago

Are you sure they are not loaded from cache?

Absolutely sure. Tested in a clean VM in which a browser was never run.

Additionally tested explicitly by looking at the web console with network caching disabled. Both web console and uBO's console show both the blocked and the non-blocked requests.

stephenhawk8054 commented 9 months ago

My console shows all images being blocked:

image

gorhill commented 9 months ago

Tested in a clean VM in which a browser was never run.

Did you try reloading the page with cache bypass after you setup your config?

gwarser commented 9 months ago

Ok, there is some inconsistency between uBO logger and dev console

image

emanruse commented 9 months ago

Did you try reloading the page with cache bypass after you setup your config?

Yes. Many times.

Strangely, as I am retrying right now (another clean setup), images appear blocked. I absolutely sure I am doing the same as before. Very strange.

krystian3w commented 9 months ago

For me picker saved filter at 5-th tries in My filters panel in FX 123 at Windows 11.

When I opened the page in a new tab the hidden element came back and the filter was not in the uBo dashboard.

garry-ut99 commented 9 months ago

case 1 (duplicated entries - unblocked + blocked) not an issue, see :

https://github.com/gorhill/uBlock/issues/3441#issuecomment-357998302 https://github.com/gorhill/uBlock/issues/3441#issuecomment-358001277

https://github.com/gorhill/uBlock/issues/1473#issuecomment-259244428

https://github.com/uBlockOrigin/uBlock-issues/wiki/Per-site-switches#no-large-media-elements :

Note that this feature has no privacy value: a connection to the remote server must be performed in order to fetch the size of the resource. This of course applies only to resources that were not otherwise blocked by uBO's filtering engine.


gwarser : https://github.com/uBlockOrigin/uBlock-issues/issues/3134#issuecomment-1956693543 : Ok, there is some inconsistency between uBO logger and dev console

I wonder whether you have duplicated entires for every image request or not. For me images are showed as blocked in dev console, just like on your screenshoot, but ubo logger shows additionaly every image as duplicated: unblocked + blocked, it happens on both Firefox/Opera

Example single image on Firefox:

screenshoot - dev console 2

screenshoot - ubo logger Firefox 1

Better visible on Chromium/Opera because unblocked & blocked image requests are displayed in paired order in ubo logger, (unlike on Firefox, this is why I limited the screenshoot in Firefox to show only a single paired image request) :

screenshoot - ubo logger Opera 3

There is no issue with image blocking for me, all images are blocked in browser & ubo, so they don't appear on webpage, the only thing is that ubo logger displays corresponding unblocked image duplicate entry for every blocked image entry, but it's not an issue/bug.


case 2 (no images blocked at all)

Another thing/issue, maybe related or not, is that after disabling Block media elements larger than, and reloading site, then enabling again and reloading site again, no images are blocked anymore, even with cache cleared and disabled in dev console, like Block media elements larger than has been broken, to fix it, needs to disable/enable uBO trought browser extensions panel.


OP :

I wonder what does OP get in ubo logger:


Picker

krystian3w : https://github.com/uBlockOrigin/uBlock-issues/issues/3134#issuecomment-1958159520 : For me picker saved filter at 5-th tries in My filters panel in FX 123 at Windows 11. When I opened the page in a new tab the hidden element came back and the filter was not in the uBo dashboard.

I wonder how this is related to the current no-large-media issue, anyway not much detailed steps to reproduce provided, so I can only blind guess, maybe this :

emanruse commented 9 months ago

@garry-ut99

At the time I reported this, I was getting case1 + case2 simultaneously. As per my previous reply and as of today (updated to uBO 1.56 and TB 3.0.10), I am getting only case 1.

Another thing/issue, maybe related or not, is that after disabling no-large-element, and reloading site, then enabling no-large-element again and reloading site again, no images are blocked anymore, even with cache cleared and disabled in dev console

That's it! It might have been this which I have observed initially and I can reproduce it today too.

*Please note that when you edit a comment, I don't get email notification about it.

uBlock-user commented 9 months ago

I can consistently reproduce images not getting blocked despite Block media elements setting set to 0 KB on Firefox 124

gorhill commented 9 months ago

there is some inconsistency between uBO logger and dev console

no-large-media blocks after response headers are received since that feature needs response headers to find out the response size.

garry-ut99 commented 9 months ago

As for case 2 :

emanruse : That's it! It might have been this which I have observed initially and I can reproduce it today too. uBlock-user : I can consistently reproduce images not getting blocked despite Block media elements setting set to 0 KB on Firefox

Some more details :

Steps to reproduce from my previous comment :


emanruse : *Please note that when you edit a comment, I don't get email notification about it.

I know, but I don't like anybody to spy me on my edit history, I value my privacy, thus I remove edits, nor I like to ping anybody X times in a row, in other words, others have to keep an eye on their own on my comments edit history .

gorhill commented 9 months ago

For every "images not blocked" instance, I need to know how exactly this was determined: visual? uBO's logger? browser network pane?

garry-ut99 commented 9 months ago

As for me: by all the 3 methods, for the both cases: when images not blocked, and when images blocked.

uBlock-user commented 9 months ago

uBO's logger

Yes

browser network pane?

Yes

On my side profile picture image also loads (tested at https://github.com/uBlock-user)

Capture

Content-Length header is also present as per the above image.

garry-ut99 commented 9 months ago

I've found it, the issue is 7 years old, either the fix didn't work since the beginning, or the bug returned due to everything changed over years : https://github.com/gorhill/uBlock/issues/2946#issuecomment-326711220 + https://github.com/gorhill/uBlock/issues/2946#issuecomment-326762059

gorhill commented 9 months ago

OP's repro steps didn't mention disabling no-large-media.

garry-ut99 commented 9 months ago

OP of https://github.com/uBlockOrigin/uBlock-issues/issues/3134 or of https://github.com/gorhill/uBlock/issues/2946

Seems the both OPs didn't mention about disabling it previoulsly in their STR, but both of them admitted it in their later comments :

emanruse : https://github.com/uBlockOrigin/uBlock-issues/issues/3134#issuecomment-1959371455 : That's it! It might have been this which I have observed initially and I can reproduce it today too.

BenFroh : https://github.com/gorhill/uBlock/issues/2946#issuecomment-326755533 : I think before I toggled it off/on and stand on the same site.

emanruse commented 9 months ago

OP's repro steps didn't mention disabling no-large-media.

Yes. The reason is probably that I made many tests and I blindly trusted the fact that disabling cache works as expected, i.e. I didn't expect that the issue is more complex, as it turned out. Sorry for the confusion.

I confirmed the actual finding of @garry-ut99 though, so he helped to clarify that. Thanks.

garry-ut99 commented 9 months ago

It seems unable to reproduce label is obsolete now and should be removed.

stephenhawk8054 commented 1 month ago

@progman-dt Which sites did you use to test?

progman-dt commented 1 month ago

@progman-dt Which sites did you use to test?

habr.com

stephenhawk8054 commented 1 month ago

The font network is blocked correctly for me

![image](https://github.com/user-attachments/assets/2060367b-b2cc-40e9-a54a-a807747d044f)
progman-dt commented 1 month ago

OMG, I'm so sorry for the false alarm! Looks like one of my regional filters has an override for google font domains 🤦 2024-10-14_17:10:18_825291755

stephenhawk8054 commented 1 month ago

You can use badfilter to disable the allowed-filter. For example

@@||fonts.gstatic.com^$badfilter