From a7a840500b4d9d474843edc74ba9584388017ff0 Mon Sep 17 00:00:00 2001 From: gorhill Date: Mon, 18 Jan 2016 00:26:29 -0500 Subject: [PATCH] this fixes https://github.com/gorhill/uBlock/issues/1163#issuecomment-172390974 --- src/js/traffic.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/js/traffic.js b/src/js/traffic.js index f59d8055a..5005fc6e2 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -474,16 +474,11 @@ var foilLargeMediaElement = function(details) { if ( µb.hnSwitches.evaluateZ('no-large-media', pageStore.tabHostname) !== true ) { return; } - // Not all servers provide the Content-Length header: when this happens, - // assume the worse. - var contentLength = 1000000, - i = headerIndexFromName('content-length', details.responseHeaders); - if ( i !== -1 ) { - contentLength = parseInt(details.responseHeaders[i].value, 10); - if ( isNaN(contentLength) ) { - contentLength = 1000000; - } + var i = headerIndexFromName('content-length', details.responseHeaders); + if ( i === -1 ) { + return; } + var contentLength = parseInt(details.responseHeaders[i].value, 10) || 0; if ( (contentLength >>> 10) < µb.userSettings.largeMediaSize ) { return; }