With this module, your Javascript code in HTML can call NodeJS functions
directly:
<html><head>
<title>testfs</title>
<script>
var fs = require('fs');
function test_fs() {
var output = document.getElementById ('output');
output.innerHTML = '';
fs.readdir(".", function (err, files) {
var result = '';
files.forEach(function (filename) { result += filename + '<br/>'; }
);
output.innerHTML = result;
});
}
</script></head>
<body onload="test_fs()">
<p id="output"></p>
</body>
</html>
Project URL:
https://github.com/rogerwang/node-webkit
Inside it, the webkit's mainloop is integrated into Node's libev. And
the contexts in Node's V8 and WebKit's V8 are bridged with references so
they can access each other.
This project is still in early stage. Currently only Linux is
supported. We'll keep working on it, make it better and bring it to more
platforms. It will be developed in an open way and we have a mailing
list: node-...@googlegroups.com . Welcome to join.
Thanks
--
Roger WANG Intel Open Source Technology Center
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
btw random but the main downside I see with this technique is it opens the door to the XSS attack from hell. :)
webOS already did that :) Although we guard against it a bit by only
lowering the XSS protection for code run from local file:// URLs in
application mode, not from random web pages. Trying to navigate to a
remote URL from an installed app has the URL sent to the separate
"browser" WebKit instance.
> Nice work. I tried this a while back and got overwhelmed. Best of
> luck. I would love to make desktop apps in node using HTML5 as the
> GUI.
Thanks. We've got some ideas from the TODO list of topcube project :)
> I'm also very excited for a project like this, I hope you nail it! Is
> this an Intel project, or is it a personal project?
It's an Intel project. Here we have a high level and long term strategy
for supporting web applications, or applications written in web
technology. And this project is one of the efforts.
We definitely want to encourage developers to write applications on this
runtime. So feature requests are welcome :)
> btw random but the main downside I see with this technique is it opens
> the door to the XSS attack from hell. :)
Currently Node APIs can only be used in pages loaded from local. Does it
help?
If this goes to mobile, maybe we'd like to see more security features in
it. Like a controlled list of node modules that applications are allowed
to require().
> On Wed, Jan 4, 2012 at 12:56 PM, Ted Young <t...@radicaldesigns.org> wrote:
>> I'm also very excited for a project like this, I hope you nail it!
>> Is this an Intel project, or is it a personal project?
>>
>> btw random but the main downside I see with this technique is it
>> opens the door to the XSS attack from hell. :)
>
> webOS already did that :)
Good to hear that :) especially after webOS is going to be open sourced!
May I know in which version is this feature?
It's been there from 1.0 -- local apps have always had the ability to
make XHRs to other domains, otherwise they wouldn't be able to talk to
any servers.
Now, running node.js code wasn't added until webOS 2.0, but that's
done through a separate service system. We've not had the ability to
run webkit from node -- just the other way, a local WebKit app can
make calls to a locally running node.js service that has the ability
to stay running in the background.
> Roger, I get HTTP/1.1 403 Forbidden when I try to query the dpkg repo
> for the build dependencies? Is there a username and password
> required?
There isn't any password. It seems to be just Amazon S3 returning that
code for files not found.
> (I'm on oneric)
It should be oneiric. Maybe there is a typo in your sources.list?
> Are you trying to achieve something like Chromeless project?
> http://mozillalabs.com/chromeless
>
> using Chromess, you can develop desktop apps using HTML5, CSS,
> Javascript and compile it to respective platform
Well, there might be some similarity in the technology, but the ideas
are different. The single important idea of node-webkit is to call
*Node* modules from the (local) webpage. It opens a new way of writing
client side applications, and most importantly -- based on the great
Node platform with all kinds of modules and async I/O framework.