I have Ubuntu Desktop 14.04.4 LTS and nw.js this: http://dl.nwjs.io/v0.16.0-rc1/nwjs-v0.16.0-rc1-linux-x64.tar.gz
I tried to press F12 button but it doesn’t work, then I tried with code snippet:
var win = nw.Window.get();
win.showDevTools('', function (item) {
console.log(item);
});
and this:
require('nw.gui').Window.get().showDevTools();
with code snippet it opens new window but its blank (white screen) :/ then I tried to appear toolbar, in package.json I insert this code:
"window": {
"toolbar": true
}
but it doesn’t work.
I uploaded my project, into the folder you can run npm start
and it will deploy…
https://mega.nz/#!1BA2HLSC
I seen terminal and there is some errors (maybe):
/usr/share/themes/MBuntu-Y-For-Unity/gtk-2.0/widgets/panel.rc:18: Unable to locate image file in pixmap_path: "images/panel/panel-normal.svg"
/usr/share/themes/MBuntu-Y-For-Unity/gtk-2.0/widgets/panel.rc:21: Background image options specified without filename
/usr/share/themes/MBuntu-Y-For-Unity/gtk-2.0/widgets/panel.rc:27: Unable to locate image file in pixmap_path: "images/panel/panel-active.svg"
/usr/share/themes/MBuntu-Y-For-Unity/gtk-2.0/widgets/panel.rc:30: Background image options specified without filename
/usr/share/themes/MBuntu-Y-For-Unity/gtk-2.0/widgets/panel.rc:61: error: invalid string constant "button", expected valid string constant
[883:883:0719/093014:ERROR:CONSOLE(1)] "Uncaught ReferenceError: DevToolsAPI is not defined", source: (1)
[883:883:0719/093014:ERROR:CONSOLE(1)] "Uncaught ReferenceError: DevToolsAPI is not defined", source: (1)
@vatex There’s are different downloads for SDK and “Normal” on https://nwjs.io/.
Did you ever get this working? I’m having the same issue (a year later)…😞
Even though I downloaded the v0.23.6 SDK version like @rogerwang suggested, I get this same error when trying to
win.showDevTools()
programmatically:and pressing F12 in the window doesn’t have any effect.
nw --version
shows:Update: It turns out maybe I wasn’t using the SDK version that I downloaded that I thought I was using after all.
I’d tried installing a few different ways, including adding the
nw
package to mypackage.json
(yarn add --dev nw
). I’m guessing it must have been using the version ofnw
from that npm package instead of my globally installednw
in/usr/bin
.Solution was apparently to read down further on https://www.npmjs.com/package/nw where it explains how to get it to use the SDK version… For example, with
or (the way I ended up using/preferring), adding
-sdk
to the package name:I am now able to open dev tools in my nw app.👍