RaghavSh
Mega Patron

Have you ever visited a Banking site and wondered how right-click is disabled on such sites. This can be achieved on Servicenow Portals as well. We know portal is also a kind of web page and have all the possibilities, just follow the below steps:

1. Create a UI script with UI type as Mobile / Service Portal named "Restrict right click":

$(document).ready(function() {
    $("body").on("contextmenu", function(e) {
        alert("Security Warning: Right click disabled.");
        return false;
    });
});

 

2. Lookout for the "Theme" your portal is using and add your UI script created in step 1 using JS include:

 

find_real_file.png

find_real_file.png

 

3. Try to right click on your portal now:

 

find_real_file.png

Version history
Last update:
‎02-19-2022 05:01 AM
Updated by: