https://www.bing.com/search?q=кму here I want to switch the bing icon to google I attempted :
if (url == "https://www.bing.com/search?q=")
{
view.evaluateJavascript(
("\n"+
"windows.addEventListener(load, (event) => {\n" +
" let \"style\" = document.head.appendChild(document.createElement(style));\n" +
" style.innerHTML =\".b_logo:after\" {content:url(https://www.google.ru/images/branding/googlelogo/2x/googlelogo_light_color_92x30dp.png);\n" +
" };\n"+
"!important;\n"+
"});"),
null
)
}
I initiated it here : override fun onPageFinished(view: WebView, url: String) {
I also attempted :
view.loadDataWithBaseURL("baseURL", "htmlString", "text/html", "UTF-8", null)
val htmlString = "<html><body><.b_logo:after='https://www.bing.com/rp/tfpoqzYv42r7UjQvzw0PVIoT2nY.png'></body></html>"
val newHTMLString = htmlString.replace("<.b_logo:after=\"'https://www.bing.com/rp/tfpoqzYv42r7UjQvzw0PVIoT2nY.png'>", "<.b_logo:after='https://www.google.ru/images/branding/googlelogo/2x/googlelogo_light_color_92x30dp.png'>")
view.loadDataWithBaseURL("baseURL", newHTMLString, "text/html", "UTF-8", null)