]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Update the View Headers request headers. https://redmine.stoutner.com/issues/1164
authorSoren Stoutner <soren@stoutner.com>
Tue, 24 Dec 2024 22:12:25 +0000 (15:12 -0700)
committerSoren Stoutner <soren@stoutner.com>
Tue, 24 Dec 2024 22:12:25 +0000 (15:12 -0700)
app/src/main/java/com/stoutner/privacybrowser/activities/ViewHeadersActivity.kt
app/src/main/java/com/stoutner/privacybrowser/backgroundtasks/GetHeadersBackgroundTask.kt
app/src/main/java/com/stoutner/privacybrowser/viewmodels/HeadersViewModel.kt
app/src/main/res/values-es/strings.xml
app/src/main/res/values-it/strings.xml
app/src/main/res/values-ru/strings.xml

index 77b3aef5df7abcafd104d6d4b2d0a893f9f23995..b93fc2fd2ccc91d46ec1190b01977a36cff58e26 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2017-2024 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2017-2024 Soren Stoutner <soren@stoutner.com>
  *
  * This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android/>.
  *
- * Privacy Browser Android is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * Privacy Browser Android is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser Android.  If not, see <https://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 package com.stoutner.privacybrowser.activities
index 73b7754b0df4e49bd7d951a33b5de3f4bb89e254..030acd2b9bd31da88386697d777f969ba62700e4 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2017-2024 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2017-2024 Soren Stoutner <soren@stoutner.com>
  *
  * This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android/>.
  *
- * Privacy Browser Android is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * Privacy Browser Android is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser Android.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 package com.stoutner.privacybrowser.backgroundtasks
@@ -126,6 +126,7 @@ class GetHeadersBackgroundTask {
                 // Open a connection to the URL.  No data is actually sent at this point.
                 val httpUrlConnection = url.openConnection(proxy) as HttpURLConnection
 
+
                 // Set the `Host` header property.
                 httpUrlConnection.setRequestProperty("Host", url.host)
 
@@ -195,14 +196,24 @@ class GetHeadersBackgroundTask {
                 requestHeadersBuilder.append("?1")
 
 
+                // Set the `Sec-Fetch-Dest` header property.
+                httpUrlConnection.setRequestProperty("Sec-Fetch-Dest", "document")
+
+                // Add the `Sec-Fetch-User` header to the string builder and format the text.
+                requestHeadersBuilder.append(newLineString)
+                requestHeadersBuilder.append("Sec-Fetch-Dest", StyleSpan(Typeface.BOLD), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
+                requestHeadersBuilder.append(colonString)
+                requestHeadersBuilder.append("document")
+
+
                 // Set the `Accept` header property.
-                httpUrlConnection.setRequestProperty("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3")
+                httpUrlConnection.setRequestProperty("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7")
 
                 // Add the `Accept` header to the string builder and format the text.
                 requestHeadersBuilder.append(newLineString)
                 requestHeadersBuilder.append("Accept", StyleSpan(Typeface.BOLD), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
                 requestHeadersBuilder.append(colonString)
-                requestHeadersBuilder.append("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3")
+                requestHeadersBuilder.append("text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7")
 
 
                 // Set the `Accept-Language` header property.
index 3fff326322b3fcaf7b6c92210a8df9c5808756d0..8899866af0b63b80791e25d68d8f0a272f1f6ebc 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2020-2023 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2020-2023 Soren Stoutner <soren@stoutner.com>
  *
- * This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
+ * This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android/>.
  *
- * Privacy Browser Android is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * Privacy Browser Android is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser Android.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 package com.stoutner.privacybrowser.viewmodels
index 052429085c98ef2a806aab5eb007052a5e32cd22..cb7fc805d199303be04b06de21783cec14b85f16 100644 (file)
         <string name="hide_app_bar">Ocultar la barra de aplicaciones</string>
         <string name="hide_app_bar_summary">Ocultar la barra de aplicaciones que contiene la URL.</string>
         <string name="display_under_cutouts">Mostrar bajo los recortes</string>
+        <string name="display_under_cutouts_summary">Mostrar el sitio web bajo los recortes, como las muescas de la cámara. Cuando está opción está activada, Navegador Privado también se dibujará bajo el teclado.
+-            Al cambiar esta configuración se reiniciará Navegador Privado en Android &lt; 15.</string>
     <string name="clear_everything">Borrar todo</string>
         <string name="clear_everything_summary">Borra cookies, almacenamiento DOM, el logcat y la caché de  WebView. A continuación borra manualmente los directorios “app_webview” y “cache”.</string>
         <string name="clear_cookies_preference">Borrar cookies</string>
index 7e70bca6bbef0072bd88f4f33fd09a0af5690183..f4eef5ab773f771894cfd96635803502da7d6ea6 100644 (file)
         <string name="hide_app_bar">Nascondi la barra dell\'applicazione</string>
         <string name="hide_app_bar_summary">Nasconde la barra che contiene l\'URL.</string>
         <string name="display_under_cutouts">Visualizza sotto i ritagli dello schermo</string>
+        <string name="display_under_cutouts_summary">Visualizza il sito web sotto i ritagli dello schermo come quello della fotocamera.
+            Quando questa impostazione è abilitata, Privacy Browser sarà anche visualizzato sotto la tastiera. La modifica di questa impostazione provocherà il riavvio di Privacy Browser su Android &lt; 15.</string>
     <string name="clear_everything">Elimina tutto</string>
         <string name="clear_everything_summary">Cancella i cookies, il DOM storage, il logcat e la cache di WebView.  Cancella completamente le cartelle “app_webview” e “cache”.</string>
         <string name="clear_cookies_preference">Elimina i cookie</string>
index d581f172882ac90e87c4dce467258246441bbb60..b8dff28fd58749024a0bd446b027c9f3f7a06b15 100644 (file)
         <string name="hide_app_bar">Скрыть панель приложения</string>
         <string name="hide_app_bar_summary">Скрывает панель приложения, которая содержит URL.</string>
         <string name="display_under_cutouts">Отображение под вырезом</string>
+        <string name="display_under_cutouts_summary">Прорисовывать сайт под вырезами, такими как выемки под камеру. Если эта функция включена, Privacy Browser также будет отрисован под клавиатурой.
+            Изменение этого параметра приведет к перезапуску Privacy Browser для Android &lt; 15.</string>
     <string name="clear_everything">Очистить все</string>
         <string name="clear_everything_summary">Очищает cookie, DOM-хранилище, logcat и кэш WebView. После этого вручную удаляет каталоги "app_webview" и "cache".</string>
         <string name="clear_cookies_preference">Очистить cookie</string>
         <string name="wide_viewport_summary">Использование широкого вида просмотра делает стиль некоторых веб-страниц более похожим на сайт для компьютера.</string>
         <string name="display_webpage_images">Показывать изображения веб-страницы</string>
         <string name="display_webpage_images_summary">Отключите для экономии трафика.</string>
-</resources>
\ No newline at end of file
+</resources>