I use wkwebview to load one js file(not js string) and show webp file,but it doesn't work.
I think the problem is in the loading way of the js file.
About webpjs.js file,you can visit https://webpjs.appspot.com/,I rename webpjs-0.0.2.min.js to webpjs.js.
I think the problem is in the loading way of the js file.
B4X:
Sub WKWebView_PageFinished (Success As Boolean, Url As String)
Dim jss As String
jss=$"<script type="text/javascript" src="${WebViewAssetFile("webpjs.js")}"></script>"$
WKWebView.EvaluateJavaScript("", jss)
End Sub
B4X:
Sub WebViewAssetFile (FileName As String) As String
Return $"file://${File.Combine(File.DirDocuments, FileName)}"$
End Sub
About webpjs.js file,you can visit https://webpjs.appspot.com/,I rename webpjs-0.0.2.min.js to webpjs.js.
Last edited: