Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

electron-debug

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-debug - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

context-menu.js

40

index.js

@@ -8,3 +8,3 @@ 'use strict';

function devTools() {
var win = BrowserWindow.getFocusedWindow();
const win = BrowserWindow.getFocusedWindow();

@@ -17,3 +17,3 @@ if (win) {

function refresh() {
var win = BrowserWindow.getFocusedWindow();
const win = BrowserWindow.getFocusedWindow();

@@ -25,5 +25,29 @@ if (win) {

module.exports = function () {
app.on('ready', function () {
app.on('browser-window-focus', function () {
function activateDebugContextMenu(e) {
const webContents = e.sender;
webContents.executeJavaScript(`require('${__dirname}/context-menu').install();`);
}
function deactivateDebugContextMenu(e) {
const webContents = e.sender;
webContents.executeJavaScript(`require('${__dirname}/context-menu').uninstall();`);
}
function installDebugContextMenu(win) {
win.webContents.on('devtools-opened', activateDebugContextMenu);
win.webContents.on('devtools-closed', deactivateDebugContextMenu);
if (win.webContents.isDevToolsOpened()) {
activateDebugContextMenu({sender: win.webContents});
}
}
function uninstallDebugContextMenu(win) {
win.webContents.removeListener('devtools-opened', activateDebugContextMenu);
win.webContents.removeListener('devtools-closed', deactivateDebugContextMenu);
}
module.exports = () => {
app.on('ready', () => {
app.on('browser-window-focus', (e, win) => {
globalShortcut.register(isOSX ? 'Cmd+Alt+I' : 'Ctrl+Shift+I', devTools);

@@ -34,5 +58,7 @@ globalShortcut.register('F12', devTools);

globalShortcut.register('F5', refresh);
installDebugContextMenu(win);
});
app.on('browser-window-blur', function () {
app.on('browser-window-blur', (e, win) => {
globalShortcut.unregister(isOSX ? 'Cmd+Alt+I' : 'Ctrl+Shift+I');

@@ -43,4 +69,6 @@ globalShortcut.unregister('F12');

globalShortcut.unregister('F5');
uninstallDebugContextMenu(win);
});
});
};

10

package.json
{
"name": "electron-debug",
"version": "0.2.1",
"version": "0.3.0",
"description": "Adds useful debug features to your Electron app",

@@ -16,6 +16,8 @@ "license": "MIT",

"scripts": {
"start": "electron test.js",
"test": "xo"
},
"files": [
"index.js"
"index.js",
"context-menu.js"
],

@@ -30,2 +32,3 @@ "keywords": [

"devDependencies": {
"electron-prebuilt": "^0.34.1",
"xo": "*"

@@ -35,5 +38,6 @@ },

"globals": [
"atom"
"atom",
"window"
]
}
}

@@ -26,3 +26,7 @@ # electron-debug

### Inspect element
Right-click on an HTML element when DevTools is open to inspect it.
## Install

@@ -29,0 +33,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc