<p>Die Android-Systemkomponente WebView sendet mit jeder Anfrage einen <a href="https://www.stoutner.com/the-x-requested-with-header/">X-Requested-With-Header</a> an den betreffenden Internet-Server.
Der Wert im X-Requested-With-Header entspricht dabei der Applikations-ID - im Fall von Privacy Browser <code>com.stoutner.privacybrowser.standard</code>.
- This can be disabled by using <a href="https://www.stoutner.com/webview-devtools/">WebView's DevTools</a>.</p>
+ This can be disabled using <a href="https://www.stoutner.com/webview-devtools/">WebView's DevTools</a>.</p>
</body>
</html>
<p>Google programmed Android’s WebView to send an <a href="https://www.stoutner.com/the-x-requested-with-header/">X-Requested-With header</a> 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 <code>com.stoutner.privacybrowser.standard</code>.
- This can be disabled by using <a href="https://www.stoutner.com/webview-devtools/">WebView's DevTools</a>.</p>
+ This can be disabled using <a href="https://www.stoutner.com/webview-devtools/">WebView's DevTools</a>.</p>
</body>
</html>
<p>Google ha programado WebView de Android para que envíe una <a href="https://www.stoutner.com/the-x-requested-with-header/">cabecera X-Requested-With</a> con cada solicitud.
El valor de la cabecera X-Requested-With se establece con el ID de la aplicación, que en el caso de Navegador Privado es <code>com.stoutner.privacybrowser.standard</code>.
- This can be disabled by using <a href="https://www.stoutner.com/webview-devtools/">WebView's DevTools</a>.</p>
+ This can be disabled using <a href="https://www.stoutner.com/webview-devtools/">WebView's DevTools</a>.</p>
</body>
</html>
<p>Google a programmé WebView d'Android pour envoyer un <a href="https://www.stoutner.com/the-x-requested-with-header/">en-tête X-Requested-With</a> avec chaque requête.
La valeur de l'en-tête X-Requested-With est définie par l'ID de l'application, qui dans le cas de Privacy Browser est <code>com.stoutner.privacybrowser.standard</code>.
- This can be disabled by using <a href="https://www.stoutner.com/webview-devtools/">WebView's DevTools</a>.</p>
+ This can be disabled using <a href="https://www.stoutner.com/webview-devtools/">WebView's DevTools</a>.</p>
</body>
</html>
\ No newline at end of file
<p>Google ha programmato la webview di Android per inviare <a href="https://www.stoutner.com/the-x-requested-with-header/">un'intestazione X-Requested-With</a> con ogni richiesta.
Il valore dell'intestazione X-Requested-With è impostato sulla ID della applicazione, ovvero nel caso di Privacy Browser, è <code>com.stoutner.privacybrowser.standard</code>.
- This can be disabled by using <a href="https://www.stoutner.com/webview-devtools/">WebView's DevTools</a>.</p>
+ This can be disabled using <a href="https://www.stoutner.com/webview-devtools/">WebView's DevTools</a>.</p>
</body>
</html>
<p>Google programmed Android’s WebView to send an <a href="https://www.stoutner.com/the-x-requested-with-header/">X-Requested-With header</a> 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 <code>com.stoutner.privacybrowser.standard</code>.
- This can be disabled by using <a href="https://www.stoutner.com/webview-devtools/">WebView's DevTools</a>.</p>
+ This can be disabled using <a href="https://www.stoutner.com/webview-devtools/">WebView's DevTools</a>.</p>
</body>
</html>
<p>Google запрограммировал WebView в Android на отправку <<a href="https://www.stoutner.com/the-x-requested-with-header/">заголовка X-Requested-With</a> при каждом запросе.
Значение заголовка X-Requested-With устанавливается как идентификатор приложения, который в случае Privacy Browser является <code>com.stoutner.privacybrowser.standard</code>.
- This can be disabled by using <a href="https://www.stoutner.com/webview-devtools/">WebView's DevTools</a>.</p>
+ This can be disabled using <a href="https://www.stoutner.com/webview-devtools/">WebView's DevTools</a>.</p>
</body>
</html>
<p>Google programmed Android’s WebView to send an <a href="https://www.stoutner.com/the-x-requested-with-header/">X-Requested-With header</a> 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 <code>com.stoutner.privacybrowser.standard</code>.
- This can be disabled by using <a href="https://www.stoutner.com/webview-devtools/">WebView's DevTools</a>.</p>
+ This can be disabled using <a href="https://www.stoutner.com/webview-devtools/">WebView's DevTools</a>.</p>
</body>
</html>
import com.stoutner.privacybrowser.R
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
+
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader
// Open an output stream.
val outputStream = contentResolver.openOutputStream(fileUri)!!
- // Write the logcat string to the output stream.
- outputStream.write(logcatString.toByteArray(StandardCharsets.UTF_8))
+ // Save the logcat using a coroutine with Dispatchers.IO.
+ CoroutineScope(Dispatchers.Main).launch {
+ withContext(Dispatchers.IO) {
+ // Write the logcat string to the output stream.
+ outputStream.write(logcatString.toByteArray(StandardCharsets.UTF_8))
- // Close the output stream.
- outputStream.close()
+ // Close the output stream.
+ outputStream.close()
+ }
+ }
// Initialize the file name string from the file URI last path segment.
var fileNameString = fileUri.lastPathSegment
/*
- * Copyright © 2016-2022 Soren Stoutner <soren@stoutner.com>.
+ * Copyright 2016-2022 Soren Stoutner <soren@stoutner.com>.
*
* This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
*
import com.stoutner.privacybrowser.BuildConfig
import com.stoutner.privacybrowser.asynctasks.SaveAboutVersionImage
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
+
import java.io.ByteArrayInputStream
import java.io.InputStream
import java.lang.Exception
// Open an output stream.
val outputStream = requireActivity().contentResolver.openOutputStream(fileUri)!!
- // Write the about version string to the output stream.
- outputStream.write(aboutVersionString.toByteArray(StandardCharsets.UTF_8))
+ // Save about version using a coroutine with Dispatchers.IO.
+ CoroutineScope(Dispatchers.Main).launch {
+ withContext(Dispatchers.IO) {
+ // Write the about version string to the output stream.
+ outputStream.write(aboutVersionString.toByteArray(StandardCharsets.UTF_8))
- // Close the output stream.
- outputStream.close()
+ // Close the output stream.
+ outputStream.close()
+ }
+ }
// Initialize the file name string from the file URI last path segment.
var fileNameString = fileUri.lastPathSegment
// Return the string.
return aboutVersionStringBuilder.toString()
}
-}
\ No newline at end of file
+}