Skip to content

Commit 9f10ead

Browse files
authored
Create script.js
1 parent 6579f1b commit 9f10ead

File tree

1 file changed

+13
-0
lines changed
  • Client-Side Components/UI Scripts/Disable Copy Paste For Portal

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
Disable Copy Paste on Portal Pages.
3+
UI Type : Service Portal/Mobile.
4+
*/
5+
document.addEventListener('copy', function(e) { //event listner for copy.
6+
alert("Copy Operation is prevented on this page."); // alert for copy
7+
e.preventDefault(); // prevent copy
8+
});
9+
10+
document.addEventListener('paste', function(e) { //event listner for paste.
11+
alert("Paste Operation is prevented on this page."); //alert for paste
12+
e.preventDefault(); // prevent paste
13+
});

0 commit comments

Comments
 (0)