问题
I am creating a C# application that displays the google online applications, specifically Gmail in this situation. All is going well except that I do not know how to hide the ads that plugins that Firefox and Chrome have.
Anyone have any suggestions how I programmatically hide ads like the Firefox/Chrome plugins do?
回答1:
Insert a CSS rule into the page with lists of the ads, and make the display:none;
Example:
<style type="text/css">
.classname,.anotherclassname,#idname{
display:none;
}
</style>
来源:https://stackoverflow.com/questions/5195687/c-sharp-webbrowser-gmail-ads