Pages

Sunday, May 12, 2013

Disabling Right Click on OBIEE with JS

To disable mouse right click in OBIEE dashboards.Place the following Java script in dashboard.
  
<script language=JavaScript>
<!--
var message="Right click Disabled!";

function clickIEbrowser4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNSbrowser4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNSbrowser4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIEbrowser4;
}
document.oncontextmenu=new Function("alert(message);return false")
</script>



2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Thank you.. It worked for me.
    If you don't know where to place your javascript in OBIEE. Please find the below link

    https://community.oracle.com/thread/2290290?tstart=0

    ReplyDelete