[thelist] How did they do this?

Ken Snyder ksnyder at coremr.com
Sun Mar 25 23:00:08 CDT 2007

alan herrell - the head lemur wrote:
> from time to time on this list is the question of hiding content and or 
> the source code. As most of us know this has been a futile undertaking 
> for just about any HTML and even other file and media types.
> So did somebody actually find a way to show stuff without exposing the code?
> I direct your attention here:
> http://www.samsungsupport.com/cyber/recall/e/m_step_1e.jsp
> or has technology just passed me by?
Yikes! HTML coding gone amok.

To disable right click they are using:

<body ... oncontextmenu="return false">

They could have also used a Javascript function that captured 
document.onmousedown and tested for a right click.

To disable page reload and opening a new window (F5, Ctrl+R, and 
Ctrl+N), they use:

function noEvent() {
  // 116 -> F5
  // 82  -> R
  // 78  -> N
  if (event.keyCode == 116) {
    event.keyCode = 2;
    return false;
  else if (event.ctrlKey && (event.keyCode == 78 || event.keyCode == 82)) {
    return false;
document.onkeydown = noEvent;

The Web Developer Toolbar for Firefox is really useful for digging into 
these sort of things:  https://addons.mozilla.org/en-US/firefox/addon/60.

Ken Snyder

More information about the thelist mailing list