Node + WebKit desktop app

2,118 views
Skip to first unread message

Andrew Seddon

unread,
Sep 6, 2011, 7:22:02 AM9/6/11
to nodejs
Is anybody aware of a desktop app project which bundles Node + Webkit
to make a native app using web tech.

The closest thing I've found is https://github.com/unconed/TermKit .

I just wanted to see if anybody has done this before we look at
rolling a cross platform solution ourselves.

Cheers,

Andrew

mscdex

unread,
Sep 6, 2011, 9:49:44 PM9/6/11
to nodejs
On Sep 6, 7:22 am, Andrew Seddon <sedd...@gmail.com> wrote:
> Is anybody aware of a desktop app project which bundles Node + Webkit
> to make a native app using web tech.

https://github.com/creationix/topcube

Sebastian Wick

unread,
Sep 8, 2011, 8:53:56 AM9/8/11
to nodejs
I work on node-gir (https://github.com/swick/node-gir) which will
include native gtk and webkit bindigs.

GeekBrit

unread,
Sep 8, 2011, 11:07:52 AM9/8/11
to nodejs
I'm doing this using a very simple wrapper around a Qt webkit
component. It is working well so far, the trickiest thing was casting
the magic runes needed to get the web sql database working (details
here: http://geekbrit.tumblr.com/post/9415350004/qt-webkit-web-database).
I'm not interacting with the webkit component from the Qt application
yet, but there seem to be hooks available if this becomes necessary.

Peter.

On Sep 6, 7:22 am, Andrew Seddon <sedd...@gmail.com> wrote:

Brandon Benvie

unread,
Sep 9, 2011, 11:06:37 PM9/9/11
to nod...@googlegroups.com


I've been working toward the same goal utilizing Chromium Embedded Frame on windows. The Apple port of Webkit for Windows depends on their ported stack and is frankly a giant pain in the ass to get reliably compiling. the WinCairo version has seen a lot of improvement but last I checked it was still lagging pretty far behind in terms of support for bleeding edge rendering stuff. Chromium's WebKit implementation is just really awesome, as is the whole set of supporting libraries. Not to mention Chromium has been all around the best browser in terms of performance and support for cutting edge features since its debut.


CEF wraps Chromium in a more bite-sized dose designed for embedding in applications. It manages to keep the feature set  without sacrificing performance. There's a few issues, notably with WebGL, mostly because CEF up to now has been implemented using Chromium's single-threaded architecture, which CEF's creator has noted gets a lot less attention from Chromium's developers, so work is being done to switch it over.C

CEF was originally created for Windows, though design to be cross platform. Currently the Mac implementation is nearly complete and the Linux is workable and has seen a large uptick in participation over the last few weeks to push it over the finish line.

Binaries are released once every couple months or so. It has to be regularly rebaselined because of how fast Chromium changes, so if you want to build it you need to make sure you're using one of the listed compatible Chromium builds.


My owns goal has been in accomplishing something similar to what Titanium provides but focused specifically Javascript bindings to control web frames which are the primarily or sole GUI representation. I've managed to accomplish a basic implementation of this with CEF and C++ on windows after trudging through the whole learning process, (as many people who end up with this goal) with C++ not being something I had a lot of experience with. In placing additional requirements on it for myself I also complicated it, specifically implementation desktop alpha composting with completely transparent parent window and the web view being the absolute only visible piece, and with the ability to blend over the desktop. But I did get it eventually.

Right now there's three parts I'm working on. The first is just trudging through exposing some more API's to Javascript. Not difficult, just boring. This is done via CEF's thin wrappers to the V8 in Chromium before any frame's are visible. I have it so that I just implement the basic function wrappers needed in C++ and then the Javascript binding code is loaded from a file so almost everything lies outside of compilation.

The other part I'm looking into is options for Node integration. There's a few routes here. As far as I've been able to ascertain, having multiple execution contexts going for one shared V8 heap isn't even thinkable. I don't know what would be involved with with using a single implementation of V8 for both Chromium and Node, or what parts of Chromium I'd need to break as a module somehow to allow Node to act as the brain for a Chromium instance. I've over and over the massive amount of code that makes up Chromium and I have an idea, but there's just so much that nailing it is non-trivial.

The rest of the options are various forms of inter-process communication between Node's V8 and Chromium's V8, what the potential bandwidth of those would be, and what kind of abstractions would be useful. Where should the line be drawn in terms of who handles what, and how things are handed off back and forth. At this point it becomes the same questions you'd ask in terms of coordinating multiple instances of Node cooperating together. Actually accomplishing the task of communicating is trivial beyond what I have already, it's just a matter of what form that takes.

The current Chromium in CEF.dll I have compiled is from about a month ago and it has the Pepper API (http://code.google.com/chrome/nativeclient/docs/reference/peppercpp/index.html) enabled and available from javascript, though I haven't really done anything to know how useful it is just yet.

Longer term goal is in building out clean toolkits/apis for building desktop guis. There's a ton of javascript interface libraries out there but almost nothing that really works well on the desktop. Beyond that I want to figure out how to hook set up the render chain on this to see if I can get Chromium writing directly to Windows 7's DirectX buffer which would allow for no performance degradation while running 60 FPS alpha blended atop desktop 3d rendering, since Windows 7 is already being rendered using Direct X already if you have Aero on. It's just a matter of getting Chromium to spit it out for you.





Tim King

unread,
Sep 9, 2011, 11:31:20 PM9/9/11
to nod...@googlegroups.com
I'm one of the people who is trying to get the CEF port completed for Linux. My ultimate goal for getting this working is very closely aligned with your thinking however I haven't gone into in as much detail as to exactly how this could work as you yet.

I think that a cross platform Chromium/node.js integration would be an extremely powerful combination for desktop development. Once we have progressed the Linux port to a satisfactory level I would love to start working on this integration with whoever would like to be involved.

Most of the work for the port is coming from a guy called Keith who's company (http://www.desura.com/) has had a port working for while. Anyone who is interested can follow our progress here: http://code.google.com/p/chromiumembedded/issues/detail?id=40






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

Sapardi

unread,
Dec 2, 2012, 3:49:07 AM12/2/12
to nod...@googlegroups.com
Hi Rajkumar, i am pleasant hearing your suggestion about node-webkit. I've tried to use it with nodejs, but i have a problem with dependency while integrating among them. I copied node-webkit folder into node-modules/ directory in root project, but it still raised an error when i run it. Have u ever met the problem like me..?

On Sunday, November 18, 2012 9:07:19 PM UTC+7, Rajkumar Chandrasekaran wrote:
Not sure if you are still looking, there's the awesome Node-webkit, which does exactly this. I evaluated appjs, tidesdk and finally node-webkit. Was just amazed at everything related to node-webkit. 

Roger WANG

unread,
Dec 2, 2012, 4:21:20 AM12/2/12
to Sapardi, nod...@googlegroups.com
Sapardi <sapa...@gmail.com> writes:

> Hi Rajkumar, i am pleasant hearing your suggestion about node-webkit. I've
> tried to use it with nodejs, but i have a problem with dependency while
> integrating among them. I copied node-webkit folder into node-modules/
> directory in root project, but it still raised an error when i run it. Have
> u ever met the problem like me..?

Hi Sapardi,

node-webkit contains Node.js so you don't need to copy it into
node_modules. On the contrary, the node_modules folder should be put
into your app's root directory so node-webkit can find the modules.

HTH.

Roger

> On Sunday, November 18, 2012 9:07:19 PM UTC+7, Rajkumar Chandrasekaran
> wrote:
>>
>> Not sure if you are still looking, there's the awesome Node-webkit, which
>> does exactly this. I evaluated appjs, tidesdk and finally node-webkit. Was
>> just amazed at everything related to node-webkit.
>>
>> https://github.com/rogerwang/node-webkit
>>
>>
>> On Tuesday, 6 September 2011 16:52:02 UTC+5:30, Andrew Seddon wrote:
>>>
>>> Is anybody aware of a desktop app project which bundles Node + Webkit
>>> to make a native app using web tech.
>>>
>>> The closest thing I've found is https://github.com/unconed/TermKit .
>>>
>>> I just wanted to see if anybody has done this before we look at
>>> rolling a cross platform solution ourselves.
>>>
>>> Cheers,
>>>
>>> Andrew
>>
>>

--
Roger WANG Intel Open Source Technology Center

https://github.com/rogerwang/node-webkit
node-webkit: Call all Node.js modules directly from DOM and enable
a new way of writing applications with all Web technologies.

Martin Heidegger

unread,
Dec 2, 2012, 11:43:41 PM12/2/12
to nod...@googlegroups.com
What about Appjs? http://appjs.org/

Sapardi

unread,
Dec 2, 2012, 11:46:08 PM12/2/12
to nod...@googlegroups.com, Sapardi
Thanks in advanced Roger for your suggestion. I just followed Cris Sainty's way on how to call node-webkit from NodeJS app.js's. Hence, we can run our application like this :
  
   node app.js

Not

   nw /path/app/

Sorry if my question is too basic..:D

Roger WANG

unread,
Dec 3, 2012, 1:30:13 AM12/3/12
to Sapardi, nod...@googlegroups.com
Sapardi <sapa...@gmail.com> writes:

> Thanks in advanced Roger for your suggestion. I just followed Cris
> Sainty<http://blog.csainty.com/2012/01/creating-desktop-apps-with-nodejs.html>'s

This guide was written when we used the previous architecture. Now
things have been changed.

For a quick start you can see the front page of our Github project:

https://github.com/rogerwang/node-webkit

Thanks for your interest.

Roger WANG

unread,
Dec 3, 2012, 2:19:06 AM12/3/12
to Sapardi, nod...@googlegroups.com
Roger WANG <roger...@linux.intel.com> writes:

> Sapardi <sapa...@gmail.com> writes:
>
>> Thanks in advanced Roger for your suggestion. I just followed Cris
>> Sainty<http://blog.csainty.com/2012/01/creating-desktop-apps-with-nodejs.html>'s
>
> This guide was written when we used the previous architecture. Now
> things have been changed.
>
> For a quick start you can see the front page of our Github project:
>
> https://github.com/rogerwang/node-webkit

btw, here is another tutorial written by our user:

http://blog.joocode.com/js/run-and-package-html5-apps-using-node-webkit/

(the link doesn't always load and sometimes returns 404 error)

Sapardi

unread,
Dec 3, 2012, 2:38:15 AM12/3/12
to nod...@googlegroups.com, Sapardi
Great tutorial Roger, thank you...i am planning to build an chrome extension with nodejs+webkit+github api, would you have idea about this.?
Reply all
Reply to author
Forward
0 new messages