jeudi 1 juin 2017

How to Disable right click both mouse and keyboard in MIcrosoft Edge

Disable right click in Microsoft Edge.This below code works fine in Google and Internet Explorer document.onmousedown = clickfn;

    function clickfn(e) {
        var button;
        if (navigator.appName == "Microsoft Internet Explorer") {
            button = event.button;

        }
        else {
            button = e.buttons;
        }

        if (button == 2) {
            alert("Right Click Disabled");

            if (navigator.appName == "Microsoft Internet Explorer") {
                event.returnValue = false;
            }                
            return false;
        }
    }
</script>

Aucun commentaire:

Enregistrer un commentaire