
Security News
CISA Kills Off RSS Feeds for KEVs and Cyber Alerts
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
@mturco/context-menu
Advanced tools
A small JavaScript library for adding context menus to any HTML element
A small (4.4kb / 1.7kb gzipped) JavaScript library for adding context menus to any HTML element.
npm install @mturco/context-menu
new ContextMenu(selector, items[, options]);
selector
(String) - Show context menus for elements matching this selectoritems
(Array) - Array of menu items objects in the format of:
name
(String) - Label displayed for menu itemfn
(Function) - onclick
event handler for menu item{}
) in the items
array.options
(Object)
className
(String, default: ''
) - CSS class to add to the context menu elementminimalStyling
(Boolean, default: false
) - If true, does not apply default theme CSS class to context menu elementContextMenu.prototype.on(type, listener);
ContextMenu.prototype.off(type, listener);
type
(String) - Event type; one of: created
, shown
, hidden
, itemselected
listener
(Function) - Callback for event listenerRemoves DOM elements and event listeners.
import ContextMenu from 'context-menu';
const menu = new ContextMenu('table tr', [
{
name: 'Add row',
fn: () => {
/* ... */
},
},
{
name: 'Remove row',
fn: () => {
/* ... */
},
},
]);
menu.on('itemselected', () => {
/* ... */
});
FAQs
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.