Chrome now supports offline apps. Is there anyway to embed them in a Winforms application? I know there are ways to embed Chrome instead of IE
Related
I am developing a website crawler API to scrape a javascript-generated website. The website that we are crawling requires the Javascript to be enabled to fully-render the HTML. I have tried many solutions such as HtmlAgilityPack and AngleSharp, but they are just HTML parsers and they cannot render the page due to missing Javascript capability.
I tried implementing headless browser using Selenium.WebDriver.ChromeDriver, it worked very well in my local machine. However, our production environment is very limited such that only Internet Explorer browser is available and we are not allowed to install any more browser. So this chromedriver did not work, too. Internet Explorer cannot even fully render the website from the browser itself. So IE is definitely out.
Is there a way to scrape a javascript-generated website without having to install a browser? Like implementing a headless browser on a server without that browser installed?
Or is it a dead-end situation. Thanks!
You can try using a solution that uses a fully-functional built-in Chromium and doesn't require installing Google Chrome in the target environment. All the required Chromium binaries will be shipped with the solution.
There are many such solutions for .NET and C#:
CefSharp
An open source .NET wrapper around the Chromium Embedded Framework (CEF). It allows you to embed Chromium in .NET apps.
Supported by community. If you need help with the library use, read docs or ask community. If you need a feature or a bug fix, you would probably need to do it by yourself.
DotNetBrowser
A commercial library that allows integrating a Chromium-based browser with your .NET app to display and process HTML5, CSS3, JavaScript, etc.
It's a proprietary solution supported by a commercial company. If you need help with the library use, read docs or get help from the engineers of this product. If you need a feature or a bug fix, it will be done by the product team as soon as possible. I know that, because I know the engineers from DotNetBrowser team.
WebView2
This control allows you to embed web technologies (HTML, CSS, and JavaScript) in your native apps. The WebView2 control uses Microsoft Edge (Chromium) as the rendering engine to display the web content in native apps. With WebView2, you can embed web code in different parts of your native app, or build all of the native app within a single WebView instance. Supported by Microsoft.
If you need some help, you should contact WebView2 team.
I am using system.windows.forms.webbrowser in my Win forms application with IE as my default browser. Does the IE plugin/ Patch be applicable for my WebBrowser control?
No. If you read the document you will find that system.windows.forms.webbrowser is using embedded Internet Explorer regardless of what your default browser is.
AFAIK there is no built in way to use chrome as embedded browser in win form. You need a third party lib for that.
When I try to Open google map in my C# Application, I get this error:
You seem to be using an unsupported browser. Old browsers can put your
security at risk, are slow and don't work with newer Google Maps
features. To access Google Maps, you'll need to update to a modern
browser.
How can I upgrade my Browser there or How to get rid of this error?
Take a look at the approaches for upgrading IE in WebBrowser in this thread: use latest version of ie in webbrowser control
Alternatively, you can go for Chromium-based browser controls, to avoid compatibility issues. For example, here is a tutorial on embedding Google Maps using DotNetBrowser: Embed Google Maps In .NET Desktop Application.
The Windows Forms WebBrowser control (Visual Studio) hosts Web pages and provides Web browsing capabilities to your application.
Does the WebBrowser control have inbuild support for rendering content loaded through Javascript, CSS etc.? Or does it render only plain HTML?
It supports javascript, css and etc. WebBrowser component is wrapper of Internet Explorer, and it works like Internet Explorer installed on your computer.
Flash, Silverlight, Video play correctly too.
Also, you may interact with page content from your .NET code or call .NET methods from javascript through windows.external object.
My client WPF application needs to display an HTML page. I understand that the webbrowser control uses the version of IE that is installed on the box.
Is there a control to render HTML that can be totally embedded into my application so that it is not dependent on the version of IE, that the user has installed?
What would happed if a user is using IE6?
Thanks
You could always use WebKit .NET instead. It allows you to embed a WebKit browser in your .NET application without having to have extra software installed on the machine.
There is also geckofx if you would rather go the Mozilla Gecko route.