Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make WebKit or IE call your application (.NET) from HTML page opened in browser?

I have a .NET application running on windows. I want clicking on some page element (button link flash app etc) to launch my app with some special parameters. (It should run not just in IE but on WebKit based windows browsers too) During App install we suppose that user is Admin and is running Vista or Windows 7 or Later.

So my question is - Where to get examples of such interaction (WITH source of course)?

So how to make WebKit based Browser or IE call your .Net application?

like image 865
Rella Avatar asked Mar 12 '10 00:03

Rella


2 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>


I can confirm that this works in all versions of Internet Explorer. I've also tested it in the latest versions of Firefox (3.6) and Chrome (whose version escapes me). Chrome will not allow you to enter a custom protocol into the address bar, but it will launch applications from links using custom protocols.

If you have Adobe Reader installed, the acrobat:// protocol is registered. Unfortunately, SO doesn't allow links using custom protocols, so I can't add an example here I'm afraid.

like image 125
Andy E Avatar answered Nov 04 '22 06:11

Andy E


You can't have a Webkit-based browser to open an application directly. Your best hope (and what Apple does to open the iTunes Store) would be to have your .NET application register for opening certain types of URLs, use a link that points to an URL of this type.

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

Location: myapp://mysettings

or a more conventional 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).

like image 3
zneak Avatar answered Nov 04 '22 08:11

zneak