X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fhelpers%2FBlockListHelper.java;h=2e9773a2c4f920c1292ec874aac753f76aa7a46e;hp=f9348f6c7f6ad7fe7328d7957669520af62df15f;hb=af807cce079aaae9cbf0430e7da946fcbe0c99c3;hpb=430b2b303a01cad55c8a8c69faa536f4bb228cc3 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..2e9773a2 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. @@ -1580,7 +1585,7 @@ public class BlockListHelper { } public boolean isBlocked(String currentDomain, String resourceUrl, boolean isThirdPartyRequest, ArrayList> blockList) { - // Get the block list name. + // Get the blocklist name. String BLOCK_LIST_NAME_STRING = blockList.get(0).get(1)[0]; // Assert that currentDomain != null only if this is a third party request. Apparently, lint can't tell that this isn't redundant.