Disable attribute registration

This commit is contained in:
M66B
2023-11-29 21:53:17 +01:00
parent 26133dedf5
commit 86806cf42e
5 changed files with 15 additions and 0 deletions

View File

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

View File

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

View File

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

View File

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

View File

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