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.

\ No newline at end of file diff --git a/app/src/main/assets/en/guide_tracking_ids.html b/app/src/main/assets/en/guide_tracking_ids.html index eaf2ca3d..2de88193 100644 --- a/app/src/main/assets/en/guide_tracking_ids.html +++ b/app/src/main/assets/en/guide_tracking_ids.html @@ -41,5 +41,17 @@

Privacy Browser removes tracking IDs and AMP (Accelerated Mobile Pages) redirects from URL queries. There is a blog post that is updated with the current list of modifications. URL modification can be turned off in the settings if it is causing issues.

+ + +

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.

\ No newline at end of file diff --git a/app/src/main/assets/es/guide_tracking_ids.html b/app/src/main/assets/es/guide_tracking_ids.html index ad8ab3fd..5e532025 100644 --- a/app/src/main/assets/es/guide_tracking_ids.html +++ b/app/src/main/assets/es/guide_tracking_ids.html @@ -1,7 +1,7 @@ diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9d9fc616..9fd6dbb0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -527,7 +527,9 @@ Custom user agent System default user agent X-Requested-With header - When enabled, Privacy Browser send a null value for the X-Requested-With header. Usually this isn\'t a problem, but a few websites don\'t like it. + When enabled, Privacy Browser send a null value for the X-Requested-With header. Usually this isn\'t a problem, but a few websites don\'t like it. + Changing this settings will restart Privacy Browser. + Changes to the X-Requested-With header might not be applied until Privacy Browser is restarted. Incognito Mode Clear the history and cache after each webpage finishes loading. In Incognito Mode, back closes the tab (or the app if there is only one tab). Allow screenshots -- 2.43.0