Show/print full original message

This commit is contained in:
M66B
2019-05-21 17:38:48 +02:00
parent a569efa6c4
commit 986dbfcac9
3 changed files with 0 additions and 29 deletions

View File

@@ -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);