**val v: View = inflater.inflate(R.layout.fragment_home, container, false) val webView = v.findViewById<View>(R.id.webview) as WebView webView.webViewClient = object : WebViewClient() { override fun onPageFinished(view: WebView?, url: String?) { // the first code i try for hiding the header // webView.loadUrl("javascript:(function() { var a= document.getElementsByTagName('menu-pusher');a[0].hidden='true';a=document.getElementsByClassName('menu-pusher');a[0].style.padding='0px';})()") // the second code i try for hiding the header // webView.loadUrl("javascript:if (typeof(document.getElementsByClassName('menu-pusher')[0]) != 'undefined' && document.getElementsByClassName('menu-pusher')[0] != null){document.getElementsByClassName('menu-pusher')[0].style.display = 'none';} void 0"); /* The Third Code i have try for hiding the header webView.loadUrl("javascript:(function() { " + "var head = document.getElementsByClassName('menu-pusher')[0].style.display='none'; " + "})()");*/ //The Last Code i have try webView.loadUrl("javascript:document.getElementsByClassName('menu-pusher')[0].style.display='none'"); } } //the webpage i am trying to load and hide the header webView.loadUrl("https://sadeeqtech.com.ng/stech") return v } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)