From 92b184bc2240bb02afd93d2cadc63930e170cf27 Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:26:21 +0530 Subject: [PATCH 1/8] Create test.js --- Specialized Areas/Fix scripts/test.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 Specialized Areas/Fix scripts/test.js diff --git a/Specialized Areas/Fix scripts/test.js b/Specialized Areas/Fix scripts/test.js new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/Specialized Areas/Fix scripts/test.js @@ -0,0 +1 @@ + From f0add90e292d47924110b758d3e0a1c123b4abb5 Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:27:02 +0530 Subject: [PATCH 2/8] Delete Specialized Areas/Fix scripts/test.js --- Specialized Areas/Fix scripts/test.js | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Specialized Areas/Fix scripts/test.js diff --git a/Specialized Areas/Fix scripts/test.js b/Specialized Areas/Fix scripts/test.js deleted file mode 100644 index 8b13789179..0000000000 --- a/Specialized Areas/Fix scripts/test.js +++ /dev/null @@ -1 +0,0 @@ - From 9dcbbe1de7ea6a7b5e3f652de500dd53aabcbb87 Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Sun, 12 Oct 2025 16:41:51 +0530 Subject: [PATCH 3/8] Create Prevent Right-Click On Portals.script.js --- .../Prevent Right-Click On Portals.script.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Client-Side Components/UI Scripts/Prevent Right-Click On Portals.script.js 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..3f92989316 --- /dev/null +++ b/Client-Side Components/UI Scripts/Prevent Right-Click On Portals.script.js @@ -0,0 +1,11 @@ +/* +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. +*/ +(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. + }); +})(); From 94e1d4d4365b81d8f1dab1db11d9ec0971e95a46 Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Sun, 12 Oct 2025 16:43:22 +0530 Subject: [PATCH 4/8] Delete Client-Side Components/UI Scripts/Prevent Right-Click On Portals.script.js --- .../Prevent Right-Click On Portals.script.js | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 Client-Side Components/UI Scripts/Prevent Right-Click On Portals.script.js 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 deleted file mode 100644 index 3f92989316..0000000000 --- a/Client-Side Components/UI Scripts/Prevent Right-Click On Portals.script.js +++ /dev/null @@ -1,11 +0,0 @@ -/* -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. -*/ -(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. - }); -})(); From 31309e9aea4b2ac3074fb185cc74b6d6411f32b1 Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Sun, 12 Oct 2025 16:44:07 +0530 Subject: [PATCH 5/8] Create script.js --- .../Prevent right click on portals/script.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Client-Side Components/UI Scripts/Prevent right click on portals/script.js 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..3f92989316 --- /dev/null +++ b/Client-Side Components/UI Scripts/Prevent right click on portals/script.js @@ -0,0 +1,11 @@ +/* +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. +*/ +(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. + }); +})(); From 5fe11931c52a70c51ae75d352aa56228b856607e Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Sun, 12 Oct 2025 16:50:47 +0530 Subject: [PATCH 6/8] Create README.md --- .../UI Scripts/Prevent right click on portals/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Client-Side Components/UI Scripts/Prevent right click on portals/README.md 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..a2a2a005a8 --- /dev/null +++ b/Client-Side Components/UI Scripts/Prevent right click on portals/README.md @@ -0,0 +1,9 @@ +**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. From 6f23ff703c5e189a92b2c3377cca24fb00a4863f Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Sun, 12 Oct 2025 16:51:33 +0530 Subject: [PATCH 7/8] Update script.js --- .../UI Scripts/Prevent right click on portals/script.js | 2 ++ 1 file changed, 2 insertions(+) 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 index 3f92989316..ebcdbb7c06 100644 --- 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 @@ -2,6 +2,8 @@ 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) { From 6aba802ed6754a10582df66509bb2a1266647eec Mon Sep 17 00:00:00 2001 From: Raghav Sharma <53517312+raghavs046@users.noreply.github.com> Date: Sun, 12 Oct 2025 16:53:20 +0530 Subject: [PATCH 8/8] Update README.md --- .../UI Scripts/Prevent right click on portals/README.md | 4 ++++ 1 file changed, 4 insertions(+) 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 index a2a2a005a8..6bc76969dc 100644 --- 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 @@ -7,3 +7,7 @@ Go to your portal and try to roght click, it will prevent and show the alert mes **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.