plirof2

Disable right click v01c

Oct 20th, 2020 (edited)
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # WORKS on Iframe
  2.  
  3. ___________________footer_js 201020c OK works (Maybe-Yes in flash)___________
  4. //PUT inside init_links()
  5.     // (((((((((((((((((((((((((( option to disablerightclick ((((((((((
  6.     var url_norightclick=location.search.substring(1).indexOf("norightclick");// != to -1 if we have this param
  7.     if(url_norightclick!==-1) {
  8.         document.oncontextmenu=new Function("console.log('main page: right-click-context menu -STOPPED');return false") ; //OK normal page Works
  9.  
  10.         console.log("norightclick-ENABLED");
  11.         window.frames["sideframe1"].document.oncontextmenu = function(){console.log("sideframe1 :oncontextmenu right click-DISABLED"); return false;};  
  12.         setInterval(function(){window.frames["sideframe1"].document.oncontextmenu = function(){console.log("setInterval sideframe1 :oncontextmenu right click-DISABLED"); return false;}; }, 2000);//test
  13.  
  14.     }
  15.     // )))))))))))))))))))))))))) option to disablerightclick ))))))))
  16.  
  17. _________________________________________________________________
  18.  
  19.  
  20. ___________________footer_js 201020b OK works (NOT in flash)___________
  21. // *** iframe onload="disableContextMenu();"
  22.  
  23.     // (((((((((((((((((((((((((( option to disablerightclick ((((((((((
  24.     var url_norightclick=location.search.substring(1).indexOf("norightclick");// != to -1 if we have this param
  25.     if(url_norightclick!==-1) {
  26.             console.log("norightclick-ENABLED");
  27.             window.frames["sideframe1"].document.oncontextmenu = function(){console.log("iFrame: right click-STOPPED"); return false;};
  28.             document.oncontextmenu=new Function("console.log('main page: right-click-context menu -STOPPED');return false")  
  29.     }
  30. // ADOBE flash disable right click menu :<param name="menu" value="false" />
  31.     // )))))))))))))))))))))))))) option to disablerightclick ))))))))
  32.  
  33. ___________________________
  34. <script type="text/javascript">
  35.   function disableContextMenu()
  36.   {
  37.     window.frames["sideframe1"].document.oncontextmenu = function(){console.log("right click-DISABLED"); return false;};  
  38.     // Or use this
  39.     // document.getElementById("fraDisabled").contentWindow.document.oncontextmenu = function(){alert("No way!"); return false;};;    
  40.   }  
  41. </script>
  42. <iframe name="sideframe1" src="" allowfullscreen="" height="98%" frameborder="0" width="98%"  onload="disableContextMenu();" onMyLoad="disableContextMenu();" oncontextmenu="return false" onselectstart="return false" ondragstart="return false" >
  43.  
  44. </iframe>
  45.  
  46.  
  47. __________
  48. https://cmsdk.com/javascript/how-do-i-disable-right-click-on-my-web-page.html
  49. ____________________
  50.  
  51. //Script for disabling right click on mouse
  52. var message="Function Disabled!";
  53. console.log(message);
  54. function clickdsb(){
  55. if (event.button==2){
  56. alert(message);
  57. return false;
  58. }
  59. }
  60. function clickbsb(e){
  61. if (document.layers||document.getElementById&&!document.all){
  62. if (e.which==2||e.which==3){
  63. alert(message);
  64. return false;
  65. }
  66. }
  67. }
  68. if (document.layers){
  69. document.captureEvents(Event.MOUSEDOWN);
  70. document.onmousedown=clickbsb;
  71. }
  72. else if (document.all&&!document.getElementById){
  73. document.onmousedown=clickdsb;
  74. }
  75. _______________-
  76. //Disable right mouse click Script OK works (only on specific spot-NOT iframe -jon)
  77. document.oncontextmenu=new Function("alert(message);return false")
  78.  
  79. ________________________
  80. (den douleuei se Iframe)
  81. <body oncontextmenu="return false;">
  82.  
  83. ___________________
  84. <script language=JavaScript>
  85. //Disable right mouse click Script OK works (only on specific spot-NOT iframe -jon)
  86. var message="Function Disabled!";
  87. function clickIE4(){
  88. if (event.button==2){
  89. alert(message);
  90. return false;
  91.  }
  92. }
  93. function clickNS4(e){
  94. if (document.layers||document.getElementById&&!document.all){
  95. if (e.which==2||e.which==3){
  96. alert(message);
  97. return false;
  98. }
  99. }
  100. }
  101. if (document.layers){
  102. document.captureEvents(Event.MOUSEDOWN);
  103. document.onmousedown=clickNS4;
  104. }
  105. else if (document.all&&!document.getElementById){
  106. document.onmousedown=clickIE4;
  107. }
  108. document.oncontextmenu=new Function("alert(message);return false")
  109. </script>
  110.  
  111.  
  112. _______
  113.  
  114.  
  115.  
  116.  
  117.  
Add Comment
Please, Sign In to add comment