electron-debug
Advanced tools
Comparing version 0.2.0 to 0.2.1
46
index.js
@@ -7,26 +7,36 @@ 'use strict'; | ||
function devTools() { | ||
var win = BrowserWindow.getFocusedWindow(); | ||
if (win) { | ||
win.toggleDevTools(); | ||
} | ||
} | ||
function refresh() { | ||
var win = BrowserWindow.getFocusedWindow(); | ||
if (win) { | ||
win.reloadIgnoringCache(); | ||
} | ||
} | ||
module.exports = function () { | ||
app.on('ready', function () { | ||
globalShortcut.register(isOSX ? 'Cmd+Alt+I' : 'Ctrl+Shift+I', devTools); | ||
globalShortcut.register('F12', devTools); | ||
app.on('browser-window-focus', function () { | ||
globalShortcut.register(isOSX ? 'Cmd+Alt+I' : 'Ctrl+Shift+I', devTools); | ||
globalShortcut.register('F12', devTools); | ||
globalShortcut.register('CmdOrCtrl+R', refresh); | ||
globalShortcut.register('F5', refresh); | ||
globalShortcut.register('CmdOrCtrl+R', refresh); | ||
globalShortcut.register('F5', refresh); | ||
}); | ||
function devTools() { | ||
var win = BrowserWindow.getFocusedWindow(); | ||
app.on('browser-window-blur', function () { | ||
globalShortcut.unregister(isOSX ? 'Cmd+Alt+I' : 'Ctrl+Shift+I'); | ||
globalShortcut.unregister('F12'); | ||
if (win) { | ||
win.toggleDevTools(); | ||
} | ||
} | ||
function refresh() { | ||
var win = BrowserWindow.getFocusedWindow(); | ||
if (win) { | ||
win.reloadIgnoringCache(); | ||
} | ||
} | ||
globalShortcut.unregister('CmdOrCtrl+R'); | ||
globalShortcut.unregister('F5'); | ||
}); | ||
}); | ||
}; |
{ | ||
"name": "electron-debug", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Adds useful debug features to your Electron app", | ||
@@ -15,2 +15,5 @@ "license": "MIT", | ||
}, | ||
"scripts": { | ||
"test": "xo" | ||
}, | ||
"files": [ | ||
@@ -25,3 +28,11 @@ "index.js" | ||
"dev" | ||
] | ||
], | ||
"devDependencies": { | ||
"xo": "*" | ||
}, | ||
"xo": { | ||
"globals": [ | ||
"atom" | ||
] | ||
} | ||
} |
@@ -37,2 +37,4 @@ # electron-debug | ||
```js | ||
var app = require('app'); | ||
require('electron-debug')(); | ||
@@ -43,3 +45,6 @@ | ||
app.on('ready', function () { | ||
win = new BrowserWindow({}); | ||
win = new BrowserWindow({ | ||
width: 800, | ||
height: 600 | ||
}); | ||
}); | ||
@@ -46,0 +51,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
3678
33
55
1