mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-02 19:10:11 +01:00
Show/print full original message
This commit is contained in:
@@ -84,33 +84,6 @@ public class HtmlHelper {
|
||||
|
||||
private static final ExecutorService executor = Executors.newSingleThreadExecutor(Helper.backgroundThreadFactory);
|
||||
|
||||
static String removeTracking(Context context, String html) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean paranoid = prefs.getBoolean("paranoid", true);
|
||||
if (!paranoid)
|
||||
return html;
|
||||
|
||||
Document document = Jsoup.parse(html);
|
||||
|
||||
// Remove tracking pixels
|
||||
for (Element img : document.select("img"))
|
||||
if (isTrackingPixel(img))
|
||||
img.removeAttr("src");
|
||||
|
||||
// Remove Javascript
|
||||
for (Element e : document.select("*"))
|
||||
for (Attribute a : e.attributes()) {
|
||||
String v = a.getValue();
|
||||
if (v != null && v.trim().toLowerCase().startsWith("javascript:"))
|
||||
e.removeAttr(a.getKey());
|
||||
}
|
||||
|
||||
// Remove scripts
|
||||
document.select("script").remove();
|
||||
|
||||
return document.outerHtml();
|
||||
}
|
||||
|
||||
static String sanitize(Context context, String html) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean paranoid = prefs.getBoolean("paranoid", true);
|
||||
|
||||
Reference in New Issue
Block a user