Solved

How can I prevent someone from saving or copying or printing a web page

Posted on 2008-10-15
6
656 Views
Last Modified: 2012-05-05
How can I prevent someone from saving or copying or printing a web page using either ColdFusion or JavaScript?

At least I want to make it difficult for a person to steal certain content.

I've seen this done before but I don't know how it was done.

I imagine there is a way to disable these functions (saving, printing, copying)  in a browser when a person lands on certain pages.

All of my pages are .CFM.
0
Comment
Question by:bigmikey88
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 19

Assisted Solution

by:erikTsomik
erikTsomik earned 150 total points
ID: 22723103
try this to prevent copying
http://www.brownielocks.com/stopcopying.html

<SCRIPT LANGUAGE="JavaScript1.1">
<!-- Original:  Martin Webb (martin@irt.org) -->
 
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
 
<!-- Begin
function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("I'm sorry, The Right click option on your mouse has been disabled for the download window pages.");
return false;
}
return true;
}
 
document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;
//  End -->
</script>

Open in new window

0
 
LVL 5

Assisted Solution

by:gambit_642
gambit_642 earned 150 total points
ID: 22723156
Saving I'm not sure, but you can control print output using the print styles in CSS.

Print styles are style sheets used only during printing.  You can use them to hide the DIV containing the page and show a hidden div which can say something like "Printing is prohibited".

Read here:
http://www.webcredible.co.uk/user-friendly-resources/css/print-stylesheet.shtml
0
 
LVL 5

Expert Comment

by:gambit_642
ID: 22723167
erikTsomik's solution only prevents right-clicks.  You can still use the menu's and printing.
0
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 
LVL 36

Expert Comment

by:SidFishes
ID: 22723318
in a nutshell...you can't

you can make it a bit of a pain... both erik and gambit's links are good starts...

you could also have the content you want "protected" to open in a new browser window with no menus so it's harder to figure out how to print

that being said, all you have to do is turn off JS

"I imagine there is a way to disable these functions (saving, printing, copying)  in a browser " ...nope... these are independent of the browser viewport (and iun the case of IE..actually tied in to the OS...

These steps will fool grandma but anyone who really wants your stuff can get it... If you really don't want people to download or print your content...the only solution is to keep it off the web
0
 

Author Comment

by:bigmikey88
ID: 22726959


I'm hoping to make it a pain and to discourage most people from printing or copying a few pages.

But I know I can't fool everyone.

So how to I turn of JS for these few pages, and how do I turn it back on again later?

Mike
0
 
LVL 36

Accepted Solution

by:
SidFishes earned 200 total points
ID: 22727128
"how to I turn off JS"

no that's not what i meant...

your PITA measures all rely on js (no right click, no menu popup)

to circumvent that all a user needs to do is disable JS...

0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to make google charts responsive 4 49
Wordpress and Wufoo 1 38
Popup write two lines 3 22
HTML editor custom button 3 57
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question