File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Client-Side Components/UI Scripts/Prevent right click on portals Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ ** Steps to Activate**
2+ 1 . Open the portals you want to disable right-click in "sp_portal" table.
3+ 2 . Open the theme attached to the portal.
4+ 3 . In the theme under "JS Includes" relatd list, create new JS include and select the UI script you created.
5+ Go to your portal and try to roght click, it will prevent and show the alert message.
6+
7+ ** Use Case**
8+ 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.
9+ 2 . Many organizations want their source code to be hidden so they prevent right-click.
10+
11+
12+ ** Note**
13+ 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.
Original file line number Diff line number Diff line change 1+ /*
2+ Prevent right-click on portal for portal pages.
3+ This will secure the site code, prevent users from saving images etc.
4+ Ideal for high security organisations.
5+
6+ UI Type : Mobile/service portal.
7+ */
8+ ( function ( ) { // self invoking function
9+ document . addEventListener ( 'contextmenu' , function ( event ) {
10+ event . preventDefault ( ) ; // Prevent right-click operation.
11+ alert ( "Right-Click Prevented for Security Reasons." ) ; // alert message shown on right click.
12+ } ) ;
13+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments