diff --git a/Client-Side Components/UI Scripts/Prevent right click on portals/README.md b/Client-Side Components/UI Scripts/Prevent right click on portals/README.md new file mode 100644 index 0000000000..6bc76969dc --- /dev/null +++ b/Client-Side Components/UI Scripts/Prevent right click on portals/README.md @@ -0,0 +1,13 @@ +**Steps to Activate** +1. Open the portals you want to disable right-click in "sp_portal" table. +2. Open the theme attached to the portal. +3. In the theme under "JS Includes" relatd list, create new JS include and select the UI script you created. +Go to your portal and try to roght click, it will prevent and show the alert message. + +**Use Case** +1. Many high security organizations like banks do not want their images or links to be copied through "inspect" so right-click need to be disabled. +2. Many organizations want their source code to be hidden so they prevent right-click. + + + **Note** + 1. This UI script is applied through portal theme , so it will be specific to portals using that theme. It will not have instance wide affect. diff --git a/Client-Side Components/UI Scripts/Prevent right click on portals/script.js b/Client-Side Components/UI Scripts/Prevent right click on portals/script.js new file mode 100644 index 0000000000..ebcdbb7c06 --- /dev/null +++ b/Client-Side Components/UI Scripts/Prevent right click on portals/script.js @@ -0,0 +1,13 @@ +/* +Prevent right-click on portal for portal pages. +This will secure the site code, prevent users from saving images etc. +Ideal for high security organisations. + +UI Type : Mobile/service portal. +*/ +(function() { // self invoking function + document.addEventListener('contextmenu', function(event) { + event.preventDefault(); // Prevent right-click operation. + alert("Right-Click Prevented for Security Reasons."); // alert message shown on right click. + }); +})();