WPF WebBrowser Control: What browser does it use? - wpf

Does the WPF WebBrowser control always use Internet Explorer or does it use the default web browser on the system ?
Regards,
MadSeb

One issue the Web Browser Control has that it’s perpetually stuck in IE 7
rendering mode by default. Even though IE 8 and now 9 have
significantly upgraded the IE rendering engine to be more CSS and HTML
compliant by default the Web Browser control will have none of it. IE
9 in particular – with its much improved CSS support and basic HTML 5
support is a big improvement and even though the IE control uses some
of IE’s internal rendering technology it’s still stuck in the old IE 7
rendering by default.
This applies whether you’re using the Web Browser control in a WPF
application, a WinForms app, a FoxPro or VB classic application using
the ActiveX control. Behind the scenes all these UI platforms use the
COM interfaces and so you’re stuck by those same rules.
See this:
Web Browser Control – Specifying the IE Version
http://www.west-wind.com/weblog/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Version

Internet Explorer, though there are "hacks" posted on the internet which allow you to use a workaround in order to launch any browser you like.
This thread seems to explain one of the possible solutions.

Related

Gesture support for WPF WebBrowser Control which is displaying a HTML5 Site

In a standard WPF app, I have a WebBrowser control which has been navigated to a HTML5 sample page (http://ie.microsoft.com/testdrive/Browser/BrowserSurface/).
In the browser outside the app, I can interact with this site as expected – move photo’s around, use gestures etc.
In the WebBrowser control the site does not work as expected. It renders, but it does not respond to any touch gestures – It will, however, zoom in and out when I pinch.
Is it possible to make the WebBrowser control pass gesture events etc so that I can interact with the site as I would in a normal browser?
Many thanks for any help with this!
Kris
I know this is an old question but I think this has something to do with the fact that the WebBrowserControl standard uses IE7 ActiveX. I had the same problem which always gave me JavaScript errors in the control for TouchEvents.
After I added some registery key to force the WebBrowserControl to use the latest IE version installed it worked.
Here is what I've add to my registery. Paste it in a txt file and save it as an .reg file. Then DoubleClick it. Or enter the key/value manual in your registery via Regedit.
I even included this in my application code to add the key/value automaticially if it doesn't exist yet.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
"RetailTestApplication.exe"=dword:270f
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
"RetailTestApplication.exe"=dword:270f
Sorry, the code plugin srews up.
Change IE version for the WPF WebBrowserControl
MSDN Internet Feature Controls (B..C)

Either Free or Paid alternative to Silverlight Web Browser Control to target visibility(z-index) problems?

I am using Silverlight WebBrowser Control in one of my application, and all the Silverlight Content hides behind the WebBrowser Control.
I know, we can't do anything about it and have read about the Air Space Issue also. I have also gone through the following links:-
How to place a WebBrowser control below other controls?
But its really required to solve it for my application, so I am looking for some alternatives, either FREE or can be PAID too.
I have read about the FireFox Gecko browser, but it seems it is a pure Windows Forms Control and I wonder whether I can use it in Silverlight or not, and also whether it will solve the z-index issues if we can at all use it in silverlight.
Does any body has any solution for this ? Either Free or Paid.
Thanks
Awesomium is a fairly decent browser since it uses chrome as it's base and it's a native control for WPF so it'll respect your z-index. However, it's a wpf control right now and it's not clear if SL is easily supported or not, but this may help.
Awesomium website: http://awesomium.com/
some mention on how to get a silverlight dll to use:
http://support.awesomium.com/discussions/questions/119-using-awesomium-with-silverlight-40

Alternatives to WebBrowser control in WPF?

We are working on a WPF app with the web browser control. When the user drags the window, the web browser lags behind the window as it drags.
Does anyone know how to solve this issue? Failing that, does anyone know an alternative to the web browser control itself?
Thanks!
Yes, as long as you don't require IE specific features you can use Awesomium which basically gives the same browser engine used by Google Chrome except for everything is rendered in pure WPF. For a while it was open source but I believe it is becoming a commercial product.
I haven't heard about any Native WPF WebBrowser Control. The only options I know are based on Win32 controls which are wrapped into WPF controls in order to displayed. (See more details at http://msdn.microsoft.com/en-us/library/ms752055.aspx )
Recently I have to use the WPF wrapper for the WebBrowser control, and it's very limited regarding the options available for the developer. During my research I found that you are able to inject scripts or html content in order to modify the page behavior. Also, you can call .NET code (e.g. CSharp function from Javascript).
However tasks such as accessing the cache, modifying cookies are difficult task or changing the web browser behavior are very difficult. Here is when you will have to use DLL Imports in order to invoke unmanaged routines (see http://msdn.microsoft.com/en-us/library/aa984739(v=vs.71).aspx )
It's possible to look for an alternative WebBrowser control such as:
http://code.google.com/p/csexwb2/
http://wpfchromium.codeplex.com/
I hope this helps
You can try CefSharp.Wpf which uses Chromium as a base browser. You can find it on NuGet

Anyone using Windowless mode in a Silverlight business app without animations?

We have a standard business application written in Silverlight for which we need to use Windowless Mode. This "feature" to use a Telerik Silverlight component.
Using Google I have found lots of bad things that can go wrong with windowless mode with regards to mixing HTML content and animations. I am interested in knowing if bad things will happen if the silverlight app is the only content in the browser window.
Thanks in advance for sharing your experience.
Mike
Windowless actually improved the way Silverlight and html interact. Without windowless set, Silverlight is just painted on top of the html. Setting windowless is the only way to have html on top of silverlight or to have a transparent silverlight application.
The major downside to windowless is that it forces silverlight to be software rendered instead of hardware rendered. This means that the power of the GPU can't be utilized for things like animations.
If the silverlight app is the only thing in the browser window, the only real difference between windowless and not is the performance issue mentioned above.
An example of Windowless mode with lots of animations and mixed in HTML is the Office Labs Silverlight site. NOTE: You need to click the "Try in Silverlight" on the plain HTML version of the site to see the Silverlight version.
That site uses a floating iframe to display HTML inside of the Silverlight content. Most of the animations work just fine, however, you can't scale the HTML very easily so the HTML is hidden while some of the animations are performed.
Let me know if you have any other questions about the site.

Silverlight 3 - Can I run Out-of-browser inside another application

The new Silverlight 3 beta includes the ability to run Out-of-Browser applications. The demos so far show this only inside a special frame. Does anyone know how I can run Siverlight 3 controls inside a (WPF) application?
No, you can not embed out-of-browser silverlight into WPF. The sllauncher.exe standalone frame has a special handler for the offline://(hostname).(revision)/ url given to it to allow the app to have all the features of out-of-browser mode (like extra keyboard access). Unless you can find a way to embed this app into your app, you won't be able to get out-of-browser; if you know some way to do this the address for this app is:
C:\Program Files\Microsoft Silverlight\3.0.40307.0\sllauncher.exe
As others have said, however, you can embed a silverlight control inside of an html page and that inside a WebBrowser element. Be cautious with this method, however, since there is currently no x64 support for Silverlight and if you absolutely must do this make sure to compile specifically for x86.
I'm guessing (yes, shame on me!) but you can probably put a WPF web browser on your window and navigate to the Silverlight app inside it.
This is a supported scenario; a recent MSDN article stated this scenario was supported, and scenarios like this forced the CLR team to allow multiple CLRs loaded into a single process.
It seems that SLOOB apps run inside a host process (C:\Program Files\Microsoft Silverlight\3.0.40307.0\sllauncher.exe). This hosts and sandboxes the app.
I suspect that it will not be possible to host it yourself - sorry if that's a little close to guessing, but short of running a hosting web browser in your WPF app I can't think of a way around the sandboxing requirement.
HTH
You can host a browser control inside a windows app, and load silverlight inside the browser control. This is how live mesh is going to do it.

Resources