Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chromium command-line logging flags behave differently when specified in package.json #5671

Closed
danielmackenzie opened this issue Jan 30, 2017 · 10 comments
Assignees
Labels

Comments

@danielmackenzie
Copy link

danielmackenzie commented Jan 30, 2017

NW.js version 0.16.1
Windows 10
Software written on Mac OS 10.12.2

I am experiencing different behaviour when using Chromium's --enable-logging flag as part of a NW.js application. On a Windows 10 machine, specifying the logging flag as part of the package.json "chromium-args": "--enable-logging --v=1" spawns two extra prompt windows in addition to the main window. This behaviour does not occur on Windows 7.

Searching the Chromium documentation suggested adding the --no-sandbox flag would solve this issue. Adding it to the package.json file did not change the behaviour.

However, providing the logging flag through the command line and not in the package.json file yields the desired result.

"App Name.exe" --enable-logging --v=1
The log file is generated as expected and no extra windows are spawned on launch. Why is there a difference when I specify the argument on the command line vs. in the chromium-args section of the package.json file? And secondly, how can I get the desired behaviour by specifying everything in the package?

Same question posted on SO: http://stackoverflow.com/questions/41880316/nw-js-chromium-logging-flags-behave-differently-when-specified-in-package-json

@Christywl
Copy link
Contributor

@danielmackenzie , I tried the latest nwjs-sdk-0.20.3, this issue is not reproduced on Windows, could you please try the latest version?

@danielmackenzie
Copy link
Author

@Christywl , I just tried with version 0.20.3 and got slightly different behaviour. On launch, I get our main window plus one prompt that looks like this:

screenshot

Any idea what might be causing this?

@Christywl
Copy link
Contributor

Sorry, I didn't meet this error. @rogerwang , could you please help take a look at this?

@rogerwang rogerwang self-assigned this Mar 14, 2017
@rogerwang
Copy link
Member

This is fixed in git and will be available in the next nightly build.

@semmel
Copy link

semmel commented Apr 18, 2017

I still experience this issue with nwjs 0.21.5 on Windows 8.1 and Windows 10:
--enable-logging causes an extra console window \??\C:\WINDOWS\system32\conhost.exe 0x4 with some of the first log lines to open. See here on Windows 8.1 (same on Windows 10) the properties of the shortcut to my application, it's main window (in the background) and the console window (left):
Screenshot on Windows 8.1

This is not happening on Windows 7 (64 and 32 Bit)

There is no difference wether the command line option goes into chromium-args or is specified explicitly in the shortcut.

@danielmackenzie Can you confirm that the bug is not resolved?

@semmel
Copy link

semmel commented Apr 24, 2017

@danielmackenzie Please re-open this issue.
@rogerwang This issue is not resolved in version 0.22, please re-open this issue.
When invoked as a GUI process on Windows 8.1 and Windows 10 with --enable-logging NW.js opens an extra Windows Console Window (probably in a call to CreateProcess with the CREATE_NEW_CONSOLE flag.)
Steps to reproduce:

  • Download and extract the latest nw.js package (non-SDK)
  • Create a shortcut to nw.exe (e.g. on the Desktop)
  • append --enable-logging to the link (see screenshot below)
  • double click on the shortcut (The default nw.js GUI window and an additional console window get opened)
    Screenshot on Windows 10

@chlp
Copy link

chlp commented Sep 4, 2017

v0.25.0-beta1 also contains this bag.

package.json:

{
    "name": "1",
    "main": "anything.html",
    "chromium-args": "--enable-logging"
}

I create exe with command:

copy /b nw.exe+package.nw app.exe

and run app.exe from explorer. There is additional console window.

If i run app.exe from CMD, there is no this console window.

@fpn
Copy link

fpn commented Sep 22, 2017

v0.25.2 also opens a cmd window...

@rogerwang rogerwang reopened this Oct 2, 2017
@rogerwang
Copy link
Member

just fixed the console window in git.
It will be available in the next nightly build.

@semmel
Copy link

semmel commented Oct 12, 2017

Great work!
Launching from a shortcut with --enable-logging or specifying that switch in package.json's chromium--args the console windows no longer show up!
Thank you!

  • NW.js v. 0.25.5 (nightly) (normal build)
  • Windows 10 Prof. (x64)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants