Code Monkey home page Code Monkey logo

hex's Introduction

heX logo

================================================================================

A Solution to Building Desktop Application Using HTML5 and Node.js

heX is a solution that provides a new way to build cross-platform desktop application using web technology. heX is based on CEF and integrates Chromium and Node.js. Modules or third-party extensions of Node.js can be "required" from the web page, while the DOM element of HTML can also be visited from Node.js' modules. In addition, heX can be embedded as a web container module into desktop projects, allowing desktop applications to take advantage of HTML5 features.

Features

Powerful but Easy to Use

  • Chromium's new web features at your fingertips
  • Multiple/Single process architecture
  • Works with major web developer tools

Low Learning Cost

  • Supporting JavaScript, CSS, HTML
  • Main API consistent with those of Chromium and Node.js
  • Easy integration into your applications by simply configuring the manifest

Extensible

  • Supporting any third-party JavaScript and C++ extension of Node.js
  • A platform to share the special heX extensions

Debugging Node.js in developer tools

  • HeXium = Chromium + Node.js

Why should I use heX?

HTML5 standard was designated as a Candidate Recommendation in December 2012. Chromium as a rapid development of open source project has good support for HTML5 for a long time. On the other hand, Node.js, which uses an event-driven, high throughput non-blocking I/O model, provides a variety of native operating APIs and enables a rich set of functionalities for JavaScript. heX integrates the two and retains advantages of both components. It enables one to develop desktop applications via pure web front-end technology.

heX has the following advantages:

  • Easy to use, web developer can use their favorite technology (browser and Node.js APIs), the learning cost is quite low.
  • Designing GUI is as efficient as we debug a web page in the Chrome.
  • Based on Node.js convenient extension mechanism, the functionalities can be easily extended.

Why was HeXium born

A solution for developing and debugging traditional web front and Node.js even more JavaScript host environments by the cross-platform way.

  • Developer tools for heX as we develop web pages in Chrome
  • An environment to debug Node.js.

How to develop with heX?

Developing a desktop application with heX is very simple. The following Wiki references allow you to get started quickly. [ links are coming soon. ]

  • Quick Start Guide
  • heX Manifest Instructions
  • heX Native API Instructions
  • FAQ

A piece of sample code looks like this:

var fs = require('fs');
var path = require('path');
var directory = $('#directory');
var fileList = $('#filelist');
directory.value = process.cwd();
if (!fs.existsSync(dir)) {
  ...
} else {
  fs.readdir(dir, function(err, list) {
    ...
  }
}

Binary Distributions

There are 4 kinds of binary distributions each platform. Current version: v1.1.6_1612

The sources are coming soon!!!

Authors

  • NetEase Youdao Information Technology (Beijing) Co.

License

New BSD License

Copyright (c) 2012-2014 NetEase Youdao Inc. and other heX contributors. Portions Copyright (c) 2008-2013 Marshall A.Greenblatt, 2006-2009 Google Inc., and Joyent, Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of Google Inc. nor the name Chromium Embedded Framework nor the name of Joyent, Inc. nor the name of NetEase Youdao Inc. nor the name heX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)

hex's People

Contributors

bartonding avatar luyuan avatar netease-youdao avatar

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

hex's Issues

iframe中未加载NodeJs

在页面iframe中window.require是undefined.
设置配置launch_node_in_all_pages为true依然是如此。

下载运行就报Read manifest.json error

未做任何修改,分别尝试下载hex_1453_end_user_windows和hex_1453_web_develop_windows,运行hexclient.exe,都报Read manifest.json error错误,何故?
本机为xp操作系统

nodejs http,Bug还是方法不对?

代码如下:

<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
  </head>
  <body>
    <div>hello world</div>
    <script>
    var http = require('http');
    console.log(http);
    http.get("http://www.baidu.com", function(res) {
      console.log("Got response: " + res.statusCode);
      //console.log(res.body);
    }).on('error', function(e) {
      console.log("Got error: " + e.message);
    });
    </script>
  </body>
</html>

第一次运行,控制台可以打印出 Got response: 200
而后刷新页面,就开始报错了:
Uncaught TypeError: undefined is not a function node.js:374
_tickCallback node.js:374

无论是Hex还是HeXium,都必须将程序关闭,再重新启动。

如何用鼠标移动页面的DIV来移动整个window窗口

oDiv是页面上的一块区域,我想通过用鼠标移动oDiv来移动整个window窗口,但是下面的代码一直有问题,请问如何实现
oDiv.onmousedown = function(ev){
var ev = ev || event;
document.onmousemove = function(ev){
hex.moveTo( ev.clientX, ev.clientY);
// hex.move();
}
document.onmouseup = function(){
document.onmousemove = null;
document.onmouseup = null;
}
}

是否可以增加嵌入桌面的方法?

我知道系统的user32.dll提供了FindWindowEx和SetParent两个方法的支持,可以类似桌面小日历之类嵌入桌面。点击显示桌面不会最小化。是否可以提供下这个功能的manifest配置及js方法调用的支持?

问个问题

  1. Hex有多少人在维护?
  2. 只在有道词典找到hex.dll, 有道云笔记没有使用该技术吗?

详细使用文档

这个项目不错,有个详细使用文档就更好。

文档是项目应用的重要因素。

HeXium里头如何调试nodejs部分的代码啊

HeXium里可以调试前端js代码,但是碰到require nodejs模块时如何进入调试

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Hello World</title>
<link href="hello.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Loading...</h1>
<script>
  require('./test/hello_world');
</script>
</body>
</html>

如以上代码,在<script></script>内容处可以下断点,也能正常进入断点,但是无法step in,在调试窗口的sources里也查看不到相应的文件,该如何处理?

无法打印

不能调用 javascript 打印方法

<iframe src="http://www.baidu.com" id="PrintFrame" /> <script> PrintFrame.window.print(); </script>

Manifest中设置launch_state为hidden似乎不启作用

想让程序启动时隐藏,当界面加载完后再显示。
但是配置了"launch_state":"hidden"无效,界面还是会在加载完前显示,
同时:
window.addEventListener('DOMContentLoaded', function (e) {
console.log(hex.formState);//这里获取的值是0,也就是NORMAL状态
}, false);

manifest.json这个文件里面的first_page该怎么配置?

按照指南里面的说法将first_page设置为$(AppDir)test/index.html,一直无法加载。
但将first_page设置成一个url就可以了。
—————————————————————————————————————————————
发现是我之前目录放错了。

引用nodejs的串口模块出现问题,请问怎么解决?

try{
var SerialPort = require("serialport").SerialPort
alert(SerialPort);
var serialPort = new SerialPort("COM4", {
baudrate: 9600,
databits:8,
stopbits:1,
parity:'none',
flowcontral:false,
bufferSize:2000
}, false); // this is the openImmediately flag [default is true]

serialPort.open(function () {
console.log('open');
serialPort.on('data', function(data) {
console.log('data received: ' + data);
});
serialPort.write("ls\n", function(err, results) {
console.log('err ' + err);
console.log('results ' + results);
});
});
} catch(e){
alert(e.message);
}
提示错误为:
a valid Stream instance must be passed in

SWF doesn't display when using "-webkit-transform" ,in HeXium

but in hex ,it is good.
code:

        <div  id="step-2" style="position: absolute; -webkit-transform: translate3d(0px, 0px, 0px) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(1); ">
            <object id="tcx014yi11pk" name="prezi_tcx014yi11pk" width="941px" height="479px" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
                <param name="wmode" value="transparent">
                <param name="move" value="img/f4p32orny2.swf">
                <embed id="Embed_tcx014yi11pk" name="preziEmbed_tcx014yi11pk" width="941px" height="479px" src="img/f4p32orny2.swf" type="application/x-shockwave-flash"  bgcolor="#ffffff" wmode="transparent" >
            </object>
        </div>

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.