Click here to Skip to main content
15,887,917 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Is it possible to communicate with a desktop application from browser?

i want to do something like this,

lets say there is a button in my web application with a url to a data source and when button is clicked desktop application opens and get that data source url and process data with desktop application

is it difficult to do such thing? any examples that you know of?

any idea how to make a firefox extension to open program?


Regards
Posted
Comments
Sergey Alexandrovich Kryukov 24-Jan-12 22:32pm    
Why? why?!
--SA

1 solution

It is theoretically possible. I mean, a Web browser is just the application. It can do whatever you want if you design it to do so, so it could communicate with some desktop applications, too.

One way to do it is this: you can create your own .NET application embedding System.Windows.Controls.WebBrowser (WPF) or System.Windows.Forms.WebBrowser (System.Windows.Forms), please see:
http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx[^].

Also, on Windows, IE officially allows to use an ActiveX object on the page. This is another possibility to "leak" access to the desktop world from the Web application. (Some other browsers allow it unofficially, in the form of browser plug-in.)
Please see:
http://en.wikipedia.org/wiki/ActiveX[^];
this is how: http://msdn.microsoft.com/en-us/library/ie/ms970419.aspx[^].

This article explains why this is a very dangerous thing: http://en.wikipedia.org/wiki/Drive-by_download[^].

How about other "official" ways to access desktop machine from the Web applications by a reliable well-known browsers? The answer is: they don't do it, because if they did, they could not be trusted — this would be a serious security hole. I personally don't trust even the latest version of IE to browse non-trusted or unknown sites; I still need convincing arguments to trust.

[EDIT]

As to development of Firefox extensions, I hope you can trust yourself if you do it for access to your local machine. I'm less sure about your users. :-)

You can see this manual: http://www.rietta.com/firefox/Tutorial/overview.html[^].

See original documentation:
https://developer.mozilla.org/en/Extensions[^],
https://developer.mozilla.org/en/Building_an_Extension[^],
https://addons.mozilla.org/en-US/firefox/addon/web-developer/[^].

—SA
 
Share this answer
 
v5
Comments
Prashant Srivastava LKO 24-Jan-12 23:07pm    
Dashing,awesome links sir, my 5+
Sergey Alexandrovich Kryukov 24-Jan-12 23:20pm    
Thank you, Prashant.
--SA
Prashant Srivastava LKO 24-Jan-12 23:09pm    
Sir,Could I know what is the definition of your post that is, you are an architect
Sergey Alexandrovich Kryukov 24-Jan-12 23:21pm    
What do you mean by "post"? If you are interested in my architectural and related activities, you can find a lot of detail on my site which you can find in my CodeProject profile.
--SA
dinidusoft123 24-Jan-12 23:29pm    
awsome...very good article...you have explain all in all related background..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900