mirror of https://github.com/M66B/FairEmail.git
Show/print full original message
This commit is contained in:
parent
a569efa6c4
commit
986dbfcac9
|
@ -1251,7 +1251,6 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
|
||||
String html = Helper.readText(file);
|
||||
html = HtmlHelper.getHtmlEmbedded(context, id, html);
|
||||
html = HtmlHelper.removeTracking(context, html);
|
||||
|
||||
return new String[]{message.subject, html};
|
||||
}
|
||||
|
|
|
@ -1761,7 +1761,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
OriginalMessage original = new OriginalMessage();
|
||||
original.html = Helper.readText(file);
|
||||
original.html = HtmlHelper.getHtmlEmbedded(context, id, original.html);
|
||||
original.html = HtmlHelper.removeTracking(context, original.html);
|
||||
|
||||
Document doc = Jsoup.parse(original.html);
|
||||
original.has_images = (doc.select("img").size() > 0);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue