Disable attribute registration

pull/214/head
M66B 2 years ago
parent 26133dedf5
commit 86806cf42e

@ -99,6 +99,8 @@ public class ActivityAMP extends ActivityBase {
if (WebViewEx.isFeatureSupported(this, WebViewFeature.SAFE_BROWSING_ENABLE))
WebSettingsCompat.setSafeBrowsingEnabled(settings, safe_browsing);
if (WebViewEx.isFeatureSupported(this, WebViewFeature.ATTRIBUTION_REGISTRATION_BEHAVIOR))
WebSettingsCompat.setAttributionRegistrationBehavior(settings, WebSettingsCompat.ATTRIBUTION_BEHAVIOR_DISABLED);
setDarkMode();

@ -116,6 +116,9 @@ public class ActivityCode extends ActivityBase {
settings.setCacheMode(WebSettings.LOAD_CACHE_ONLY);
settings.setMixedContentMode(WebSettings.MIXED_CONTENT_NEVER_ALLOW);
if (WebViewEx.isFeatureSupported(this, WebViewFeature.ATTRIBUTION_REGISTRATION_BEHAVIOR))
WebSettingsCompat.setAttributionRegistrationBehavior(settings, WebSettingsCompat.ATTRIBUTION_BEHAVIOR_DISABLED);
settings.setLoadsImagesAutomatically(false);
settings.setBlockNetworkLoads(true);
settings.setBlockNetworkImage(true);

@ -82,6 +82,8 @@ public class FragmentDialogOpenFull extends FragmentDialogBase {
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);
boolean dark = (Helper.isDarkTheme(context) && !force_light);
boolean canDarken = WebViewEx.isFeatureSupported(context, WebViewFeature.ALGORITHMIC_DARKENING);

@ -46,6 +46,8 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentManager;
import androidx.preference.PreferenceManager;
import androidx.webkit.WebSettingsCompat;
import androidx.webkit.WebViewFeature;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
@ -389,6 +391,10 @@ public class FragmentDialogPrint extends FragmentDialogBase {
settings.setUserAgentString(WebViewEx.getUserAgent(context, printWebView));
settings.setLoadsImagesAutomatically(print_html_images);
settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
if (WebViewEx.isFeatureSupported(context, WebViewFeature.ATTRIBUTION_REGISTRATION_BEHAVIOR))
WebSettingsCompat.setAttributionRegistrationBehavior(settings, WebSettingsCompat.ATTRIBUTION_BEHAVIOR_DISABLED);
settings.setJavaScriptEnabled(false);
settings.setAllowFileAccess(true);

@ -93,6 +93,8 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
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);
}
void init(int height, int maxHeight, float size, Pair<Integer, Integer> position, boolean force_light, IWebView intf) {

Loading…
Cancel
Save