From 94453ed878f60f8245587a19ae51341478b1896d Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 17 Jan 2015 07:53:19 -0500 Subject: [PATCH] this fixes #519 --- src/js/static-net-filtering.js | 8 +++++++- src/js/traffic.js | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/js/static-net-filtering.js b/src/js/static-net-filtering.js index 17b92e0b6..8013e3c41 100644 --- a/src/js/static-net-filtering.js +++ b/src/js/static-net-filtering.js @@ -1812,6 +1812,13 @@ FilterContainer.prototype.matchStringExactType = function(context, requestURL, r /******************************************************************************/ FilterContainer.prototype.matchString = function(context) { + // https://github.com/gorhill/uBlock/issues/519 + // Use exact type match for anything beyond `other` + var type = typeNameToTypeValue[context.requestType]; + if ( type > 8 << 4 ) { + return this.matchStringExactType(context, context.requestURL, context.requestType); + } + // https://github.com/gorhill/httpswitchboard/issues/239 // Convert url to lower case: // `match-case` option not supported, but then, I saw only one @@ -1845,7 +1852,6 @@ FilterContainer.prototype.matchString = function(context) { // This will be used by hostname-based filters pageHostname = context.pageHostname || ''; - var type = typeNameToTypeValue[context.requestType]; var categories = this.categories; var bucket; diff --git a/src/js/traffic.js b/src/js/traffic.js index 0d16dd9b5..3b807fd39 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -270,6 +270,8 @@ var onHeadersReceived = function(details) { µb.localSettings.blockedRequestCount++; µb.updateBadgeAsync(tabId); + pageStore.logBuffer.writeOne(pageStore, result); + details.responseHeaders.push({ 'name': 'Content-Security-Policy', 'value': "script-src 'unsafe-eval' *"