
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@htmlos/contextmenu
Advanced tools
A simple and easy-to-use contextmenu library for html5
Preview Demo https://htmlos.github.io/ContextMenu/
html5, vue, react and other frameworksESC)
| Browser | Chrome | FireFox | IE | Edge | Safari | Opera |
|---|---|---|---|---|---|---|
| Version | 27 | 21 | 9 | 12 | 6 | 15 |
# npm
npm i @htmlos/contextmenu
# yarn
yarn add @htmlos/contextmenu
import {ContextMenu, ContextMenuOptions} from "@htmlos/contextmenu";
import "@htmlos/contextmenu/dist/contextmenu.css";
Custom style: please refer to contextmenu.css
position: fixed, which will cause some styles of some elements to be invalid (such as .contextmenu and .contextmenu-item of margin, need to use padding adjustment).contextmenu, this may not only be invisible during the loading process, but also affect the subsequent automatic positioningConfig:
// ContextMenu.config(options: ContextMenuOptions);
ContextMenu.config({
i18n: function(s){
return your_translate_function(s) || s;
},
style: {
// custom animation: [string, number] => [className, duration],
// defaults to [ "contextmenu-in", 0], [ "contextmenu-out", 0]
contextmenuIn: ['fade-in', 200],
contextmenuOut: ['fade-out', 200],
},
});
const menu=[
{ // item
name: "reload",
icon: "./reload.png",
disabled: false,
onclick: ()=>{},
hotkey: "ctrl+r",
children: [
//...
]
},
{}, // divider
//...
]
menu[0].children=menu; // nested infinite submenu
Contextmenu.show(menu);
// auto hide or manually
Contextmenu.hide();
sudo npm config set registry https://registry.npm.taobao.org
# sudo npm i -g npm-check-updates
ncu -u
sudo npm config set registry https://registry.npmjs.org
yarn config set disturl https://npm.taobao.org/dist -g
yarn config set electron_mirror https://npm.taobao.org/mirrors/electron/ -g
yarn config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/ -g
yarn config set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs/ -g
yarn config set chromedriver_cdnurl https://cdn.npm.taobao.org/dist/chromedriver -g
yarn config set operadriver_cdnurl https://cdn.npm.taobao.org/dist/operadriver -g
yarn config set fse_binary_host_mirror https://npm.taobao.org/mirrors/fsevents -g
yarn install
yarn build
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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.