webbrowser-control

Allow System.Windows.Forms.WebBrowser to run javascript

大城市里の小女人 提交于 2019-12-01 01:13:23
Seriously - read the question all the way through before attempting to answer it. "Use a different browser" doesn't answer this question. The question is this: How do I get a System.Windows.Forms.WebBrowser control to display a web page that has Javascript embedded in it when I have no control over the incoming page? I've already seen people suggest adding registry values for IE emulation ( Allowing javascript to run on a windows form web browser ) and altering the script settings in Internet Options/Security. I've done that already . So, here's the test - use a System.Windows.Forms.WebBrowser

Disable script debugging in IWebBrowser2 OLE control? C++

时间秒杀一切 提交于 2019-12-01 00:50:14
I have a IWebBrowser2 I use to visit some webpages with .Navigate() When the page has a js error I got a warning box for "Syntax error", so I used .put_Silent(TRUE) . And now I get a warning for "VS Just-In-Time Debugger: Unhandled exception" instead How can I disable all the script error warnings (including JIT debugger) from my code (i mean without modifying the real IE settings) ? You can disable script debugging by overriding the registry settings that control it. The correct way to do this is to implement the IDocHostUIHandler interface, and specifically the IDocHostUIHandler:

WebBrowser Control IE8 Compatibility Mode On/Off Switch

巧了我就是萌 提交于 2019-11-30 21:23:43
I am having a IE8 compatibility issue while using the WebBrowser control to navigate to a website. The strange thing is sometimes the website works, but more than likely it wont. I can refresh the page sometimes and it works as well. Just going to the page in IE8 I experienced the same CSS rendering problems so I switched to compatibility mode and it refreshed and rendered correctly. Is there a way to simulate this effect for the WebBrowser control. I want to be able to click a button and toggle the modes off and on like you can do in Internet Explorer. Is this possible? If so, anyone know how

Printing From WebBrowser control prints to wrong printer after setting default

浪子不回头ぞ 提交于 2019-11-30 21:12:59
I have a WebBrowser control in a VB.NET WinForms app. I am able to set the default printer from code and print without prompting the user. However, there is also a print button that shows the PrintDialog. If this action is done first the page will print. Then if I try to programmatically print later (again setting the default printer to some other printer) the it will print to the last printer selected in the PrintDialog box even though I am resetting the default and see the default printer being changed in Windows. Any ideas? It works fine unless ShowPrintDialog has a printer chosen first.

Security Level for WebBrowser control

对着背影说爱祢 提交于 2019-11-30 20:45:22
I am trying to migrate an .hta application to a C# executable. Of course, since it's an .hta the code is all HTML and Jscript , with calls to local ActiveX objects. I created a C# executable project and am just using the WebBrowser control to display the HTML content. Simply renamed the .hta to an .html and took out the HTA declarations. Everything works great, except that when I make calls to the ActiveX objects, I get a security popup warning of running an ActiveX control on the page. I understand why this is happening since the WebBrowser control is essentially IE and uses the Internet

DocumentCompleted firing multiple times - accepted StackOverflow answer not working

你离开我真会死。 提交于 2019-11-30 20:28:07
I test if my WebBrowser is completed with: webBrowser2.DocumentCompleted += (s, e) => { // Do stuff } The webpage I am accessing as tons of JS files and iframes and stuff, so I use the below function to make sure it's the actual page that's completed loading. webBrowser2.DocumentCompleted += (s, e) => { if (e.Url.AbsolutePath != (s as WebBrowser).Url.AbsolutePath) { return; } // Do stuff } However, it still doesn't appear to be working. Am I doing something wrong or is this syntactically correct and there's some other error in my code? noseratio DocumentComplete may get fired multiple times

Clear temporary internet files via “C#”

旧城冷巷雨未停 提交于 2019-11-30 20:08:32
问题 I am using webbrowser control in windows application.i was viewing url content inside the webbrowser control. here the url content values are stored in temporary internet files of user machine. when i click close button in my form i was deleting the temporary internet files programatically. and it is working fine. but during deletion a "message box came and saying deleting temporary internet files". here i dont want to show that dialog box during deletion. below is code to delete the temp

Disable script debugging in IWebBrowser2 OLE control? C++

一笑奈何 提交于 2019-11-30 19:54:23
问题 I have a IWebBrowser2 I use to visit some webpages with .Navigate() When the page has a js error I got a warning box for "Syntax error", so I used .put_Silent(TRUE). And now I get a warning for "VS Just-In-Time Debugger: Unhandled exception" instead How can I disable all the script error warnings (including JIT debugger) from my code (i mean without modifying the real IE settings) ? 回答1: You can disable script debugging by overriding the registry settings that control it. The correct way to

Host Silverlight in the Windows.Forms without the WebBrowser control

痴心易碎 提交于 2019-11-30 19:21:48
Is it possible to host Silverlight in the Windows.Forms without the WebBrowser control to avoid unnecessary COM marshaling? EDIT : The goal is to use a rich graphic content like WPF or Silverlight on older platforms like Windows 2000. All the available options to host Silverlight on a host like windows application are listed below: Msdn Documentation Rahul Gangwar Technical Consultant Microsoft Although it may be possible to hack a solution together that doesn't use IE as a host for Silverlight content, it would not be supported by Microsoft (and thus you may run into design and stability

How to disable caching in the .NET WebBrowser Control?

守給你的承諾、 提交于 2019-11-30 19:08:32
I have been googling for hours and trying to figure this out, and I just can't. I have 1 webbrowser control on a form, webbrowser1. Once I load a page, say google.com, if I use webbrowser1.refresh() or webbrowser1.navigate("google.com") , it's not reloading the page, it has it cached so it's just reloading the cache. This is terribly apparent especially on pages like forums or craigslist. I need to clear the cache between each refresh (not ideal) or disable caching all together, any ideas? The only things I've found are outdated (vb6 or lower). Add following meta tag in your pages <meta http