mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-06 17:13:23 +02:00
Execute scripts when not removing tracking
This commit is contained in:
@@ -71,6 +71,7 @@ import android.view.TouchDelegate;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.DownloadListener;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
@@ -1408,8 +1409,11 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
ibImages.setVisibility(View.GONE);
|
||||
tvBody.setVisibility(View.GONE);
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean remove_tracking = prefs.getBoolean("remove_tracking", true);
|
||||
|
||||
// For performance reasons the WebView is created when needed only
|
||||
if (!(vwBody instanceof WebView)) {
|
||||
// For performance reasons the WebView is created when needed only
|
||||
WebView webView = new WebView(context) {
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
@@ -1448,6 +1452,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
}
|
||||
});
|
||||
|
||||
if (!remove_tracking)
|
||||
webView.setWebChromeClient(new WebChromeClient());
|
||||
|
||||
webView.setDownloadListener(new DownloadListener() {
|
||||
public void onDownloadStart(
|
||||
String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
|
||||
|
||||
Reference in New Issue
Block a user