I am working on an application using javascript and I want to get mouse events. To stop the options that appear when right clicking I use the preventDefault()
function and it works in Firefox and Chrome but it doesn't work in Safari. This is my code:
document.querySelector("#GL-Surface").addEventListener("mousedown", function(e) {
e.preventDefault();
/* Handle mouse events */
});
From an other question I got that you should return false;
but this still doesn't work. preventDefault()
however works in Safari when it is used in keyboard inputs. So how can I prevent the default actions for mouse events in Safari?