webbrowser-control

How do I display a popup from a WebBrowser in another window I created?

戏子无情 提交于 2019-11-26 03:36:21
问题 I am trying to implement a simple web browser control in one of my apps. This is to help integrate a web app into a toolset i am creating. The problem is, this web app absolutly loves popup windows.... When a popup is opened, it opens in an IE window which is not a child of the MDI Container form that my main window is part of. How can i get any and all popups created by clicking links in my WebBrowser to be a child of my MDI container (similar to setting the MDIParent property of a form)?

C# WebBrowser Control - Form Submit Not Working using InvokeMember(“Click”)

拜拜、爱过 提交于 2019-11-26 03:31:41
问题 I am working on automated testing script and am using the WebBrowser control. I am trying to submit the following HTML and testing when the user accepts the terms of service: <form action=\"http://post.dev.dealerconnextion/k/6hRbDTwn4xGVl2MHITQsBw/hrshq\" method=\"post\"> <input name=\"StepCheck\" value=\"U2FsdGVkX18zMTk5MzE5OUgFyFgD3V5yf5Rwbtfhf3gjdH4KSx4hqj4vkrw7K6e-\" type=\"hidden\"> <button type=\"submit\" name=\"continue\" value=\"y\">ACCEPT the terms of use</button> <button type=\

Changing the user agent of the WebBrowser control

人盡茶涼 提交于 2019-11-26 03:24:39
问题 I am trying to change the UserAgent of the WebBrowser control in a Winforms application. I have successfully achieved this by using the following code: [DllImport(\"urlmon.dll\", CharSet = CharSet.Ansi)] private static extern int UrlMkSetSessionOption( int dwOption, string pBuffer, int dwBufferLength, int dwReserved); const int URLMON_OPTION_USERAGENT = 0x10000001; public void ChangeUserAgent() { List<string> userAgent = new List<string>(); string ua = \"Googlebot/2.1 (+http://www.google.com

Detect WebBrowser complete page loading

老子叫甜甜 提交于 2019-11-26 03:10:22
问题 How can I detect when a System.Windows.Forms.WebBrowser control has completed loading? I tried to use the Navigate and DocumentCompleted events but both of them were raised a few times during document loading! 回答1: I think the DocumentCompleted event will get fired for all child documents that are loaded as well (like JS and CSS, for example). You could look at the WebBrowserDocumentCompletedEventArgs in DocumentCompleted and check the Url property and compare that to the Url of the main page

Disable JavaScript error in WebBrowser control

我的未来我决定 提交于 2019-11-26 02:53:10
问题 I am developing a windows application with a WebBrowser control that navigates to a sharepoint site. My problem is that i am getting JavaScript error. How can i disable the JavaScript error? I don\'t want them to pop up. 回答1: webBrowser.ScriptErrorsSuppressed = true; 回答2: This disables the script errors and also disables other windows.. such as the NTLM login window or the client certificate accept window. The below will suppress only javascript errors. // Hides script errors without hiding

Options for embedding Chromium instead of IE WebBrowser control with WPF/C#

别等时光非礼了梦想. 提交于 2019-11-26 02:39:51
问题 Internet Explorer-based WPF WebBrowser control suffers from some keyboard and focus issues and memory leak issues. As an alternative solution to these problems, we\'re considering available options for hosting Chromium instead of WebBrowser control in our WPF/C# project based around HTML editing. Similar questions have been asked here previously. I\'ve read the answers and done my own research, but I hope to obtain some more feedback from people who have actually used any of the following

Load local HTML file in a C# WebBrowser

南楼画角 提交于 2019-11-26 02:19:40
问题 In my app I have a WebBrowser element. I would like to load a local file in it. I have some questions: Where to place the HTML file (so that it will also be installed if a user executes the setup) how to reference the file? (e.g. my guess is the user\'s installation folder would not always be the same) EDIT I\'ve added the HTML file to my project. And I have set it up so that it gets copied to output folder. When I check it it is present when run: \\bin\\Debug\\Documentation\\index.html

How to fix a opacity bug with DrawToBitmap on WebBrowser Control?

点点圈 提交于 2019-11-26 02:14:37
问题 According to following link and my console application the method DrawToBitmap doesn\'t respect opacity. Proof link: http://social.msdn.microsoft.com/Forums/vstudio/en-US/e9704309-0c52-442d-80e0-2f8393dcd313/webbrowser-opacity-problem- My HTML code : http://fiddle.jshell.net/L37TC/ <div id=\"fader\" style=\"background-color: #ff0000\">ffff</div> <div style=\"background-color: blue; opacity:0;filter:alpha(opacity=0);\">HIDDEN TEXT!</div> SomeText My C# console code : var bmp = new Bitmap(640

WPF WebBrowser control - how to suppress script errors?

时光毁灭记忆、已成空白 提交于 2019-11-26 01:58:22
问题 I found a similar question here: How do I suppress script errors when using the WPF WebBrowser control? But non of those solutions work for me. I need to stop the popups from appearing as i am using the WebBrowser to automate admin tasks on a website. SuppressScriptErrors does not appear to be an available attribute on my WebControl :( 回答1: Here is a C# routine that is capable of putting WPF's WebBrowser in silent mode. You can't call it at WebBrowser initialization as it 's too early, but

Changing the user agent of the WebBrowser control

廉价感情. 提交于 2019-11-26 01:46:43
I am trying to change the UserAgent of the WebBrowser control in a Winforms application. I have successfully achieved this by using the following code: [DllImport("urlmon.dll", CharSet = CharSet.Ansi)] private static extern int UrlMkSetSessionOption( int dwOption, string pBuffer, int dwBufferLength, int dwReserved); const int URLMON_OPTION_USERAGENT = 0x10000001; public void ChangeUserAgent() { List<string> userAgent = new List<string>(); string ua = "Googlebot/2.1 (+http://www.google.com/bot.html)"; UrlMkSetSessionOption(URLMON_OPTION_USERAGENT, ua, ua.Length, 0); } The only problem is that