Merge pull request #5602 from rhysd/patch-1

Add BrowserWindow.isDevToolsOpened()
This commit is contained in:
Masahiro Wakame
2015-09-03 01:53:51 +09:00
2 changed files with 7 additions and 0 deletions
@@ -44,6 +44,9 @@ app.on('ready', () => {
// and load the index.html of the app.
mainWindow.loadUrl(`file://${__dirname}/index.html`);
mainWindow.openDevTools()
var opened: boolean = mainWindow.isDevToolsOpened()
mainWindow.toggleDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', () => {
// Dereference the window object, usually you would store windows
+4
View File
@@ -356,6 +356,10 @@ declare module GitHubElectron {
* Closes the developer tools.
*/
closeDevTools(): void;
/**
* Returns whether the developer tools are opened.
*/
isDevToolsOpened(): boolean;
/**
* Toggle the developer tools.
*/