mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-13 10:17:34 +01:00
This commit is contained in:
parent
41499dbab2
commit
a7a840500b
1 changed files with 4 additions and 9 deletions
|
@ -474,16 +474,11 @@ var foilLargeMediaElement = function(details) {
|
||||||
if ( µb.hnSwitches.evaluateZ('no-large-media', pageStore.tabHostname) !== true ) {
|
if ( µb.hnSwitches.evaluateZ('no-large-media', pageStore.tabHostname) !== true ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Not all servers provide the Content-Length header: when this happens,
|
var i = headerIndexFromName('content-length', details.responseHeaders);
|
||||||
// assume the worse.
|
if ( i === -1 ) {
|
||||||
var contentLength = 1000000,
|
return;
|
||||||
i = headerIndexFromName('content-length', details.responseHeaders);
|
|
||||||
if ( i !== -1 ) {
|
|
||||||
contentLength = parseInt(details.responseHeaders[i].value, 10);
|
|
||||||
if ( isNaN(contentLength) ) {
|
|
||||||
contentLength = 1000000;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
var contentLength = parseInt(details.responseHeaders[i].value, 10) || 0;
|
||||||
if ( (contentLength >>> 10) < µb.userSettings.largeMediaSize ) {
|
if ( (contentLength >>> 10) < µb.userSettings.largeMediaSize ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue