"yaktipper" <> wrote in message
news: om...
<snip>
>The reason I'm posting this is that it is very difficult
>for a novice to find this information on the Net,
Then perhaps the novices actually need instruction on how to type the
words "contextmenu" and "javascript" into a search engine. 2000+ hits at
google.com, though all of the scripts are as poor as the one you posted.
That is because by the time anyone has learnt enough to do a good job of
writing a context menu blocking script they have also learnt enough to
know why doing so is a waste of their effort.
>as an immense amount of posts declare this as impossible,
No one has ever declared that using JavaScript to interfere with the UI
of a web browser is impossible, it is in fact trivial. They may have
stated that disabling the context menu on all browsers is impossible,
Opera has never allowed JavaScript to influence its contextmenu.
But more likely it is the goal that disabling the context menu is
intended to promote that is being described as impossible. That goal is
usually the concealing, protecting or obscuring of some implementation
detail of a web page (source code, image files, etc.). Achieving that
goal _is_100%_impossible_ because if a publicly accessible HTTP server
sends something in response to a request then that response is available
to the receiving client, from the binary stream coming down the wire
though to the resulting files. Everything at every stage, and the HTTP
server has no way of even knowing whether the requesting software is a
web browser.
>and an equally immense amount of posts scathingly
>denounce this as the worst thing you can do to a web page.
When it can be objectively determined that disabling a contextmenu both
cannot be done reliably and will not facilitate anything beyond the
inconvenience it causes to people who want (or, in the case of some
disabilities, need) to use the contextmenu it does not seem unreasonable
to assert that doing so is a bad idea. People who have suffered at the
hands of script author's bad ideas may express there distaste with
extreme words but that may just be an indicator of how bad an idea it
is.
>This post is for those people that simply want to meet a
>customer's needs.
That depends on what the customers need is. If they are after some sort
of protection, or concealment then disabling the context menu will not
deliver it. If you cannot deliver something that is asked for it makes
more sense to say so (and why it is impossible) than have a customer
discover later that you sold them just the illusion of security and not
the real thing.
On the other hand, if the customer's "need" is to randomly inconvenience
the visitors to their web site and restrict disabled access well there
are thousands of ways of doing that, crippling the browser's UI is
barely scratching the surface.
>Even if the request is a bad idea, customers still pay the bills
If the request if for protection, concealment, security, etc., don't
fool yourself you cannot deliver, if the request is for a site that will
actively discourage visitors then fair enough, if they are willing to
pay then knock yourself out, a little work and you can probably
guarantee they get no visitors at all.
For the sake of balance, this is a javascript URL that can be bookmarked
and executed from the bookmark/favourites menu (or via drag-n-drop from
Start->Favourites if the browser has no Favourites menu available) and
will strip out the 'no contextmenu' script from the original post from
each and every frame in a frameset (or just an isolated page):-
javascript
:void(function(fram){if((fram.frames)&&( fram.frames.length >
0)){for(var c =
fram.frames.length;c--

{arguments.callee(fram.frames[c]);};};try{docume
nt.oncontextmenu = null;document.onmousedown =
null;}catch(e){;}}(window));
Richard.