From 54862b49b1c7eed6c92c01bb18a01af872ca2281 Mon Sep 17 00:00:00 2001 From: rhysd Date: Sat, 29 Aug 2015 19:20:55 +0900 Subject: [PATCH] Add BrowserWindow.isDevToolsOpened() https://github.com/atom/electron/blob/master/docs/api/browser-window.md#winisdevtoolsopened --- github-electron/github-electron-main-tests.ts | 3 +++ github-electron/github-electron.d.ts | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts index d353dfeb3..9b65ba29c 100644 --- a/github-electron/github-electron-main-tests.ts +++ b/github-electron/github-electron-main-tests.ts @@ -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 diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index 5df526bfc..bcf281121 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -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. */