Forum Xamarin Xamarin.Android

How to Hide Webpage Banner Using GetElementsByTagName or Other Method?

hexagodhexagod Member ✭✭✭

I've seen this code used in Android Studio but I can't figure out the syntax in Xamarin / C#. This appears to be an invokation of a javascript method which gets a page element by tagname and then sets the display style. Does anyone know how to format this for C# syntax? Is there a better way to hide a page banner?

discoverWebView.LoadUrl("javascript:(function() { " +
"document.getElementsByTagName('header'[0].style.display="none"; " +
"})()");

supposedly this is also the way I can display a small part of a webpage; I think this would be useful for other mobile developers aswell.

my full code is here:

https://github.com/hexag0d/bitchute_mobile_android_a2

thanks, in advance! =]

Sign In or Register to comment.