mirror of https://github.com/M66B/FairEmail.git
Exclude rel elements for favicons
This commit is contained in:
parent
eccf246bac
commit
8fa6941d45
|
@ -111,6 +111,10 @@ public class ContactInfo {
|
||||||
private static final long CACHE_GRAVATAR_DURATION = 2 * 60 * 60 * 1000L; // milliseconds
|
private static final long CACHE_GRAVATAR_DURATION = 2 * 60 * 60 * 1000L; // milliseconds
|
||||||
private static final long CACHE_FAVICON_DURATION = 2 * 7 * 24 * 60 * 60 * 1000L; // milliseconds
|
private static final long CACHE_FAVICON_DURATION = 2 * 7 * 24 * 60 * 60 * 1000L; // milliseconds
|
||||||
|
|
||||||
|
private static final List<String> REL_EXCLUDE = Collections.unmodifiableList(Arrays.asList(
|
||||||
|
"dns-prefetch", "preconnect", "prefetch", "preload", "prerender"
|
||||||
|
));
|
||||||
|
|
||||||
private ContactInfo() {
|
private ContactInfo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -551,7 +555,8 @@ public class ContactInfo {
|
||||||
List<Future<Bitmap>> futures = new ArrayList<>();
|
List<Future<Bitmap>> futures = new ArrayList<>();
|
||||||
for (Element img : imgs) {
|
for (Element img : imgs) {
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/Performance/dns-prefetch
|
// https://developer.mozilla.org/en-US/docs/Web/Performance/dns-prefetch
|
||||||
if ("dns-prefetch".equals(img.attr("rel"))) // gmx.net
|
String rel = img.attr("rel").trim().toLowerCase(Locale.ROOT);
|
||||||
|
if (REL_EXCLUDE.contains(rel)) // dns-prefetch: gmx.net
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
String favicon = ("link".equals(img.tagName())
|
String favicon = ("link".equals(img.tagName())
|
||||||
|
|
Loading…
Reference in New Issue