title: How to block the images on web browser
body: <p>I am building a C# application with a <code>WebBrowser</code> and I am trying to figure out a way to block images, i.e. for them to to not display when a website is loading (so that the website loads more easily).</p>
  
  <p>I've tried to remove the <code>&lt;img&gt;</code> tags by getting it via <code>webBrowser1.DocumentText</code> and using <code>Regex.Replace</code> to remove the images, but then it shows me a blank page with <code>aaa</code> when I'm using the code. Is there a better way to remove the images? Any help greatly appreciated.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>var html_source = webBrowser1.DocumentText;
  var newOne = Regex.Replace(html_source, "&lt;img.*/&gt;", "", RegexOptions.Multiline);
  webBrowser1.DocumentText = newOne + "aaa";
  </code></pre>
  
  <p><strong>Update:</strong></p>
  
  <p>I have tried below code (just for testing) but is still shows me just <code>aaa</code>.</p>
  
  <pre><code>var html_source = webBrowser1.DocumentText;
  webBrowser1.DocumentText = html_source + "aaa";
  </code></pre>