electron-debug
Advanced tools
Comparing version 0.3.0 to 0.3.1
36
index.js
@@ -25,3 +25,3 @@ 'use strict'; | ||
const webContents = e.sender; | ||
webContents.executeJavaScript(`require('${__dirname}/context-menu').install();`); | ||
webContents.executeJavaScript(`window.__electron_debug.require('${__dirname}/context-menu').install();`); | ||
} | ||
@@ -31,3 +31,3 @@ | ||
const webContents = e.sender; | ||
webContents.executeJavaScript(`require('${__dirname}/context-menu').uninstall();`); | ||
webContents.executeJavaScript(`window.__electron_debug.require('${__dirname}/context-menu').uninstall();`); | ||
} | ||
@@ -50,23 +50,25 @@ | ||
module.exports = () => { | ||
app.on('ready', () => { | ||
app.on('browser-window-focus', (e, win) => { | ||
globalShortcut.register(isOSX ? 'Cmd+Alt+I' : 'Ctrl+Shift+I', devTools); | ||
globalShortcut.register('F12', devTools); | ||
app.on('browser-window-created', (e, win) => { | ||
win.webContents.executeJavaScript('window.__electron_debug = {require: window.require};'); | ||
}); | ||
globalShortcut.register('CmdOrCtrl+R', refresh); | ||
globalShortcut.register('F5', refresh); | ||
app.on('browser-window-focus', (e, win) => { | ||
globalShortcut.register(isOSX ? 'Cmd+Alt+I' : 'Ctrl+Shift+I', devTools); | ||
globalShortcut.register('F12', devTools); | ||
installDebugContextMenu(win); | ||
}); | ||
globalShortcut.register('CmdOrCtrl+R', refresh); | ||
globalShortcut.register('F5', refresh); | ||
app.on('browser-window-blur', (e, win) => { | ||
globalShortcut.unregister(isOSX ? 'Cmd+Alt+I' : 'Ctrl+Shift+I'); | ||
globalShortcut.unregister('F12'); | ||
installDebugContextMenu(win); | ||
}); | ||
globalShortcut.unregister('CmdOrCtrl+R'); | ||
globalShortcut.unregister('F5'); | ||
app.on('browser-window-blur', (e, win) => { | ||
globalShortcut.unregister(isOSX ? 'Cmd+Alt+I' : 'Ctrl+Shift+I'); | ||
globalShortcut.unregister('F12'); | ||
uninstallDebugContextMenu(win); | ||
}); | ||
globalShortcut.unregister('CmdOrCtrl+R'); | ||
globalShortcut.unregister('F5'); | ||
uninstallDebugContextMenu(win); | ||
}); | ||
}; |
{ | ||
"name": "electron-debug", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Adds useful debug features to your Electron app", | ||
@@ -35,7 +35,8 @@ "license": "MIT", | ||
"xo": { | ||
"globals": [ | ||
"atom", | ||
"window" | ||
"esnext": true, | ||
"envs": [ | ||
"node", | ||
"browser" | ||
] | ||
} | ||
} |
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
5639
84