webbrowser-control

How to set FEATURE_BROWSER_EMULATION to IE8 mode?

放肆的年华 提交于 2019-11-27 02:25:13
问题 We are using an embedded SWT Browser in a Java application. The SWT Browser wraps an IE8 WebBrowser Control object. I am running into the well-known issue that by default, the WebBrowser Control uses IE7 mode instead of IE8 mode. (See http://blogs.msdn.com/b/ie/archive/2009/03/10/more-ie8-extensibility-improvements.aspx) Per this and other articles, I am trying to set the FEATURE_BROWSER_EMULATION registry value for my application so that the Browser defaults to IE8 mode, but I am having

WPF WebBrowser Mouse Events not working as expected

大憨熊 提交于 2019-11-27 02:11:33
I have a WebBrowser object in a WPF Page and I'm trying to do something whenever the user interacts with the page. I have intially tried to use the events associated with the WebBrowser object but they don't seem to be firing. Below is a simplified example of what my code is trying to do: webBrowser.MouseDown += new MouseButtonEventHandler(webBrowser_MouseDown); with the event handler as: void webBrowser_MouseDown(object sender, MouseButtonEventArgs e) { System.Windows.MessageBox.Show("Pressed"); } However when I run the page and click inside the WebBrowser no message box is displayed.

Perform screen-scape of Webbrowser control in thread

随声附和 提交于 2019-11-27 01:56:28
I am using the technique shown in WebBrowser Control in a new thread Trying to get a screen-scrape of a webpage I have been able to get the following code to successfully work when the WebBrowser control is placed on a WinForm . However it fails by providing an arbitrary image of the desktop when run inside a thread. Thread browserThread = new Thread(() => { WebBrowser br = new WebBrowser(); br.DocumentCompleted += webBrowser1_DocumentCompleted; br.ProgressChanged += webBrowser1_ProgressChanged; br.ScriptErrorsSuppressed = true; br.Navigate(url); Application.Run(); }); browserThread

Grabbing Cookies in Web Browser Control - WP7

放肆的年华 提交于 2019-11-27 01:43:18
问题 In order to log into a certain part of a website the users of my application require their cookie. To do this I need to grab it and pass it to url. Does anyone know how to grab a certain websites cookie from the browser control? I saw this method but wasn't quite clear. Thanks, TP. 回答1: As of WP 7.1 Mango "release", if one may call it, please see the WebBrowser Control Overview for Windows Phone. It has been recently updated a little bit, and it turns out that they actually have added some

How do I programmatically change printer settings with the WebBrowser control?

僤鯓⒐⒋嵵緔 提交于 2019-11-27 01:37:22
I finally figured out how to print transformed XML without prompting the user or showing an IE window, but now I need to specify a number of copies and possibly other printer settings. Is there a way to programmatically change printer settings on a WebBrowser control? The code in question: private static void PrintReport(string reportFilename) { WebBrowser browser = new WebBrowser(); browser.DocumentCompleted += browser_DocumentCompleted; browser.Navigate(reportFilename); } private static void browser_DocumentCompleted (object sender, WebBrowserDocumentCompletedEventArgs e) { WebBrowser

How do I submit a form inside a WebBrowser control?

℡╲_俬逩灬. 提交于 2019-11-27 01:37:20
问题 How can I create a program with C# to submit the form(in the web browser CONTROL in windows Apps)automaticlly ? 回答1: The WebBrowser control has a Document property, which returns an HtmlDocument. The HtmlDocument has several members you can use to traverse and manipulate the DOM. Once you've used these methods to find the form, you can use InvokeMember to call the form's submit method. If you know the page has a single form: foreach (HtmlElement form in webBrowser1.Document.Forms) form

Allowing javascript to run on a windows form web browser

萝らか妹 提交于 2019-11-27 00:46:42
问题 I want to use a Web Browser to access a website that uses JavaScript on load. I understand that Web Browser is a wrapper of the current installed version of Internet Explorer. However, testing the website on Internet Explorer yields no errors but does not work if I use the Web Browser to access the content. I have also looked at my internet security settings to ensure it is enabled. The issue I get is; 回答1: Awkwardly enough, I found the answer moments after posting this but I thought anyone

How to disable click sound in WebBrowser Control

只愿长相守 提交于 2019-11-27 00:42:37
I use Javascript to click a link in the webbrowser control. But I don't want to hear IE's "click" sound. Is there any way to do this? P.S. I don't want to change system settings. I've seen this one ( HowTo Disable WebBrowser 'Click Sound' in your app only ) but Document.Write is not an option for me. For IE7 and above, you can use this: int feature = FEATURE_DISABLE_NAVIGATION_SOUNDS; CoInternetSetFeatureEnabled(feature, SET_FEATURE_ON_PROCESS, true); using the following DLL imports private const int FEATURE_DISABLE_NAVIGATION_SOUNDS = 21; private const int SET_FEATURE_ON_THREAD = 0x00000001;

WPF WebBrowser Control: What browser does it use?

独自空忆成欢 提交于 2019-11-26 23:30:01
问题 Does the WPF WebBrowser control always use Internet Explorer or does it use the default web browser on the system ? Regards, MadSeb 回答1: Internet Explorer, though there are "hacks" posted on the internet which allow you to use a workaround in order to launch any browser you like. This thread seems to explain one of the possible solutions. 回答2: One issue the Web Browser Control has that it’s perpetually stuck in IE 7 rendering mode by default. Even though IE 8 and now 9 have significantly

Can I disable browser refresh in my webapp?

心不动则不痛 提交于 2019-11-26 23:20:40
问题 I want to disable refresh on my website. Is there any way to disable F5 , Ctrl - R , or reload in a webpage? 回答1: I have a suggestion. There is an answer box in this page. (Here below with Your Answer label) Type some text in it. Then refresh this page When you refresh there is some warning message displayed, I suggest you to display the similar warning message, instead of disabling the refresh functionality. 回答2: window.onbeforeunload = function () {return false;} This disables leaving the