Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 8, 2020. It is now read-only.

An example using Edge in NW.js directly from the DOM

License

NotificationsYou must be signed in to change notification settings

frankhale/nwjs-edge-example1

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.

NWJS-Edge-Example-Screenshot

Having Trouble Building Edge for NW.js?

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

Usage

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

C# Class Library

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

Development

Building Edge.JS for NW.js

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 edge

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

Once the build finishes, the new module will be in:

c:\my-app\node_modules\edge\build\Release

Copy 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.0

Author(s)

Frank Hale <frankhale@gmail.com>
30 May 2016

License

GNU GPL v3 - seeLICENSE

About

An example using Edge in NW.js directly from the DOM

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp