window.onmouseup = event => event.preventDefault();
function disableEdgeMiniMenu() {
if (/Edg\//.test(window.navigator.userAgent)) { // if it's edge (chromium-based)
window.addEventListener("mouseup", event => event.preventDefault())
window.addEventListener("dblclick", () => window.getSelection().empty())
}
}
user-select: none
或pointer-events: none
,但这可能会阻止文本选择等行为。不幸的是,上下文菜单仅专用于右键上下文菜单。 - PedroZorus