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=2adfb6f7bd5f7e771c2828387205573288d43d84;hp=55ad050a4c56c37ad39e97aa0de5f8a9b12f128b;hb=f6538f0acbc299014c5128a29c5def62aee153a5;hpb=bc45b14cfda10249800a6ccfdb8247d2ce9b32a9 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 55ad050a..2adfb6f7 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/helpers/BlockListHelper.java +++ b/app/src/main/java/com/stoutner/privacybrowser/helpers/BlockListHelper.java @@ -36,7 +36,7 @@ public class BlockListHelper { // Initialize the header list. List headers = new ArrayList<>(); // 0. - // Initialize the white lists. + // Initialize the whitelists. List mainWhiteList = new ArrayList<>(); // 1. List finalWhiteList = new ArrayList<>(); // 2. List domainWhiteList = new ArrayList<>(); // 3. @@ -46,7 +46,7 @@ public class BlockListHelper { List thirdPartyDomainWhiteList = new ArrayList<>(); // 7. List thirdPartyDomainInitialWhiteList = new ArrayList<>(); // 8. - // Initialize the black lists + // Initialize the blacklists List mainBlackList = new ArrayList<>(); // 9. List initialBlackList = new ArrayList<>(); // 10. List finalBlackList = new ArrayList<>(); // 11. @@ -85,6 +85,11 @@ public class BlockListHelper { // Do nothing. Privacy Browser does not currently use these entries. //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. + + //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.