From 51463bc796c43e754614c7dec9cdef2c97fbfd16 Mon Sep 17 00:00:00 2001 From: gorhill Date: Thu, 26 Jun 2014 20:20:55 -0400 Subject: [PATCH] this fixes #18 --- js/traffic.js | 17 +++-------------- manifest.json | 2 +- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/js/traffic.js b/js/traffic.js index 3de778414..45327fd5d 100644 --- a/js/traffic.js +++ b/js/traffic.js @@ -30,15 +30,6 @@ /******************************************************************************/ -var typeToRedirectPathMap = { - 'stylesheet': chrome.runtime.getURL('css/noop.css'), - 'image': chrome.runtime.getURL('img/noop.png'), - 'script': chrome.runtime.getURL('js/noop.js'), - 'sub_frame': 'about:blank' -}; - -/******************************************************************************/ - // Intercept and filter web requests according to white and black lists. var onBeforeRequestHandler = function(details) { @@ -103,11 +94,9 @@ var onBeforeRequestHandler = function(details) { // Blocked //console.debug('µBlock> onBeforeRequestHandler()> BLOCK "%s" because "%s"', details.url, reason); - // Redirect to noop versions whenever possible. - var redirectPath = typeToRedirectPathMap[requestType]; - if ( redirectPath ) { - return { 'redirectUrl': redirectPath }; - } + // https://github.com/gorhill/uBlock/issues/18 + // Do not use redirection, we need to block outright to be sure the request + // will not be made. There can be no such guarantee with redirection. return { 'cancel': true }; }; diff --git a/manifest.json b/manifest.json index 243a66249..97c882d90 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "__MSG_extName__", "short_name": "µBlock", - "version": "0.1.0.8", + "version": "0.1.0.9", "description": "__MSG_extShortDesc__", "icons": { "16": "img/icon_16.png",