GithubHelp home page GithubHelp logo

nwjs / nw.js Goto Github PK

View Code? Open in Web Editor NEW
40.1K 1.6K 3.9K 126.54 MB

Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.

Home Page: https://nwjs.io

License: MIT License

C++ 34.11% JavaScript 42.48% Objective-C++ 2.75% Objective-C 0.61% C 0.19% HTML 3.68% Python 15.28% Smarty 0.54% CSS 0.07% Shell 0.29%
web-application-framework javascript desktop node-webkit nwjs nodejs

nw.js's Introduction

node-webkit is renamed NW.js

Gitter
Official site: https://nwjs.io

Introduction

NW.js is an app runtime based on Chromium and node.js. You can write native apps in HTML and JavaScript with NW.js. It also lets you call Node.js modules directly from the DOM and enables a new way of writing native applications with all Web technologies.

It was created in the Intel Open Source Technology Center.

Building a Cross-platform Desktop App with NW.js
Creating Desktop Applications With node-webkit
WebApp to DesktopApp with node-webkit (slides)
Essay on the history and internals of the project

Features

  • Apps written in modern HTML5, CSS3, JS and WebGL.
  • Complete support for Node.js APIs and all its third party modules.
  • Good performance: Node and WebKit run in the same thread: Function calls are made straightforward; objects are in the same heap and can just reference each other.
  • Easy to package and distribute apps.
  • Available on Linux, Mac OS X and Windows.

Downloads

Demos and real apps

You may also be interested in our demos repository and the List of apps and companies using nw.js.

Quick Start

Create index.html:

<!DOCTYPE html>
<html>
  <head>
    <title>Hello World!</title>
  </head>
  <body>
    <h1>Hello World!</h1>
    We are using node.js <script>document.write(process.version)</script>.
  </body>
</html>

Create package.json:

{
  "name": "nw-demo",
  "version": "0.0.1",
  "main": "index.html"
}

Run:

$ /path/to/nw .  (suppose the current directory contains 'package.json')

Note: on Windows, you can drag the folder containing package.json to nw.exe to open it.

Note: on OSX, the executable binary is in a hidden directory within the .app file. To run node-webkit on OSX, type:
/path/to/nwjs.app/Contents/MacOS/nwjs . (suppose the current directory contains 'package.json')

Documents

Official documentation: http://docs.nwjs.io/

For more information on how to write/package/run apps, see:

And our Wiki for much more.

Community

We use the google group as our mailing list (use English only). Subscribe via [email protected].

NOTE: Links to the old google group (e.g. https://groups.google.com/forum/#!msg/node-webkit/doRWZ07LgWQ/4fheV8FF8zsJ) that are no longer working can be fixed by replacing node-webkit with nwjs-general (e.g https://groups.google.com/forum/#!msg/nwjs-general/doRWZ07LgWQ/4fheV8FF8zsJ).

Issues are being tracked here on GitHub.

The source code for NW.js and the daily development spans multiple repositories in this organization. This repository is for issue tracking, landing page, and part of the source code.

Verifying Binaries

Starting from 0.32.0 the stable and nightly download directories contain a SHASUMS256.txt file that lists the SHA checksums for each file available for download, as well as the checksums for the files inside the download package.

The SHASUMS256.txt can be downloaded using curl.

$ curl -O https://dl.nwjs.io/vx.y.z/SHASUMS256.txt

To check that a downloaded file matches the checksum, run it through sha256sum with a command such as:

$ grep nwjs-vx.y.z.tar.gz SHASUMS256.txt | sha256sum -c -

The stable releases (but not Nightlies) also have the GPG detached signature of SHASUMS256.txt available as SHASUMS256.txt.asc. You can use gpg to verify that SHASUMS256.txt has not been tampered with.

To verify SHASUMS256.txt has not been altered, you will first need to import the GPG key of NW.js maintainer to create releases. Use this command to import the key:

$ gpg --keyserver pool.sks-keyservers.net --recv-keys 78680FA9E21BB40A
(Key fingerprint is 1E8B EE8D 5B0C 4CBC D6D1  9E26 7868 0FA9 E21B B40A)

Next, download the SHASUMS256.txt.asc for the release:

$ curl -O https://dl.nwjs.io/vx.y.z/SHASUMS256.txt.asc

After downloading the appropriate SHASUMS256.txt and SHASUMS256.txt.asc files, you can then use gpg --verify SHASUMS256.txt.asc SHASUMS256.txt to verify that the file has been signed by an authorized member of the NW.js team.

Once verified, use the SHASUMS256.txt file to get the checksum for the binary verification command above.

License

NW.js's code in this repo uses the MIT license, see our LICENSE file. To redistribute the binary, see How to package and distribute your apps

nw.js's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nw.js's Issues

Window features not function in window.open

For example, window.open('http://baidu.com', 'mywindow', 'width=1000,height=1000'); should open a window with size of 1000x1000, but the new window's size is the same with the opener.

How can I set the background of windows?

The background of the window can not be set to transparent or translucent?Must be coupled with a default white background, with the browser.Can not customize it?The edge of the window, can be eliminated?Like "the toolbar": false, I hope the windowborder ": false, so I can customize the window button to make beautiful applications.
——translated by Google

Increase the number of API

I c + + language is also not understand.Could the "node-webkit" to increase the number of API?The API can be called by JS example: minimize, maximize, minimize to the taskbar toolbar.

This will be able to develop, "no the GUI frame" program.

tks!

Provide toggle to disable node.js inside WebKit

Since some users are using node-webkit as their HTML5 game platform, and they don't use node.js stuff, so it could be gain to provide a toggle in manifest file to disable node.js, which would improve stability and performance.

An example could be:

{
  ...
  "nodejs": false
}

List of apps which use node-webkit

It would be nice for the documentation if it has references to open source (or commercial, albeit less useful) software that uses node-webkit.

Unable to build the node dependency of cef branch

I had followed the steps and could make sure right repository was used, but I failed to build the nodedependency.

Output:

$ uname -a
Linux kitten 3.4.0-1.fc17.i686 #1 SMP Sun Jun 3 07:16:04 UTC 2012 i686 i686 i386 GNU/Linux
$ pwd
~/codes/chromium/src/cef/tools
$ $ ./build_projects.sh Debug
~/codes/chromium/src ~/codes/chromium/src/cef/tools
...
make: *** No rule to make target `third_party/node/config.gypi', needed by `out/Debug/obj/gen/node_natives.h'.  Stop.
make: *** Waiting for unfinished jobs....

And there is no config.gypi under third_party/node/, did I miss something?

Window resize

Win32 build: resizing the window creates an empty row with broken rendering on top of the window.

Some callbacks never fires on Mac

For example the 'request' module's request function will never get its callback fired, it could be the same bug with issue #11.

The problem should be in mac's message loop implementation.

error on execute helloworld.js

Sorry for naive question.

I followed the installation guide but I got issue on executing the helloworld.js.

Here is the trace:

**root@userver11:~/node-webkit# node-waf configure build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local
Checking for gtk+-2.0 : yes
Checking for glib-2.0 : yes
Checking for webkitnode-1.0 : yes
'configure' finished successfully (0.048s)
Waf: Entering directory /root/node-webkit/build' Waf: Leaving directory/root/node-webkit/build'
'build' finished successfully (0.005s)

root@userver11:~/node-webkit# node tests/helloworld.js tests/testfs.html

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module '../build/Release/nwebkit'
at Function._resolveFilename (module.js:326:11)
at Function._load (module.js:271:25)
at require (module.js:355:19)
at Object. (/root/node-webkit/lib/index.js:24:15)
at Module._compile (module.js:411:26)
at Object..js (module.js:417:10)
at Module.load (module.js:343:31)
at Function._load (module.js:302:12)
at require (module.js:355:19)
at Object. (/root/node-webkit/tests/helloworld.js:2:11)

root@userver11:~/node-webkit/build# ls
c4che config.log default

Thanks for your support.

Simple way to install?

Hello,
node-webkit looks really promising to me, but why do I have to manually patch webkit? Is it because of license issues? I really want to use this, but I probably won't until I can let people install it from npm.

Problems with loading main from url

If in your package.json you define a main html file being a url you get this message,
Failed to load URL file:///tmp/node-webkit/example/http://google.com with error (-6).

If you try to load a url from the toolbar you get this error and the application crashes.
Application launches with main file
2012-08-09 14:10:47.363 nw Helper[13878:707] Unsure about the internals of CFAllocator but going to patch them anyway. If there is a crash inside of CFAllocatorAllocate, please report it at http://crbug.com/117476 . If there is a crash and it is NOT inside of CFAllocatorAllocate, it is NOT RELATED. DO NOT REPORT IT THERE but rather FILE A NEW BUG.
[0809/141047:ERROR:renderer_main.cc(204)] Running without renderer sandbox
Bus error: 10

It would be cool if we could load html files that are not included in our packages, mainly so these files can be created by some type of server process rather than needing to be a static file.

rendering stops after alert() call

Please try the following html code:

<html>
    <head>
        <title>Hello</title>
    </head>
    <body>
        <h1>hello world</h1>
        <button id="abc">okay</button>
        <script>
            document.getElementById("abc").addEventListener("click", function() {
                alert("hi")
            });
        </script>
    </body>
</html>

Press the okay button, the entire application window will become blank.

Developer Tools load without CSS

When using the developer tools on my system (linux x64, node-webkit 0.2.3) they seem to load without their stylesheet applied.

A picture says more than a thousand words:

Screenshot

License?

Is there some kind of open source license allowing me to change and redistribute this?

Support controller script

Add a "controller" field in the manifest, when the window object is created in the WebKit context, execute the controller script in the node context.

`Destroying invalid entry` cause Segmentation fault: 11

$ node-webkit --developer ./
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.
[0823/014316:WARNING:backend_impl.cc(1916)] Destroying invalid entry.

OSX Build

As noted on the mailing list having a OSX build would be awesome!

Here is a Bug,WebGL run faile?

I made a simple experiment to test the the WebGL module support, so to use three.js WebGL library.Very simple example, extracted from the official in the examples folder canvas_lines.html, I'm sure I've been independent of these resource files, and successfully run on top of the Chrome and Opera.But when I packaged these resources files, and use nw.exe compile and run, I do not see the correct results. This is the Bug? If yes, please provide the solution.
By the way, compile the application can not run on other computers above, I mean the ordinary nodejs computer, and some anti-virus software will be prompted to risk.

Crash on random Windows machines

Some users reported crash on their Windows machine, the crash was pretty random, it had happened on both Windows 7 and Windows 8. All crashes were silent, node-webkit just didn't start and left no information.

<input type="date" /> does not work

<input type="date" /> does not work. Actually, if this tag is used, nothing is rendered at all. The whole application window is simply blank... as if something horribly broke. Tested on 64bit Ubuntu 12.04.

Problems with C++ modules (dbus in particular)

After running "npm install dbus" (from the same Node.js version as node-webkit: v0.8.4), I get this error

[0815/200414:INFO:CONSOLE(485)] "Uncaught Error: /tmp/nw_release_linux_x32/hello-world/node_modules/dbus/lib/dbus.node: undefined symbol: _ZN4node14no_deprecationE", source: module.js (485)

On the other hand, other C++ modules (e.g. mongodb with native bson) worked.

navigator.language

The navigator object seems to be fine, but navigator.language is undefined. I don't think navigator.language is required by a standard, but mainstream browsers, including Chromium, implement it.

setTimeout never fires

Here is an example:
setTimeout(function(){
console.log('Never gets called');
},1)

Expected this function would be called after one millisecond.

Cannot build with gcc 4.7.0

Got this error when compiling:

In file included from seccompsandbox/library.cc:7:0:
seccompsandbox/library.h:159:46: error: ‘ssize_t’ has not been declared
make: *** [out/Debug/obj.target/seccomp_sandbox/seccompsandbox/library.o] Error 1
make: *** Waiting for unfinished jobs....

This bug was caused by not including unistd.h, which was not revealed by compiler until gcc 4.7.

Upstream chromium also had bugs of this type, see http://code.google.com/p/chromium/issues/detail?id=120724&can=1&q=GCC%204.7&colspec=ID%20Pri%20Mstone%20ReleaseBlock%20Area%20Feature%20Status%20Owner%20Summary

Quiet crash when using native modules

The following app stop executing without any error message whatsoever:

https://gist.github.com/3508168

The native module is loaded fine (require('buffertools');), but when you use it, execution simply stops. The only other visible symptom is that the node-webkit window is grey instead of white. There are no log messages or errors of any kind.

Tested on Linux x64, node-webkit 0.2.3.

Edit: Looks like this affects all native modules for me. Loading them works fine, but once you try to call any of their methods, the above bug is triggered.

It would be great to have a prebuilt distribution that's easily embeddable

I would really like to embed node-webkit into my C++ application. As I understand it, the only way I can embed node-webkit into my solution would be to build it from scratch. It would be great if there was a prebuilt distribution that I could embed easily without building the entire webkit chain.

Mac's binary is too large

All libcef and chromium stuff is now statically linked to nw, it caused problems on Mac because every helper process will increase the total size by about 40mb, simply switch to shared linking will cause many linking problems.

Hello World demo does not work on OS X

I downloaded hello_world.nw and node-webkit.app linked to from the README, and ran the command from "How to run apps":

open -n -a node-webkit "/home/path/to/app" 

The node-webkit application launches, and I am greeted with a message box which says:

The document “hello_world.nw” could not be opened. node-webkit cannot open files of this type.

Also, the .nw file cannot be dropped onto node-webkit.app bundle, contrary to the instructions in "How to run apps".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.