Hi
how to change the background color in an html file. In b4a I could do it with webview extras and Javascript
code B4A:
B4X:
Private WebView1 As WebView
Private wve As WebViewExtras
Dim JSClient As DefaultJavascriptInterface
JSClient.Initialize
wve.Initialize(WebView1)
wve.AddJavascriptInterface(JSClient,"B4A")
wve.LoadUrl(xui.FileUri(File.DirAssets,"myfile.html"))
Sub WebView1_PageFinished (Url As String)
wve.ExecuteJavascript("document.body.style.backgroundColor = '#DDC8B0'")
End If
WKWebView1.EvaluateJavaScript("bgcolor","document.body.style.backgroundColor = '#DDC8B0'")
Sub WKWebView1_JSComplete (Success As Boolean, Tag As Object, Result As String)
If Success And Tag = "bgcolor" Then Log("Background color has been changed")
End Sub
WKWebView1.EvaluateJavaScript("bgcolor","document.body.style.backgroundColor = '#DDC8B0'")
Wait For WKWebView1_JSComplete (Success As Boolean, Tag As Object, Result As String)
If Success And Tag = "bgcolor" Then Log("Background color has been changed")
Maybe there is any specific CSS (background color) applied to another tag containing all the other tags. You need to find that tag and apply background color to that tag.