简体   繁体   中英

How to hide/block certain elements by ID in awesomium in VB.NET?

I'm looking for a code to hide/block specific elements by ID in VB.NET?

Working native Webbrowser Code

 Dim ele = WebBrowser1.Document.GetElementById("header")
 If ele IsNot Nothing Then
     ele.Style = "Display:none"
 End If

Use JavaScript ( ExecuteJavascript ), something like

WebBrowser1.ExecuteJavascript("document.getElementById('header').style.display = 'none'");

Or you can use CustomCSS property in WebPreferences .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM