Skip to content

Commit

Permalink
this fixes #18
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Jun 27, 2014
1 parent 0367764 commit 51463bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
17 changes: 3 additions & 14 deletions js/traffic.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 };
};
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 51463bc

Please sign in to comment.