View Full Version : Disable right click on DHTML Window widget(v1.03)

10-16-2007, 11:24 PM
1) Script Title:
DHTML Window widget (v1.03)

2) Script URL (on DD):

3) Describe problem:
Control printing of DHTML window

Firstly many thanks for this great script ! What I need to do though is to control who can print from the window by disabling the right click within the DHTML window.
I have tried putting the code into the js file but I can only get it to fire when I right click on the title bar.



10-17-2007, 03:35 AM
See #1/2/4/5.

You can't do that. For example, CTRL+P will get around it every time.

websites have limited control through javascript intentionally, which is better for the user and not good for the web designer in some sense, though really not such a big deal.

There have been a number of discussions on this type of thing, so look it up if you want to read and confirm.

10-17-2007, 04:38 AM
Hi Daniel,

I appreciate that not everything will be bulletproof and that if someone really want to print they will find a workaround.

What I am dealing with here is a non public application. For privacy reasons the users are not allowed to print certain documents. If I can open these in a DHTML window without right click functionality it will confirm to them that this is a non printable document.



10-17-2007, 05:06 AM
Assuming for the moment that this has any chance of being a good thing if we get it working for you (I have my doubts - a private data stream that isn't allowed to be printed? Why bother providing the data?), I'm wondering how you get your content into the Widget? If it's via iframe, just put the no-right click code on the page in the iframe.