this fixes #18

This commit is contained in:
gorhill 2014-06-26 20:20:55 -04:00
parent 036776455b
commit 51463bc796
2 changed files with 4 additions and 15 deletions

View File

@ -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 };
};

View File

@ -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",