SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
-
Feb 21, 2007, 09:32 #1
- Join Date
- Apr 2001
- Location
- home
- Posts
- 132
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Disable Text Selection and Print Key in IE7
I'm trying to disable the text selection and print-key functions on a couple page of my web site using the code below:
PHP Code:/***********************************************
* Disable Text Selection script-
***********************************************/
function disableSelection(target){
if (typeof target.onselectstart!="undefined") //IE route
target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
target.style.MozUserSelect="none"
else //All other route (ie: Opera)
target.onmousedown=function(){return false}
target.style.cursor = "default"
}
/***********************************************
* Disable Print Screen
***********************************************/
function do_err()
{
return true
}
onerror=do_err;
function no_cp()
{
clipboardData.clearData();setTimeout("no_cp()",100)
}
no_cp();
It works great, except that in IE7, the user is constantly prompted with a message asking if you want to allow the clipboard to copy content, etc., and depending on what you answer, you can actually get around the scripts.
Does anyone know of a work-around, or code adjustment that would work in IE7?
-
Feb 21, 2007, 09:42 #2
Nothing you do will solve 100% of the problem. Worst case scenario I can disable Javascript and have access to whatever I want, or I can hit View Source and take whatever content I want in HTML format.
Also, screenshots don't go to the clipboard on every platform. Mac OS X for example saves it directly to a file on the desktop, making your no-print-screen script futile.
Why do you need to protect this content so badly, yet are willing to put it on the internet for everyone to see? Seems like a contradiction there; either your data's too important to put out publicly or you need it out there so much that you shouldn't worry about a few wayward copy/pastes.
-
Feb 21, 2007, 09:49 #3
- Join Date
- Apr 2001
- Location
- home
- Posts
- 132
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I have a Knowledgebase consisting of over 600 articles, many of which I hand typed in. One of my competitors, copied and pasted each article into their own Knowledgebase.
While I want to make the content available for people who need it, I also don't want people to just freely steal it at the same time.
I realize that there is no way to completely prevent that from happening, but I would like to try and make it as difficult as possible, especially considering that my competitor, and many others out there, aren't the brightest bulbs in the light fixture when it comes to disabling JavaScript, and getting around stuff like that.
I'd rather make it difficult for them to copy and paste 600+ articles rather than leave the door completely wide open.
-
Feb 21, 2007, 10:15 #4
You're trying to solve a legal problem with technology. It may stall the problem for a while but it won't ever stop it.
I suggest you contact a lawyer about the copyright infringement your competitors are doing to you rather than spending more time on Javascript solutions that in the end won't work if your competitor is determined enough.
-
Feb 21, 2007, 10:26 #5
- Join Date
- Jun 2006
- Posts
- 16
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I don't think anyone is gonna copy and past a thousand articles manually. It will always be done by a program made for the purpose (i.e. wget), that doesn't even understand javascript.
The best way is just keeping a copyright notice at every page and sending DMCAs to hosting providers of copycats.
Bookmarks