The Power of jQuery and Service Portal - 2
Import
·
Feb 19, 2022
·
article
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:
3. Try to right click on your portal now:
View original source
https://www.servicenow.com/community/developer-articles/the-power-of-jquery-and-service-portal-2/ta-p/2322941