I am searching for a substitute of the WebBrowser control in .NET which can handle HTTPS. This question is similar here on Stack Overflow, but none of these controls offer HTTPS.
btw, just to mention, I tried all these
GeckoFx - development stopped
Se7en - this is actually continued GeckoFx
Webkitdotnet - no one replying on forum
but none of them support HTTPS, so I'm kind of stuck here :/.
Also, to mention, WebBrowser control that comes with .NET framework works just fine with HTTPS, but the reason I can't use it is because my app uses a lot of javascript that IE refuses to render, and for example Firefox (gecko engine) or Chrome (webkit) work just fine.
So, please if someone knows a good control that can do this (can be Webkit or Gecko wrapper, it doesn't mind, as long as it's not an IE wrapper).
Thanks!
Since I, apparently, cannot write a comment I'll just drop my 2 cents here..
Beginning with the next release (R14), MozNET (called 'Se7en' in the OP's post), will have support for HTTPS/SSL and the ability to accept/deny certificates.
EDIT: The R15 release will have the SSL handling for sure. I had to hold off on it because of a weird bug.. But, it's coming soon!
Your options here seem a bit limited. With IE8 and IE9 the JavaScript is not so bad, but if there is no possibility for your users to upgrade, I would suggest looking at a few things:
Mono.WebBrowser
Mozilla XulRunner - This is not directly a .NET control, but could be useful anyway.
Update:
I recently ran into this, might be interesting:
.Net binding for the Chromium Embedded Framework
After long googling I finally ended up using the same as I was using before. So Webkit from http://sourceforge.net/projects/webkitdotnet and I ended up purchasing a SSL certificate for my domain and now all is fine.
Related
webBrowser bug
I want to join youtube with web browser , but I get this message,any idea?
the browser used in visual studio is just IE (Internet Explorer) and since most websites doesn't support IE anymore, most popular sites like YouTube, Twitch, amazon, stack overflow ;) etc. use modern elements and the html/js/css in the website may not work with IE, so most websites either try to load the website or just show a "You need to update your browser version screen" (what you are experiencing right now)
EDIT: i found how to use Webview (not IE) so websites can work properly
https://blogs.windows.com/msedgedev/2018/05/09/modern-webview-winforms-wpf-apps/
(NOTE: This is WebView1, Not The Newer WebView2, Please See quaabaam 's answer, here is the link for the answer he/she gave "
Web Browser Control & Specifying the IE Version")
(NOTE 2: this link is from 2018 and its been 4 years now so im unsure if the code sample on the Microsoft blog post will work, this is due to .NET 6 and how it changes how you make methods and many more stuff)
I have to create a webbroswer in wpf that supports all the sites and scripts and play video , I have created but some site got crashed and not supporting .
Please provide solution.
What you ran into are probably error dialogs caused by JavaScript script errors. WPF WebBrowser control currently doesn't support disabling these dialogs and ignoring the errors. The WebBrowser control is based on Internet Explorer core and will have a hard time dealing with broken JavaScript, webpages will also sometimes report the web browser as old and inform the visitor about it, like FlipKart does.
One solution is to use WindowsFormsHost and host a Windows Forms equivalent - WebBrowser control - in it. The WF WebBrowser offers a property called SupressScriptErrors, which is not implemented by the WPF WebBrowser. That will hide the error dialogs for you, but you will still occasionaly receive a warning from the website saying they don't support the web browser used. That is out of your control unless you want to take a route of hacking the control to send a different User-Agent string and that will only fool broken UA detection, feature detection will still fail for things like HTML5 video, WebRTC and the like. More on this here.
You can also choose to embed Gecko (Firefox rendering engine) or Chromium. see here for more information on embedding alternative rendering cores as an alternative to IE COM wrapper offered by the framework.
Edit: this is also a possible solution, as it would seem. You will have to test it for yourself, though. I expect it to have less overhead than the WindowsFromHost element and although this uses reflection to develop against implementation, not interface, my opinion is it's safe to say the underlaying API in unlikely to change.
Iam coding a solution for web automation, I have been using the default web browser control in some of my past projects. However I have found that the performance of web browser control is not very good.
After running for some time it usually hangs the application and also sometimes leads to memory leaks if the application is executed for long.
I want to know if someone here has used Gecko - http://code.google.com/p/geckofx/ and whats its performance for doing long web scraping tasks. My application is in C#.
I've used the web browser control, but haven't used GeckoFX. Having said, that, the project description for GeckoFX specifically mentions the class model for exposing the HTML DOM. This leads me to believe that the GeckoFX control may be better suited to automation. The web browser control's support for the DOM is not very robust.
If you're looking for something more lightweight, try SimpleBrowser for .Net - open sourced at Github.
https://github.com/axefrog/SimpleBrowser
we are tasked with basically emulating a browser to fetch webpages, looking to automate tests on different web pages. This will be used for (ideally) console-ish applications that run in the background and generate reports.
We tried going with .NET and the WatiN library, but it was built on a Marshalled IE, and so it lacked many features that we hacked in with calls to unmanaged native code, but at the end of the day IE is not thread safe nor process safe, and many of the needed features could only be implemented by changing registry values and it was just terribly unflexible.
Proxy support
JavaScript support- we have to be able to parse the actual DOM after any javascript has executed (and hopefully an event is raised to handle any ajax calls)
Ability to save entire contents of page including images FROM THE loaded page's CACHE to a separate location
ability to clear cookies/cache, get the cookies/cache, etc.
Ability to set headers and alter post data for any browser call
Process and/or thread safe would be ideal
And for the love of drogs, an API that isn't completely cryptic
Languages acceptable C++, C#, Python, anything that can be a simple little background application that is somewhat bearable and doesn't have a completely "untraditional" syntax like Ruby.
From my own research, and believe me I am terrible at google searches, I have heard good things about WebKit... would the Qt module QtWebKit handle all these features?
You might try one of these:
http://code.google.com/p/spynner/
http://code.google.com/p/pywebkitgtk/
I know you mentioned you don't like Ruby syntax (neither do I), but I just have to chime in and say that Watir is probably the best thing out there for what you are trying to do.
EDIT: There appears to be a Java counter-part called Watij
I've only been digging into this recently myself, so I couldn't say that this does everything you've listed, but check out GeckoFx.
From the site: GeckoFX is an open-source component which makes it easy to embed Mozilla Gecko (Firefox) into any .NET Windows Forms application. Written in clean, fully commented C#, GeckoFX is the perfect replacement for the default Internet Explorer-based WebBrowser control.
As for my own impressions: it has blown away the default .NET WebBrowser in both performance and stability.
I need JavaScript working almost perfectly in my application that should be able to access web content and let user take a control of it. However, webbrowser component pops new windows in separate instance / application of Internet Explorer and dotBrowser doesn't work with JavaScript properly.
Please, give me some advice - I'd even take some working example and enhance it with function I need it for.
Give a look to GeckoFX, is on open-source component for embedding the Mozilla Gecko (Firefox) in .NET applications.
I could be mistaken, but I believe new windows can be controlled (or at least suppressed) using the Web Browser control in .NET. Have a look at the NewWindow event.
I have had experience embedding both WebKit (Apple Core, used in Chrome) and XULRunner (Gecko) cores in .NET winforms applications. Let me give you some advice:
GeckoFX is your best bet. It is licensed under MPL and it works pretty much out of the box.
Follow the instructions carefully and pull the exact XUL version that is indicated. I would say it works better than the WebBrowser control. There is some talk of a significant delay when loading XUL for the first time but I've found it to be negligible. Branding and the like is fully customizable via external files.
WebKit is embeddable with SwiftDotNet. If all you need is solid javascript performance then this may be an option. If you need to be able to download files, then you have some work cut out for you.
Your downside with both routes is a nasty ~7-8mb overhead, even with compression (although I was able to get 6.5mb with lz compression in NSIS). If you are not creating distributable consumer-facing software then this may not be a problem for you.