Updated on 2026-08-14

This commit is contained in:
Tangem 2024-12-11 23:52:53 +04:00
parent 1524ae4ce4
commit ff0dffd2dc
5 changed files with 55 additions and 84 deletions

View file

@ -0,0 +1,30 @@
package com.tangem.core.ui.webview
import android.webkit.WebSettings
import android.webkit.WebView
/**
* Applies set of settings to prevent base security issues
*
[REDACTED_AUTHOR]
*/
fun WebView.applySafeSettings() {
settings.apply {
// disable to use scripts
javaScriptEnabled = false
// disable access to files
allowFileAccess = false
// disable access to content by system content provider
allowContentAccess = false
// disable to use cached data (scripts, files, etc)
cacheMode = WebSettings.LOAD_NO_CACHE
// disable to use local storage
domStorageEnabled = false
}
setDownloadListener(null)
}