Is there a way to upgrade the HTML WebBrowser control in WPF? [duplicate] - html

Does the WPF WebBrowser control depend on the version of IE that is installed on the user's machine, or does it use a separate library that is consistent across machines? I've read that it only renders in IE7 mode, but I want to make sure there wouldn't be any issues with a user who either doesn't have IE installed or is still on IE6 for some reason.

The MSDN remarks for WebBrowser indicate it rehosts the IE ActiveX control:
The WebBrowser control internally instantiates the native WebBrowser ActiveX control.
The WebBrowser ActiveX control is better known as Shdocvw.dll. This in turn wraps Mshtml.dll, and probably other DLL's given your environment. One caveat of rehosting this control is its setting for Browser Emulation:
For applications hosting the WebBrowser Control, the default value is 7000. To control the value of this feature by using the registry, add the name of your executable file to the following setting and set the value to match the desired setting.
0x7000 means IE7 compatibility mode. Therefore, if you would like your WPF application to render using some other mode you need to update the registry, as adapted from this example:
[HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
"MyApplication.exe" = dword:2328

I created a WPF app with a WebBrowser Control on a machine with IE11 and got this user agent string:
user agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3; .NET CLR 1.1.4322)
I created a WPF app with a WebBrowser Control on a machine with IE10 and got this user agent string:
user agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
Trident/7.0 indicates IE11 and Trident/6.0 indicates IE10. More about user-agent strings.
The system with IE10 also had the page render differently than the system with IE11. I also verified this with the standalone IE browsers on each system.
I've yet to try it on a system WITHOUT IE or a system running IE6, but it seems that WebBrowser control is related to the version of IE currently installed on the system.

Related

ASP .NET Core Web Application Object reference error with Chrome v80

I create an ASP .NET Core Web Application with ASP .NET Core 2.1 in latest Visual Studio 2017 Version 15.9.20. I add zero line of code. It builds without error, but it shows below error when I clicks 'IIS Express' to run it. It shows even before the break point in Main function hits, which makes me could not debug it. Any idea? Thanks.
Object reference not set to an instance of an object
After more attempts, it works with IE 11 (version 11.0.175). But not Chrome Version 80.0.3987.122 (Official Build) (64-bit), but, why?

What are the project types supported by Windows store?

Are only universal windows platform (UWP) applications supported by Windows store or normal desktop applications such as win32 are also supported?
Also what is the difference between win32 project and a general empty project? is it the same but just with a console in the output?
Thanks in advance.
Are only universal windows platform (UWP) applications supported by
Windows store or normal desktop applications such as win32 are also
supported?
Currently the project types accepted by Windows Store include Windows universal apps for Windows 10 and 8.1 and Windows Phone Silverlight project:
For desktop application, only Win32 desktop apps using .NET 4.6.1 can be published to the Store via Desktop Bridge.
After you generate your converted package, you need to fill out this form and you'll acquire the permission to publish your package once your request gets verified.
Also what is the difference between win32 project and a general empty
project? is it the same but just with a console in the output?
You might refer to the response from #Elegentin Xie in this thread, which indicate the difference between them.

Win32 API support in WIndows 8.1 phone

I heard that few of the Win32 APIs are not supported in Windows 8.1 phone. I have an c++ application which is using some Win32 APIs. How to check whether my application will work on Windows 8.1 phone?
You can find the list of supported Win32 functions on MSDN. However, since it can be hard to match supported functions with your code, you might as well try to compile the code yourself and check the errors (if any).
It mostly depends on what you were doing with win32. The list of functions is quite limited IMHO.
The best way is to run the WACK (Windows Application Certification Kit).
Right-click project, choose Store, then Create App Packages...
Say "No" to upload packages, then click Next
Select ARM & x86 release builds, then click Create
Click Launch WACK on the next screen
You might have to download a WACK update before you can certify (it changes pretty regularly as new APIs are enabled).

Redirecting traffic on Windows Phone 8(.1)

We are looking for a way to programatically intercept global network traffic on Windows Phone 8 or Windows Phone 8.1.
I currently know two ways to intercept traffic:
Proxy server
VPN (proprietary network, where all traffic is routed through a specific server)
On both Android and iOS we use a proxy server. On Android we use specific manufacturer SDK's to set proxy configuration and on iOS install a proxy profile.
We wish to implement the same functionality on Windows Phone 8 and newer.
According to my research, Windows Runtime supports proxy configurations in code with Windows.Networking.Connectivity namespace. But according to the documentation, working with ProxyConfiguration class, the code throws NotImplementedException on Windows Phone 8.
The Windows.Networking.Vpn namespace is also not available on Windows Phone 8.
So apparently, both options are out here.
My first question is:
Is there any other way I could intercept and redirect traffic on Windows Phone 8?
Further research:
According to the documentation of newly released Windows Phone 8.1 SDK Preview, there are some changes in those namespaces. At least Windows.Networking.Vpn is now available, I am not yet sure for ProxyConfiguration class.
Is there any sample code or examples available on whether either proxy configuration or setting VPN programatically is possible with Windows Phone 8.1 SDK?
I also cannot seem to find the correctly updated documentation for the newest SDK yet.
Thank you!
Windows Phone 8.1 supports the ProxyConfiguration class, BUT it is ment to get readonly info about the set proxies. So this is not a way to set a proxy in Windows Phone 8.1.

# in URLs getting encoded as %23 and passed through to server

Our single page app contains hash-based URLs (ie #map).
I've had a few errors show up in my logs similar to the one below:
[MissingControllerException] Controller class %23mapController could not be found.
It seems that under some condition the hash tag is being encoded rather than being treated as the special character that it is.
Incidentally, a grep through the source indicates one occurrence of navigation to that particular location,
<a href="#map">
I have not been able to recreate a scenario that triggers this issue. It happens only on infrequent occasion. It has been logged for IE 7-9. It is possible that this error may occur in other browsers, but it has only been recorded for IE. Sample user agents:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; 360SE)
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3)
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0)
Is anyone aware of a scenario under which this behavior might be exhibited?
Perhaps it has something to do with the proper encoding eg UTF-8 vs iso... on your client app.
I had this issue using Spring MVC, the default in my app it was utf but in apache it was iso