我是否需要编写自己的查找功能以允许用户在页面上查找文本内容,或者是否有一种方式node-webkit可以公开预先存在的webkit查找功能?
我有一个node-webkit应用程序,我想知道是否有办法专门针对node-webkit?我只需要在客户端浏览器是node-webkit时运行一些函数.
谢谢
如何在node-webkit(或node.js)外部进程中并行执行当前脚本的系统命令.
我正在尝试使用child_process.中断脚本子进程后退出.但是我需要一个简单的方法执行bash命令没有输出或输出但没有程序停止我的脚本将被中断.
我需要一个正确的简单方法.
谢谢大家.
我按照教程(在“入门”部分中)中的介绍如何将TiddlyWiki与node-webkit一起使用。然后,当我运行nw.exe时,它什么也不显示。
我在Windows(64位)上安装了Windows版本的32位版本。不知道我在做什么错,还是只是一个错误。
我也尝试将index.html和package.json添加到档案文件(称为app.nw)中,并使用nw.exe运行它,但还是没有运气。
我有这个文件
lib/
|-angular.min.js
|-angular-route.js
|-angular-resource.js
index.html
package.json
Run Code Online (Sandbox Code Playgroud)
主要的 index.html
<html ng-app="example">
<head>
<meta charset="utf-8">
<script src="lib/angular.min.js"></script>
<script src="lib/angular-route.js"></script>
<script src="lib/angular-resource.js"></script>
</head>
<body>
<script>
var app = angular.module('example', ['ngRoute']);
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
而且 package.json
{
"main": "index.html"
, "name": "example"
, "version": "1.0.0"
, "window": {
"toolbar": true
, "frame" : true
}
}
Run Code Online (Sandbox Code Playgroud)
但是当我运行$ nw .它时会抛出这个错误:
Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.7/$injector/moduler...
Run Code Online (Sandbox Code Playgroud) 我刚刚阅读了关于在nw.js的wiki上发布的部分
由于二进制文件基于Chromium,因此需要多个开源许可证>通知,包括MIT许可证,LGPL,BSD,Ms-PL和MPL/GPL/LGPL三重许可证.(这不适用于您的代码,您不必开源代码)
但我不知道在哪里可以找到我将包含的铬许可信息.或者我是否必须在没有任何版权信息的情况下发送上述许可证的一般文本?
在我的nwjs应用程序中,我从HTML文件加载_launch.js文件:
<html>
<body>
<script type="text/javascript" src="_launch.js"></script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
在我的_launch.js文件中,我启动了快速服务器和socketIO所需的Node进程.
var express = require('express'),
app = express(),
server = require('http').Server(app),
io = require('socket.io')(server),
gui = require('nw.gui'),
__curDir = process.cwd(),
//keep the logic for the IO connections separate
ioServer = require(__curDir + '/server.js');
//configure Express to default web requests to /workspace/ folder
app.use(express.static(__curDir + '/workspace'));
ioServer.init(io, console);
server.listen(3000, function () {
console.log('HTTP server listening on *:3000');
window.location = 'http://localhost:3000/MyApp/';
});
Run Code Online (Sandbox Code Playgroud)
该应用程序启动很好,我的快递/ socketIO连接都完美的工作.
但是当我的终端中出现server.listen()回调中的console.log()时,我尝试从server.js文件(之前需要)记录的任何消息都不会出现在任何地方.
有什么想法吗? …
为什么以下代码分配了大量内存?
Entity3D.prototype._updateEuler = function(elapsed) {
this.velocity.x += this.force.x / this.mass * elapsed;
this.velocity.y += this.force.y / this.mass * elapsed;
this.velocity.z += this.force.z / this.mass * elapsed;
var initialSpeed = this.speed = vector3.length(this.velocity);
if (this.speed && this.deceleration)
this.speed = Math.max(0, this.speed - this.deceleration*elapsed);
if (this.speed > this.maxSpeed)
this.speed = this.maxSpeed;
if (this.speed !== initialSpeed) {
this.velocity.x = this.velocity.x / initialSpeed * this.speed;
this.velocity.y = this.velocity.y / initialSpeed * this.speed;
this.velocity.z = this.velocity.z / initialSpeed * this.speed;
}
this.oldPosition.x = this.position.x;
this.oldPosition.y …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用NW.js构建一个简单的桌面应用程序.通过一些帖子的启发,包括这一次,我想尝试一个纯粹的npm做法没有任何bower,grunt或gulp.
所以我继续使用jquery和bootstrap库作为npm模块安装.当我在我的应用程序的JavaScript中注入模块时,如下所示:
global.jQuery = $ = require("jquery");
var bootstrap = require("bootstrap");
Run Code Online (Sandbox Code Playgroud)
我ReferenceError: document is not defined来自一个bootstrap.我可以bootstrap通过老式的方式加载html文档:
<script type="text/javascript" src="node_modules/bootstrap/dist/js/bootstrap.js"></script>
Run Code Online (Sandbox Code Playgroud)
我问自己require在脚本文件中加载bootstrap trough是否是一个愚蠢的想法?基本上,我不需要那里.它可以通过html中的脚本标记加载.什么是最佳做法?我糊涂了.
更新.解决方案
接受了@Kuf的建议后,我创建了一个build.js脚本
var copyfiles = require('copyfiles');
copyfiles(["node_modules/bootstrap/dist/js/bootstrap.js", "vendor/js"], true, function (err) {
if (err) return console.error(err);
});
copyfiles(["node_modules/bootstrap/dist/css/bootstrap.css", "vendor/css"], true, function (err) {
if (err) return console.error(err);
});
Run Code Online (Sandbox Code Playgroud)
由prestart钩子触发: …
我正在阅读有关如何打包NW.js应用程序的说明,并且措辞是一个混乱的混乱,没有任何意义.我突出了矛盾的词沙拉部分.
创建一个ZIP文件(这是内置于XP,Vista和Windows 7),您的所有文件复制到zip文件,保留目录结构,并确保该文件的package.json是在根目录下(如果你让包含一个zip文件包含你的东西的文件夹,然后它不会起作用)将文件扩展名从.zip重命名为.nw.默认情况下,可能会隐藏文件扩展名.您需要(按alt),转到文件夹选项并取消选中"隐藏已知文件类型的扩展名"才能重命名zip.
是否有一个简单的逐步指令集来说明如何做到这一点?我在线查看,找不到任何Windows操作系统.目标是创建一个可执行文件(.exe),其中隐藏了用户的应用程序内部.
我之前在Mac上做过但从未在Windows上做过.编写官方文档的方式太混乱了,我无法理解.
node-webkit ×10
node.js ×5
javascript ×4
nw.js ×3
angularjs ×1
bash ×1
chromium ×1
function ×1
io.js ×1
jquery ×1
memory ×1
optimization ×1
target ×1
tiddlywiki ×1
webkit ×1
wiki ×1