Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript desktop applications?

Is it possible to create Windows desktop applications in JavaScript?

I am aware of HTA (HTML Application) programs, but was wondering if there were a newer .NET or other solution where I could make use of the DLL libraries included with Visual Studio.

like image 285
posfan12 Avatar asked Jan 24 '11 10:01

posfan12


People also ask

Can JavaScript be used for desktop applications?

js can be used for building web, mobile, and desktop applications. Although it does not build desktop apps on its own, it can be used with Cordova or other similar tools to produce them.

Is Node JS good for desktop applications?

Multi-platform—Cross-platform support allows you to create SaaS websites, desktop apps, and even mobile apps, all using Node. js. Maintainable—Node. js is an easy choice for developers since both the frontend and backend can be managed with JavaScript as a single language.


2 Answers

Latest .NET version doesn't have such feature, but you've options to do it:

a) A WebBrowserObject in a WPF or Windows Forms application (it'll be an embedded Internet Explorer).

b) Opera Widgets, which is a Opera browser-based presentation engine which lets you implement desktop applications with standard Web technologies and it follows the W3C widgets standard. These applications can run standalone, meaning that user won't need to open Opera to run them. There's a counterpart: Opera must be installed in user's machine.

There're other options like Mozilla XUL but its limited support for desktop application development would prevent you from using it.

like image 141
Matías Fidemraizer Avatar answered Sep 21 '22 14:09

Matías Fidemraizer


I know this question is a bit old, but I thought I'd answer for the googlers out there.

You could use this project. Its basically a javascript interepter that has access to the .Net framework.

So you could do something like:

jish.assembly('path/to/System.Windows.Forms.dll');

var mb = jish.create('System.Windows.Forms.MessageBox');
mb.Show('Hello World');

And it works, I've not however tried more complex winforms apps so can't say whether it will fall down eventually.

Let me know if anyone tries it.

Edit 1: Well I tried it with a slightly more complex example and it worked also. Try this:

jish.assembly('path/to/System.Drawing.dll')
jish.assembly('path/to/System.Windows.Forms.dll')

var app = jish.create('System.Windows.Forms.Application');
var form = jish.create('System.Windows.Forms.Form');
var lbl = jish.create('System.Windows.Forms.Label');
form.Text = lbl.Text = 'Hello World!';
lbl.Location = jish.create('System.Drawing.Point', 50, 50);
form.Controls.Add(lbl);

app.Run(form);

Guido

like image 35
gatapia Avatar answered Sep 22 '22 14:09

gatapia