From e2d4437956f57b50bda1f27c9b4eea9367de7758 Mon Sep 17 00:00:00 2001
From: Soren Stoutner
Date: Mon, 25 Jul 2022 16:46:15 -0700
Subject: [PATCH] Add X-Requested-With settings.
https://redmine.stoutner.com/issues/819
---
.../main/assets/de/guide_tracking_ids.html | 12 ++++
.../main/assets/en/guide_tracking_ids.html | 12 ++++
.../main/assets/es/guide_tracking_ids.html | 14 +++-
.../main/assets/fr/guide_tracking_ids.html | 12 ++++
.../main/assets/it/guide_tracking_ids.html | 12 ++++
.../assets/pt-rBR/guide_tracking_ids.html | 12 ++++
.../main/assets/ru/guide_tracking_ids.html | 12 ++++
.../main/assets/tr/guide_tracking_ids.html | 12 ++++
.../activities/MainWebViewActivity.java | 46 +++++++++----
.../activities/SettingsActivity.java | 1 -
.../fragments/DomainSettingsFragment.java | 14 ++--
.../fragments/SettingsFragment.java | 3 +
.../helpers/ImportExportDatabaseHelper.kt | 66 +++++++++++--------
.../views/NestedScrollWebView.kt | 19 ++++++
.../res/layout/domain_settings_fragment.xml | 10 +++
app/src/main/res/values/strings.xml | 4 +-
16 files changed, 213 insertions(+), 48 deletions(-)
diff --git a/app/src/main/assets/de/guide_tracking_ids.html b/app/src/main/assets/de/guide_tracking_ids.html
index aabfb796..88d87f5e 100644
--- a/app/src/main/assets/de/guide_tracking_ids.html
+++ b/app/src/main/assets/de/guide_tracking_ids.html
@@ -48,5 +48,17 @@
Redirects aus URL-Anfragen (Queries).
Eine Liste der aktuellen URL-Modifikationen kann einem Blog-Post entnommen werden.
Die URL-Modifikationen können in den Einstellungen deaktiviert werden, sollten sie Probleme bereiten.
+
+
+ X-Requested-With Header
+
+ Google programmed Androidâs WebView to send an X-Requested-With header with every request.
+ The value of the X-Requested-With header is set to the application ID, which in the case of Privacy Browser is com.stoutner.privacybrowser.standard
.
+ Currently, it isn't possible to remove this header, but the value can be changed. By default, Privacy Browser sends a null (empty) value for the X-Requested-With header.
+ Even though the spec allows for null header values, some web servers don't like them, so Privacy Browser has the option to revert to the default behavior of sending the app ID.
+ Because this setting is cached when a URL is first loaded, and isn't changed when reloading a page or navigating history,
+ changes to this setting may not be applied until Privacy Browser is restarted.
+ There is a blog post with additional information.
+ The X-Requested-With header will be completely removed in the 4.x series with the release of Privacy WebView.