Announcement

Collapse
No announcement yet.

Disable right click

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    I found a bug in my code. I fixed it. It should be working now on your site.

    For reference, this is the updated code:

    Code:
    <script>
    (function() {
        document.addEventListener('DOMContentLoaded', function() {
            var usergroupids = [22]; //Specify usergroup IDs here delimited by comma
            var callback = function(id) {
                return document.querySelector('body[data-usergroupid="' + id + '"]');
            }
            if (usergroupids.some(callback)) {
                document.addEventListener('contextmenu', function(e) {
                    e.preventDefault();
                    //uncomment the alert statement below by removing the // if you need to display an alert message.
                    //alert("Sorry, you are not allowed to do this.");
                });
            }
        });    
    })();
    </script>
    Buy me a coffeePayPal QR Code
    My Amazon Affiliate Link
    Fast vBulletin VPS Host:
    This site is hosted by IONOS

    Comment


      #17
      Thanks Glenn perfect

      Comment

      Latest Posts

      Collapse

      Working...
      X
      Searching...Please wait.
      An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

      Please push the back button and reload the previous window.'
      An unexpected error was returned: 'Your submission could not be processed because the token has expired.

      Please push the back button and reload the previous window.'
      An internal error has occurred and the module cannot be displayed.
      There are no results that meet this criteria.
      Search Result for "|||"