0

i need to create a desktop application in C# that integrates a "web browser" more or less like an Android WebView, the purpose is to host a specific web site and provide it some javascripts functionality.

A similar question on StackOverflow is this one, but i need to do it only in .net c#.

I will add other explanation if needed.

Thank you

Community
  • 1
  • 1
Tharnadar
  • 65
  • 1
  • 9

3 Answers3

1

I think what you're looking for is the WebBrowser control. You can find more informations about what it is and how to use it here:

Saverio Terracciano
  • 3,885
  • 1
  • 30
  • 42
  • thank you Saverio, do you know if are there anyway to "inject" javascript function inside the WebBrowser control like the WebView? – Tharnadar May 08 '15 at 08:42
  • I don't know if first hand because I've never done it, but I can imagine you can intercept the content of the requested page, parse it, and add the bits of code you need before setting the modified page to the control. – Saverio Terracciano May 08 '15 at 08:43
0

Thank you Saverio and Tasos, you both helped me to find a good answer to my question.

Hosting and interacting with a webpage inside a WPF App

this is exactly what i need to do.

Best regards!

Community
  • 1
  • 1
Tharnadar
  • 65
  • 1
  • 9
0

There are different solutions on the net for embedded web-content. They are:

  • WebBrowser control from Microsoft (uses Trident engine that is installed on the client machine)
  • Awesomium.NET (uses Chromium engine that is packed with lib and lots of useful wrappers)
  • CefSharp (uses Chrome Embedded Framework)

I've used Awesomium.net, since you couldn't really rely on client's IE and CefSharp is pretty fresh and was not available back then. Awesomium has lots of useful features like Js execution from .NET code and vice-versa. But I'd recommend you to look at CefSharp since it's more perspective

maiksaray
  • 358
  • 2
  • 14
  • thank you maiksaray, it seems that Awesomium.NET allows to use html ui in .net application, but my needs is to use a web application hosted over the internet. Maybe CefSharp looks more relevant, i'll give it a look – Tharnadar May 08 '15 at 09:52
  • You can feed awesomium any remote content and it will work perfectly like any other browser. – maiksaray May 08 '15 at 13:28