0

I want to create webbrowser (with the help of .Net Webbrowser control) whose requests can be controlled.
for example,
I could manage to prevent image load by removing img src.
But I am not able to find some way to limit request of webbrowser control for css files, js files and requests to image files used in CSS file.
This restriction is conditional. For some website I want everything natural but for some web site it should be configurable.

Reason: Want to send less requests to server, increase response time and reduce the traffic.

I am using below code to prevent loading images. Same way I want some logic which will prevent sending requests to css or any other files that I can decide.

private void webBrowser1_ProgressChanged(object sender, WebBrowserProgressChangedEventArgs e)
        {
            if (webBrowser1.Document != null)
            {
                foreach (HtmlElement imgElemt in webBrowser1.Document.Images)
                {
                    if (imgElemt.Id == "divImagePath")
                    {
                        continue;
                    }
                    imgElemt.SetAttribute("src", "");
                }
            }
        }