- Notifications
You must be signed in to change notification settings - Fork5
An example using Edge in NW.js directly from the DOM
License
frankhale/nwjs-edge-example1
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
#nwjs-edge-example (Edge directly from DOM)
An example usage of NW.js and Edge.JS. This code calls a function insidea .NET class library from the DOM.
There are a lot of things that can go wrong preventing this example fromworking. For example, new NW.js builds containing Node versions that are not yetsupported by Edge. Additionally getting a build environment setup on Windows canbe challenging and difficult.
If you cannot get Edge built to work directly in NW.js then you may want to lookat my new example which demonstrates using Edge from NW.js via spawning a regularNode process and interacting with it via Socket.IO. This allows for shipping aknown good version of Node that Edge supports while preventing the complexitiesof building Edge for NW.js.
https://github.com/frankhale/nwjs-edge-example2
NOTE: NeedNW.js?
- Clone or download a zip of this repository
- Unzip into it's own folder (assuming folder named edge-test-app)
- Unzip NW.js
- Copy nw-edge-example folder to NW.js folder
- Open command prompt to the NW.js folder
- Follow build instructions below to build the module
- Run using the command: nw nw-edge-example
The SimpleLibrary.dll is built from the Hello.cs source file. I've omitted theVisual Studio project to build this from this repository. This library onlycontains one function as noted in the Hello.cs. Notice the function signatureis special because by default Edge.JS wants to call asynchronous methods so itdoes not block the Javascript engine.
If you want to see more examples of using Edge.JS please see it's Githubrepository located at:
https://github.com/tjanczuk/edge
Edge.JS has to be rebuilt using nw-gyp in order for it to work from withinNW.js.
NOTE: By default Edge.JS is built using node-gyp and only works within Node.JS.
Things you need in order to build Edge.JS for use within NW.js:
- Visual Studio 2013
- Python 2.7.x
- Node.JS 5.x
- nw-gyp (npm install -g nw-gyp)
Next, open a command prompt to your source code directory and install theEdge.JS module using npm:
Create a folder on your desktop (for illustration call it my-app) and copy theNode-Webkit runtime files to it.
Next open a command prompt to the my-app folder and install the Edge.JS module:
c:\>cd my-appc:\my-app>npm install edgeThis will create a node-modules folder and then install edge into that folder.Now we need to recompile Edge using nw-gyp (instead of node-gyp which it isbuilt with by default).
c:\my-app\>cd node_modules\edgec:\my-app\node_modules\edge>nw-gyp configure --target=v0.13.3 --msvs_version=2013 --arch=x64c:\my-app\node_modules\edge>nw-gyp buildOnce the build finishes, the new module will be in:
c:\my-app\node_modules\edge\build\ReleaseCopy edge_coreclr.node and edge_nativeclr to: (depending on your architecture, I built against x64)
c:\my-app\node_modules\edge\lib\native\win32\x64\5.1.0Frank Hale <frankhale@gmail.com>
30 May 2016
GNU GPL v3 - seeLICENSE
About
An example using Edge in NW.js directly from the DOM
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
