Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有兴趣在右键单击时消除 chrome 的右键菜单并执行新功能。
目前,我执行以下操作:
new_tab_li.oncontextmenu = myFunction;
这会执行“myFunction”,但也会打开 chrome 的右键菜单。
你必须return false;在你的自定义函数中做
return false;
function myFunction{ // Your code return false; }