Remove duplicate tracking images

This commit is contained in:
M66B 2024-03-23 18:39:15 +01:00
parent d0bbc63198
commit ce17db1e83
1 changed files with 8 additions and 0 deletions

View File

@ -2381,6 +2381,7 @@ public class HtmlHelper {
}
// Images
List<Uri> uris = new ArrayList<>();
for (Element img : document.select("img")) {
img.removeAttr("x-tracking");
@ -2393,7 +2394,14 @@ public class HtmlHelper {
if (host == null || hosts.contains(host))
continue;
if (uris.contains(uri)) {
Log.i("Removing duplicate tracking image uri=" + uri);
img.remove();
continue;
}
if (isTrackingPixel(img) || isTrackingHost(context, host, disconnect_images)) {
uris.add(uri);
img.attr("src", sb.toString());
img.attr("alt", context.getString(R.string.title_legend_tracking_pixel));
img.attr("height", "24");