Skip to content

Commit

Permalink
Adblocker: Don't block $object rules
Browse files Browse the repository at this point in the history
  • Loading branch information
alandau committed May 4, 2019
1 parent 9d81f23 commit 5805a3d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/src/main/java/landau/sweb/AdBlocker.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public AdBlocker(File rootDir) {
private void loadFromAdblockFile(String firstline, BufferedReader br) throws IOException {
String line;
while ((line = br.readLine()) != null) {
count++;
if (line.isEmpty()) {
// nothing
} else if (line.startsWith("!")) {
Expand All @@ -96,6 +97,10 @@ private void loadFromAdblockFile(String firstline, BufferedReader br) throws IOE
for (String s : res) {
domains.add(s.startsWith("~") ? s.substring(1) : s);
}
} else {
if ("object".equals(line.substring(dollar + 1))) {
continue;
}
}
}
String rule = dollar == -1 ? line.substring(2) : line.substring(2, dollar);
Expand Down Expand Up @@ -140,7 +145,6 @@ private void loadFromAdblockFile(String firstline, BufferedReader br) throws IOE
sb.append(line);
}
}
count++;
}
br.close();
}
Expand Down

0 comments on commit 5805a3d

Please sign in to comment.