How to block user from copying data from webpage using javascript?
-
I want to block user from copying data from the page. I have used javascript that block the right click of the user so he will not able use right click menu to copy and past data. But user can still copy data by using keybord keys "Ctrl + C" to copy it. Or they can save the page from file menu. Is there any technique to stops these two things. So i can block user from copying data. Regards,
Kiran Sajanikar Software Engineer Pune, India.
-
I want to block user from copying data from the page. I have used javascript that block the right click of the user so he will not able use right click menu to copy and past data. But user can still copy data by using keybord keys "Ctrl + C" to copy it. Or they can save the page from file menu. Is there any technique to stops these two things. So i can block user from copying data. Regards,
Kiran Sajanikar Software Engineer Pune, India.
No; JavaScript is run inside a sandbox and so the browser has control over what it does. JavaScript therefore cannot control any part of the browser, as it's run inside this protected environment. Without knowing what your project entails I cannot really comment much on it, but if you stop your users from copy + paste, what about print screen or just typing up the text manually? Regards, --Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year."
-Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer."
-Fred Brooks -
No; JavaScript is run inside a sandbox and so the browser has control over what it does. JavaScript therefore cannot control any part of the browser, as it's run inside this protected environment. Without knowing what your project entails I cannot really comment much on it, but if you stop your users from copy + paste, what about print screen or just typing up the text manually? Regards, --Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year."
-Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer."
-Fred BrooksWhile typing this thread I was also thinking that if I stop users from copy + paste, still they can use print screen or just they can type up the text manually. So I thought there could be some solution for it.
Kiran Sajanikar Software Engineer Pune, India
-
While typing this thread I was also thinking that if I stop users from copy + paste, still they can use print screen or just they can type up the text manually. So I thought there could be some solution for it.
Kiran Sajanikar Software Engineer Pune, India
What has left your network is ultimately not under your control any more. That's a fact. There will always be a way of circumvent your safety measures. Whether it's by using a cache or simply taking a photo of the screen or connecting a taperecorder to the line out. I wish this fact someday will get through to the legal peacounters in the media industry.
-
I want to block user from copying data from the page. I have used javascript that block the right click of the user so he will not able use right click menu to copy and past data. But user can still copy data by using keybord keys "Ctrl + C" to copy it. Or they can save the page from file menu. Is there any technique to stops these two things. So i can block user from copying data. Regards,
Kiran Sajanikar Software Engineer Pune, India.
Hi! There may be a way around your copy and paste shortcut problem. I'm not sure about cross-browser compatibility but try enclosing your text in paragraph tags with the UNSELECTABLE attribute set to 'On' like this:
<HTML>
<HEAD>
</HEAD>
<BODY>
<P UNSELECTABLE="On">
Test Paragraph
</P>
</BODY>
</HTML>(Tested in IE 8 But it will probably work on earlier versions too) Of course people will be able to get around this in some way or another but hey, it can't hurt can it? Hope This Helps! MrWolfy :-D
-
While typing this thread I was also thinking that if I stop users from copy + paste, still they can use print screen or just they can type up the text manually. So I thought there could be some solution for it.
Kiran Sajanikar Software Engineer Pune, India
-
Hi! There may be a way around your copy and paste shortcut problem. I'm not sure about cross-browser compatibility but try enclosing your text in paragraph tags with the UNSELECTABLE attribute set to 'On' like this:
<HTML>
<HEAD>
</HEAD>
<BODY>
<P UNSELECTABLE="On">
Test Paragraph
</P>
</BODY>
</HTML>(Tested in IE 8 But it will probably work on earlier versions too) Of course people will be able to get around this in some way or another but hey, it can't hurt can it? Hope This Helps! MrWolfy :-D
-
I want to block user from copying data from the page. I have used javascript that block the right click of the user so he will not able use right click menu to copy and past data. But user can still copy data by using keybord keys "Ctrl + C" to copy it. Or they can save the page from file menu. Is there any technique to stops these two things. So i can block user from copying data. Regards,
Kiran Sajanikar Software Engineer Pune, India.