webbrowser-control

Detect if javascript is enabled in a winforms/mfc embedded browser

I have a native (windows) application that has an embedded web browser. Currently I'm invoking a javascript function from the backend (c++/c#). However, if javascript is disabled this fails and I'd like to provide a fallback mechanism. Is there a way to determine if javascript is disabled? ...

Responding to HTML hyperlink clicks in a C# application.

Question: How can I detect and handle clicks on hyperlinks in a Windows.Forms.WebBrowser control in C#? Background: My C# application does not carry a centralised help file. Instead, all the pieces that make up the app are allowed to display their own little help topic. This was done because the application is merely a framework, and ...

Open Default browser with Mono+gtk#

I need to open an url from my application, on both linux and windows and i want to avoid replacing an existing page on an open browser. How do i call for it to open? I know i can use System.Diagnostics.Process.Start("http://mysite.com"); which should also work under linux, but this will replace any page shown on an already open brow...

Tracking down a AccessViolationException in WPF

I've written a WPF application that uses many Frame controls to view camera feeds. When deployed, it crashes pretty randomly (anywhere from 2 hours to 16+ hours), and I see these in the event log, consecutively: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other...

C# webbrowser sudden refresh

I use Visual studio 2008. In my form there is a System.Windows.Forms.WebBrowser control. I have a custom header in the form just above the webBrowser control. In the webBrowser there is a form with a select/drop-down thing made with html. When I click the drop-list and it overlaps the custom header (because of the many options in it) The...

WebBrowser control, isolation and IE8 InPrivate mode

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 m...

Set System.Windows.Controls.WebBrowser's content to a static HTML literal?

Hello! I want to set up inline content of a WPF WebBrowser control: <WebBrowser> <html> <body><b>Inline content.</b></body> </html> </WebBrowser> Or alternatively: Dim wb As New WebBrowser wb.Content = "<html><body><b>Programmatic content</b></body></html>" ...

WebBrowser Control is Running into Javascript Error that IE doesn't...

If I use IE I can visit the website I want and click the 'Next' button and life is good. If I open that same website using the webBrowser control and click the 'Next button I get a javascript error message. I'm not doing anything in the code to manipulate the website. My goal, eventually, is to have some level of automation; but at th...

Tracking activity in a WebBrowser control from a Windows Form Host

Disclaimer: I'm asking on behalf of a client, and have not witnessed this issue first hand. He has a third party app that produces training media, which his training application presents in a WinForms app through the WebBrowser control. The interfaces he has been able to access on the WebBrowser control, on the surface of things, don'...

Weird browser behaviour with HTML anchors in C# WebBrowser control

I have a WebBrowser control which I populate with HTML then display. The HTML contains a few links pointing to anchors in the same page... <html> <head></head> <body> <a href="#myTarget">jump</a> <!-- further down page --> <a name="myTarget"><h2>A heading</h2></a> </body> </html> If I run my app v...

IE Webbrowser control cannot be instantiated on one machine, but all others due to threading

We have a C# application that instantiates the web browser control and navigates it to a few pages. Our application is definitely marked as STA, and I have no problems building/running the application in both my dev environment, and across all our test machines. But another developer takes the same code, same version of Visual studio, a...

Getting Print media CSS style applyed web page in WebBrowser control in C#

Hi all, We would like to print the Web page loaded onto WebBrowser control in C# .net application.We have custom printer driver to print the bitmap images, now our task is to get the printer friendly version of web pages by applying print media CSS style to webBrowser control. Do you know the method /code to get the Printer friendly v...

WebBrowser control resource leak

I'm working on a .NET application that loads web pages using multiple WebBrowser controls. There are several threads and WebBrowser controls involved (this is a server application), each thread creating a WebBrowser control and running a message loop for it. My question/issue is related to the WebBrowser control. Every time a web page i...

How to load two websites in one page?

I don't want to use frame or iframe because most websites are busting it nowdays. what are the possible methods to do this? The intended behaviour is as if like two browser controls loaded in a website. ...

How to programatically click or invoke a javascript method using System.Windows.Forms.WebBrowser?

I tried with no success: webBrowser1.Document.ExecCommand("alert('Hello World!')", true, null); also tried: private void webBrowser1_DocumentCompleted(object sender , WebBrowserDocumentCompletedEventArgs e) { webBrowser1.Document.InvokeScript("alert('Hello World!')"); } ...

How to set and delete cookies from WebBrowser Control for arbitrary domains

How can I set and delete cookies for a domain in webbrowser control without using Javascript (which doesn't allow to set / delete cookies without navigating to the website first.) ...

Displaying spinner waiting indicator while loading web page

Hi I have a WPF application that is loading web pages. Some of the web pages taking long time. I want to display an indicator like spinner I have the spinner already and using it in other places of the WPF using the storyboard animation of the WPF. The question is, can I use it in the web browser control? Can you let the web browser con...

Incerease DPI resoultion for web page loaded into WebBrowser conriol in C#

Hi All, We would like to display text and images of an web page in higher DPI for example take 300 DPI, but by default C# webbBrowser control uses 72/96 DPI which is currently system uses. Is their any ways to setup the user defined DPI value to the webbBrowser control so that web page gets rendered in higher DPI value. Any help will ...

Tables created programmatically don't appear in WebBrowser control

I'm creating HTML dynamically in a WebBrowser control. Most elements seems to appear correctly, with the exception of a table. My code is: var doc = webBrowser1.Document; var body = webBrowser1.Document.Body; body.AppendChild(webBrowser1.Document.CreateElement("hr")); var div = doc.CreateElement("DIV"); var table = doc.CreateElement("...

WPF WebBrowser control doesn't enter design mode when the document property is changed

Dear LazyWeb, I have a frustrating problem. Here's a simplified version of what I'm doing: A UserControl in c# contains a toolbar and an embedded WebBrowser object. The toolbar contains an "Edit" button, which when clicked sets the webbrowser control in design mode. Another button, "Cancel", turns off design mode. Pseudocode (very sim...