How do I get WebKit or IE to call my application (.NET) from an HTML page open in a browser?

I have a .NET application running on Windows. I want to click on some element of the page (flash application for a button, etc.) to start my application with some special parameters. (It should work not only in IE, but also in Windows browsers based on WebKit). During the installation of the application, we assume that the user is an administrator and is running Vista or Windows 7 or later.

So my question is: where to get examples of such an interaction (with the source, of course)?

So how do you get a WebKit browser or IE to call your .Net application?

+7
internet-explorer webkit
source share
5 answers

Register a custom URL protocol handler . Then you can specify the URL using links, etc .:

<a href="myapp://doSomething/>Click to run my app!</a> 

<h / "> I can confirm that this works in all versions of Internet Explorer. I also tested it in the latest versions of Firefox (3.6) and Chrome (whose version eludes me). Chrome will not allow you to enter the user protocol in the address bar, but it launches applications from links using custom protocols.

If you have Adobe Reader installed, the acrobat:// protocol is logged. Unfortunately, SO does not allow links using custom protocols, so I cannot add an example here, I'm afraid.

+11
source share

You cannot have a Webkit-based browser to open the application directly. Your best hope (and what Apple is doing to open the iTunes Store) is to have your .NET application registry open for certain types of URLs, use a link pointing to that type of URL.

For example, if your application can open the URLs myapp:// , you can use the following HTTP header:

 Location: myapp://mysettings 

or more ordinary link:

 <a href="myapp://mysettings">Foo</a> 

And then the browser will take care to open an application that can handle the myapp:// URL scheme (in this case, your application).

+3
source share

Given that the running application and browser work on Windows, a registered protocol handler is the best way to go, assuming all interesting browsers support it. Given that the link above is from the MSDN documentation for Internet Explorer Development , I can imagine that some browsers may not want to support this mechanism.

0
source share

I would suggest that the only way to do this is to round to the server. The web page is launching something on the server. The application is also connected to the server. I think it is probably unreasonable to do it differently. If you want to get really dirty, you can use Flash LocalConnection (which uses a memory-bound file for communication) to chat in a .net application. Darron Schull managed (but does not share).

If this requires an application, why bother with a web page?

0
source share

You can register a protocol handler that points to your application, and then a link pointing to a URL with that protocol and any parameters you need.

0
source share

All Articles