Block media elements unconditionally when max size is set to 0

Related feedback:
https://old.reddit.com/r/uBlockOrigin/comments/1h7x9nj/
This commit is contained in:
Raymond Hill 2024-12-06 10:15:42 -05:00
parent b3a51d0018
commit 36db7f8327
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -1063,7 +1063,9 @@ const PageStore = class {
this.largeMediaTimer.on(500);
}
const size = headers.contentLength;
if ( isNaN(size) ) { return 0; }
if ( isNaN(size) ) {
return µb.userSettings.largeMediaSize === 0 ? 1 : 0;
}
if ( (size >>> 10) < µb.userSettings.largeMediaSize ) { return 0; }
this.largeMediaCount += 1;
this.largeMediaTimer.on(500);