In case its required no one can use right click context menu in browser while opening the page to restrict all the operations possible with context menu commands the the following is the command that will do the job
document.oncontextmenu = function(){return false;};
In case its also required to restrict the selection of text as if text will be able to selected then hot keys can copy the contents but disabling selection of text can prohibit the copy. So to disable the selection the following will disable text selection.
document.onselectstart= function() {return false;};
And if these commands are written in the javascript code block then the specified features will be enforced after complete page is loaded with javascript block.
No comments:
Post a Comment