webbrowser-control

WebBrowser memory problem

无人久伴 提交于 2019-11-28 11:22:48
I have a .NET application that needs uses a WebBrowser to automatically navigate through a bunch of pages. But if I go to, for instance, Google and set Google Instant on, and then search anything and navigate manually through the next button several times, the memory used by my application will start increasing. The problem might be that Google Instant is somehow keeping data from previous pages, but even after I navigate somewhere else, such as "about:blank", the memory used won't decrease. This problem also occurs with IE 9. I started writing down my memory used at page 60 and this is what I

Calling method on correct thread when control is created in new Thread()

ぃ、小莉子 提交于 2019-11-28 11:20:20
问题 I've created a new WebBrowser() control in a new Thread() . The problem I'm having, is that when invoking a delegate for my WebBrowser from the Main Thread , the call is occurring on the Main Thread . I would expect this to happen on browserThread . private static WebBrowser defaultApiClient = null; delegate void DocumentNavigator(string url); private WebApi() { // Create a new thread responsible // for making API calls. Thread browserThread = new Thread(() => { defaultApiClient = new

Getting mouse click coordinates in a WebBrowser Document

百般思念 提交于 2019-11-28 10:51:48
问题 I am capturing click coordinates within a PictureBox but I want to achieve the same thing with a WebBrowser. After some research I found out that it is not possible to subscribe to the Mouse Click event of a WebBrowser control. What are the possible ways to capture the clicks? Is there a sort of element which would allow me to navigate through the page but still capture the click? I tried to create a transparent panel but transparent color doesn't mean see through as I see and when the

WebBrowser control throws seemingly random NullReferenceException

我与影子孤独终老i 提交于 2019-11-28 10:39:06
For a couple of days I am working on a WebBrowser based webscraper. After a couple of prototypes working with Threads and DocumentCompleted events, I decided to try and see if I could make a simple, easy to understand Webscraper. The goal is to create a Webscraper that doesn't involve actual Thread objects. I want it to work in sequential steps (i.e. go to url, perform action, go to other url etc. etc.). This is what I got so far: public static class Webscraper { private static WebBrowser _wb; public static string URL; //WebBrowser objects have to run in Single Thread Appartment for some

IE10 - how to prevent “Your current security settings do not allow this file to be downloaded” popup from appearing?

南楼画角 提交于 2019-11-28 10:15:49
I’m using wpf WebBrowser control (System.Windows.Controls) and I need to prevent users from performing various actions like downloading files or printing pages. I have disabled file download option in Internet Explorer options (Security tab -> Custom Level -> Downloads -> File Download). Because of that, after clicking let’s say on a pdf link, instead of a file download popup I get a popup with such a message: "Your current security settings do not allow this file to be downloaded". Is there a way to prevent this message from occurring? I just want no action to be performed from a user

Masking floating point exceptions with Set8087CW, SetMXCSR and TWebBrowser

点点圈 提交于 2019-11-28 10:11:47
As I am receiving "Floating point division by zero" exception when using TWebBrowser and TEmbeddedWB from time to time, I discovered that I need to mask division by zero exceptions Set8087CW or SetMXCSR. Q1: What would be the best approach to do this: to mask such exceptions early in the application startup and never touch them again (the app is multithreaded)? to use OnBeforeNavigate and OnDocumentComplete events to mask / unmask exceptions? (is there a chance that exception could occur after the document is loaded?) Q2: What would be the best "command" to mask only "division by zero" and

WebBrowserSite: how to call a private COM interface method in a derived class?

妖精的绣舞 提交于 2019-11-28 10:07:19
Here is the challenge. I'm deriving from the Framework's WebBrowserSite class. An instance of my derived class, ImprovedWebBrowserSite , is returned via WebBrowser.CreateWebBrowserSiteBase , which I override in my derived version of the WebBrowser class - specifically to provide a custom site object. The Framework's WebBrowser implementation further passes it to down to the underlying unmanaged WebBrowser ActiveX control. So far, I've managed to override IDocHostUIHandler in my ImprovedWebBrowserSite implementation (like this ). I'm now looking for more core COM interfaces, like IOleClientSite

WebBrowser control, isolation and IE8 InPrivate mode

瘦欲@ 提交于 2019-11-28 09:27:51
I have a need to run some automation tasks in a web browser control but I seem to be facing a few limitations/unknowns that I'm not 100% sure how to resolve. The application I'm running is not for public release, so I can enforce a prerequisite that IE8 is installed. GeckoFX ( http://geckofx.org ) would be great except it does not offer me an acceptable way to manipulate the DOM as I would using the WebBrowser's InvokeMember method on HtmlElement objects. WebKit.net would be even better but it's too early in its development to offer the functionality I need to do this either. This leaves me

Program to automate form field entry and result checking of webpage

隐身守侯 提交于 2019-11-28 09:11:46
问题 I am trying to create a program in C# (maybe using WinForms) which will enter a licence number into a form field of a specific website and validate whether or not the licence number is a currently valid licence. I am unsure as to where to start, as I can't even find the form field id in the source code of the website, and am unsure what technologies the website uses. Additionally, the purpose of this program will be to enter a list of license numbers and return the names and validation status

Internet Explorer 9 RC stops my WinForms WebBrowser control to work in editing mode

淺唱寂寞╮ 提交于 2019-11-28 08:49:23
Using the IHtmlDocument2.designMode property set to On to switch a WebBrowser control hosted on a Windows Forms form to editing mode suddenly stopped working after installing Microsoft Internet Explorer 9 RC. Question: Any chance to fix this? I already tried to tweak with doctype or with the EmulateIE7 meta tag but without success. (An example would be this project ) Update 2011-02-21: As Eric Lawrence suggested, I adjusted the "Zeta" example to set the document text before setting the edit mode. Unfortunately I did not manage to switch to design mode, either. Update 2011-02-24: Parts of the