Chrome-like "inspect element" context-menu for Electron
This module was extracted from electron-debug to keep it focused on its main features.
Inspect the clicked HTML element. It shows DevTools if it's not already opened.
$ npm install --save-dev debug-menu
Require this module only in renderer process code. BrowserWindow instance has to be opened with node integration enabled.
We usually load this module only if the DEBUG
environment variable is defined, to avoid end users of the app inadvertently opening DevTools.
const debugMenu = require('debug-menu');
debugMenu.install(); // activate context menu
// later, if needed
debugMenu.uninstall(); // deactivate context menu
Activate context menu. This method add a listener on window
object contextmenu
event.
Deactivate context menu. This method remove the listener on window
object.
The debug Menu object instance. You can use it to integrate with your own app context or system menu.
The MIT License (MIT)
Copyright (c) 2016 Andrea Parodi