Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • NW.js Essentials
  • Toc
  • feedback
NW.js Essentials

NW.js Essentials

By : Benoit
4.8 (5)
close
NW.js Essentials

NW.js Essentials

4.8 (5)
By: Benoit

Overview of this book

If you are an experienced Node.js developer who wants to create amazing desktop applications using NW.js, this is the book for you. Prior knowledge of HTML5, jQuery, and CSS is assumed.
Table of Contents (11 chapters)
close
10
Index

The DevTools API


The DevTools API is a part of the Window APIs seen in Chapter 2, NW.js Native UI APIS, and it provides three methods:

  • Window.isDevToolsOpen()

  • Window.closeDevTools()

  • Window.showDevTools([id | iframe, headless])

The first two methods are pretty much self-explanatory, while the third one deserves to be dived deep into.

The most common use of Window.showDevTools is without parameters. This way, you can open DevTools at runtime without having to enable the window toolbar:

require('nw.gui').Window.get().showDevTools();

The first parameter [id|iframe] allows us to set the target frame for which debugging is to be enabled. Let's see an example:

<iframe src= "test.html" id="toDebug" ></iframe>
<script type="text/javascript">
var win = require('nw.gui').Window.get();
win.showDevTools('toDebug');
</script>

This way, DevTools will be enabled only on the #toDebug iframe. Its value can be set to the ID or the object of the iframe element.

The second parameter, headless,...

bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete