electron-debug
Advanced tools
Comparing version 1.0.1 to 1.1.0
17
index.js
@@ -35,2 +35,18 @@ 'use strict'; | ||
function inspectElements() { | ||
const win = BrowserWindow.getFocusedWindow(); | ||
const inspect = () => { | ||
win.devToolsWebContents.executeJavaScript('DevToolsAPI.enterInspectElementMode()'); | ||
}; | ||
if (win) { | ||
if (win.webContents.isDevToolsOpened()) { | ||
inspect(); | ||
} else { | ||
win.webContents.on('devtools-opened', inspect); | ||
win.openDevTools(); | ||
} | ||
} | ||
} | ||
module.exports = opts => { | ||
@@ -63,2 +79,3 @@ opts = Object.assign({ | ||
localShortcut.register('CmdOrCtrl+Shift+C', inspectElements); | ||
localShortcut.register(isMacOS ? 'Cmd+Alt+I' : 'Ctrl+Shift+I', devTools); | ||
@@ -65,0 +82,0 @@ localShortcut.register('F12', devTools); |
{ | ||
"name": "electron-debug", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Adds useful debug features to your Electron app", | ||
@@ -34,3 +34,3 @@ "license": "MIT", | ||
"devtron": "^1.1.0", | ||
"electron-prebuilt": "0.37.7", | ||
"electron": "^1.3.3", | ||
"xo": "*" | ||
@@ -37,0 +37,0 @@ }, |
@@ -26,2 +26,10 @@ # electron-debug | ||
### Element Inspector | ||
Open DevTools and focus the Element Inspector tool. | ||
- macOS: <kbd>Cmd</kbd> <kbd>Shift</kbd> <kbd>C</kbd> | ||
- Linux: <kbd>Ctrl</kbd> <kbd>Shift</kbd> <kbd>C</kbd> | ||
- Windows: <kbd>Ctrl</kbd> <kbd>Shift</kbd> <kbd>C</kbd> | ||
### Activates Devtron | ||
@@ -28,0 +36,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7492
72
137