Yesterday I had a chat with a taxi driver and upon mentioning that I am a programmer, he told me that a couple of days earlier he had experienced the following: upon trying to c
For one, there is the rightclick
event. This is easy to catch and react on.
There also is the more general contextmenu
event, but it does not apply to browsers other than IE.
I guess that they simply prevented the right click on links, based on the assumption that no-one right-clicks on a link for any other reason than copying it. So he did not even get as far as selecting "copy link" from the context menu, the message just appeared immediately.
There are keyboard-based methods of opening the context menu, and I expect they still would have worked.
The simplest jQuery implementation of this behavior is a three-liner:
$("a").rightclick(function () {
alert("Please don't copy our links!"); return false;
});
As for "preventing copy from the address bar" - no way. They could not possibly have done this.