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

Developer Tools wasn't opend when I press F12 #5120

Closed
vkupar opened this issue Jul 19, 2016 · 6 comments
Closed

Developer Tools wasn't opend when I press F12 #5120

vkupar opened this issue Jul 19, 2016 · 6 comments

Comments

@vkupar
Copy link

vkupar commented Jul 19, 2016

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)
@vkupar vkupar changed the title Developer Tools wasn't opend when I clicked F12 Developer Tools wasn't opend when I press F12 Jul 19, 2016
@rogerwang
Copy link
Member

You should use SDK build. devtools in available only in SDK build.

@vkupar
Copy link
Author

vkupar commented Jul 19, 2016

where is SDK build?

@TylerRick
Copy link

TylerRick commented Jul 18, 2017

@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:

[7797:7797:0718/150644.051485:ERROR:CONSOLE(1)] "Uncaught ReferenceError: DevToolsAPI is not defined", source:  (1)

and pressing F12 in the window doesn't have any effect.

nw --version shows:

[0718/151607.420419:WARNING:chrome_main_delegate.cc(569)] final extension: 
nwjs 59.0.3071.115 

@TylerRick
Copy link

By the way, this is the first link that shows up when you Google for "Uncaught ReferenceError: DevToolsAPI is not defined" ubuntu

@TylerRick
Copy link

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 my package.json (yarn add --dev nw). I'm guessing it must have been using the version of nw from that npm package instead of my globally installed nw 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

npm install nw --nwjs_build_type=sdk

or (the way I ended up using/preferring), adding -sdk to the package name:

yarn add --dev nw@0.23.6-sdk-1

I am now able to open dev tools in my nw app. 👍

@TomasHubelbauer
Copy link

See also #70. The problem with the DevTools not appearing persists. I am using the latest SDK version and I can only bring up the DevTools programmatically using nw.Window.get().showDevTools(); but not using the Window > Devtools menu item or the Cmd+Option+i shortcut.

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

No branches or pull requests

4 participants