From: Soren Stoutner Date: Fri, 27 Jul 2018 23:40:10 +0000 (-0700) Subject: Ignore blocklist entries with "websocket". https://redmine.stoutner.com/issues/314 X-Git-Tag: v2.12~7 X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=commitdiff_plain;h=ff60fbff66e9fd26701120c6cc75666254416e22 Ignore blocklist entries with "websocket". https://redmine.stoutner.com/issues/314 --- diff --git a/app/src/main/java/com/stoutner/privacybrowser/helpers/BlockListHelper.java b/app/src/main/java/com/stoutner/privacybrowser/helpers/BlockListHelper.java index f9348f6c..80ef0406 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/helpers/BlockListHelper.java +++ b/app/src/main/java/com/stoutner/privacybrowser/helpers/BlockListHelper.java @@ -86,9 +86,14 @@ public class BlockListHelper { //Log.i("BlockLists", "Not added: " + blockListEntry); } else //noinspection StatementWithEmptyBody if (blockListEntry.contains("$csp=script-src")) { // Ignore entries that contain `$csp=script-src`. - // Do nothing. It is uncertain what this directive is even supposed to mean, and it is blocking entire websites like androidcentral.com. https://redmine.stoutner.com/issues/306. + // Do nothing. It is uncertain what this directive is even supposed to mean, and it is blocking entire websites like androidcentral.com. https://redmine.stoutner.com/issues/306. - //Log.i("BlockLists", headers.get(1)[0] + " not added: " + originalBlockListEntry); + //Log.i("BlockLists", headers.get(1)[0] + " not added: " + originalBlockListEntry); + } else //noinspection StatementWithEmptyBody + if (blockListEntry.contains("$websocket") || blockListEntry.contains("$third-party,websocket") || blockListEntry.contains("$script,websocket")) { // Ignore entries with `websocket`. + // Do nothing. Privacy Browser does not differentiate between websocket requests and other requests and these entries cause a lot of false positivies. + + //Log.i("BlockLists", headers.get(1)[0] + " not added: " + originalBlockListEntry); } else if (blockListEntry.startsWith("!")) { // Comment entries. if (blockListEntry.startsWith("! Version:")) { // Get the list version number.