From c9c7fedc33336972a08dbdb78084870db454e7a4 Mon Sep 17 00:00:00 2001 From: gorhill Date: Thu, 30 Apr 2015 17:38:03 -0400 Subject: [PATCH] this fixes https://github.com/gorhill/uBlock/issues/111 --- src/js/traffic.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/traffic.js b/src/js/traffic.js index ce18ec1b7..c99763136 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -300,8 +300,12 @@ var onRootFrameHeadersReceived = function(details) { var µb = µBlock; // Check if the main_frame is a download - // ... - if ( headerValue(details.responseHeaders, 'content-disposition').lastIndexOf('attachment', 0) === 0 ) { + // https://github.com/gorhill/uBlock/issues/111 + // We will assume that whatever root document is of type + // 'application/x-[...]' is a download operation. + // I confirmed this also work with original issue: + // https://github.com/chrisaljoudi/uBlock/issues/516 + if ( headerValue(details.responseHeaders, 'content-type').lastIndexOf('application/x-', 0) === 0 ) { µb.tabContextManager.unpush(tabId, requestURL); } else { µb.tabContextManager.push(tabId, requestURL);