Open bushadam opened 7 years ago
Please use English, so all users can read, or the issue will be closed directly.
i have modify to English,but my English very poor,thx please help me
I use the code in #3818, can't reproduce the issue on Linux/Windows 8 with nwjs-sdk-v0.22.3. (I have no Windows xp). I just see one line in the log.txt
.
package.json:
{
"name": "test",
"main": "index.html",
"node-main": "app.js"
}
app.js:
var log4js = require('log4js');
log4js.configure({
"appenders": [
{
type: "console"
},
{
type:"file",
filename:'log.txt'
}
],
replaceConsole: true
});
var logger = global.logger;
if(!logger){
global.logger = logger = log4js.getLogger('app');
logger.debug('Here is a log');
}
I can't run with your code in the bug, you may upload your full tests for me to double check.
@Christywl thx
i use the same code with u,manifest is my, when i start app like this “nw appdir”,the log.txt will write two line
[2017-05-19 10:59:36.806] [DEBUG] app - Here is a log [2017-05-19 10:59:37.087] [DEBUG] app - Here is a log
when in devtool press “F5”, the log.txt content add one line,like this
[2017-05-19 10:59:36.806] [DEBUG] app - Here is a log [2017-05-19 10:59:37.087] [DEBUG] app - Here is a log [2017-05-19 11:01:04.753] [DEBUG] app - Here is a log
that‘s the reason i just find at
"chromium-args": "--disable-web-security --disable-print-preview --enable-transparent-visuals --disable-gpu",// --mixed-context
,when i add the mixed-context,node-main will write two line,remove --mixed-context will write one line.
when i call child_process like this require("child_process").spawn
,the app crash,but on my dev machine no this problem.
my dev machine is virtual machine(windows xp sp3 32bit) on win10 64bit my customer machine is windows xp sp3 32bit, and cpu is 32bit.
@Christywl thx
I can reproduce this issue when adding "chromium-args":"--mixed-context"
on nwjs-sdk-v0.26.0.
my application need use activex, so i use child_process with C# application do this。 i find same issues https://github.com/nwjs/nw.js/issues/3818 ,but no answer。
my csharpapplication.exe will two instance,i find the app.js run tow times. one time on nw start,next time may be on document.onready or window.onload
nw version 0.14.7 x86 os windows xp(my customer need xp)
please help me thx
my manifest
{ "main": "index.html", "name": "", "description": "", "version": "0.1.0", "keywords": [ "ssdf", "node-webkit" ], "nodejs": true, "node-main": "js/app.js", "chromium-args": "--disable-web-security --disable-print-preview --mixed-context --enable-transparent-visuals --disable-gpu", "window": { "title": "ssdf", "icon": "app.ico", "toolbar": false, "resizable": false, "fullscreen": true, "show_in_taskbar": true, "frame": true, "show": true, "kiosk": true, "transparent": false, "always_on_top": false //"position": "center", //"width": 800, //"height": 670, //"min_width": 400, //"min_height": 335, //"max_width": 800, //"max_height": 670, }, "webkit": { "plugin": true, "page-cache": false } }
my app.js like this
` (function () { var log4js = require("log4js"); var iconv = require('iconv-lite');
})(); `