mirror of https://github.com/M66B/FairEmail.git
Apply safe browsing to print WebView
This commit is contained in:
parent
86806cf42e
commit
f758d87bba
|
@ -384,6 +384,9 @@ public class FragmentDialogPrint extends FragmentDialogBase {
|
|||
final Context context = activity.getOriginalContext();
|
||||
boolean print_html_images = args.getBoolean("print_html_images");
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean safe_browsing = prefs.getBoolean("safe_browsing", false);
|
||||
|
||||
// https://developer.android.com/training/printing/html-docs.html
|
||||
printWebView = new WebView(context);
|
||||
|
||||
|
@ -392,6 +395,8 @@ public class FragmentDialogPrint extends FragmentDialogBase {
|
|||
settings.setLoadsImagesAutomatically(print_html_images);
|
||||
settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
|
||||
if (WebViewEx.isFeatureSupported(context, WebViewFeature.SAFE_BROWSING_ENABLE))
|
||||
WebSettingsCompat.setSafeBrowsingEnabled(settings, safe_browsing);
|
||||
if (WebViewEx.isFeatureSupported(context, WebViewFeature.ATTRIBUTION_REGISTRATION_BEHAVIOR))
|
||||
WebSettingsCompat.setAttributionRegistrationBehavior(settings, WebSettingsCompat.ATTRIBUTION_BEHAVIOR_DISABLED);
|
||||
|
||||
|
|
Loading…
Reference in New Issue