FAQ Topic - How do I disable the right mouse button? (2009-06-23)

F

FAQ server

-----------------------------------------------------------------------
FAQ Topic - How do I disable the right mouse button?
-----------------------------------------------------------------------

The ` oncontextmenu ` is a proprietary method and is not supported on
all browsers.
` <body oncontextmenu="return false"> `


The complete comp.lang.javascript FAQ is at
http://jibbering.com/faq/index.html.
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected].
dk>, Mon, 22 Jun 2009 23:00:02, FAQ server <[email protected]>
posted:



BART :
The complete comp.lang.javascript FAQ is at
http://jibbering.com/faq/index.html.

Not the current version of the FAQ, which is at
http://www.jibbering.com/faq/index.html.

<FAQENTRY>

FAQ section 1 says

"You are reading the comp.lang.javascript meta-FAQ, version 17. It is
available on the web at http://jibbering.com/faq/ in HTML form.".

Since one can copy the FAQ (and should, if there is any chance of
wanting to read it when not connected to the Net), such a statement
cannot be reliable. Contrast with

"This is the comp.lang.javascript meta-FAQ, version 17. The latest
version is available at http://jibbering.com/faq/ in HTML form.".
 
G

Garrett Smith

Dr said:
In comp.lang.javascript message <[email protected].
dk>, Mon, 22 Jun 2009 23:00:02, FAQ server <[email protected]>
[...]


FAQ section 1 says

"You are reading the comp.lang.javascript meta-FAQ, version 17. It is
available on the web at http://jibbering.com/faq/ in HTML form.".

Since one can copy the FAQ (and should, if there is any chance of
wanting to read it when not connected to the Net), such a statement
cannot be reliable. Contrast with

"This is the comp.lang.javascript meta-FAQ, version 17. The latest
version is available at http://jibbering.com/faq/ in HTML form.".

[...]

Good point. Changed and updated.

Now to get that caching issue addressed.

Garrett
 
T

Thomas 'PointedEars' Lahn

Dr said:
FAQ server posted:

BART :


Not the current version of the FAQ, which is at
http://www.jibbering.com/faq/index.html.

Don't be ridiculous. The URIs are different, the resource is the same.

In fact, since the former works, the former should be preferred.
And the name of the index document should be stripped from the URI.


PointedEars
 
B

Bart Van der Donck

Dr said:
In comp.lang.javascript message <[email protected].
dk>, Mon, 22 Jun 2009 23:00:02, FAQ server <[email protected]>
posted:

BART :


Not the current version of the FAQ, which is at
       http://www.jibbering.com/faq/index.html.

<FAQENTRY>

FAQ section 1 says

"You are reading the comp.lang.javascript meta-FAQ, version 17.  It is
available on the web athttp://jibbering.com/faq/in HTML form.".

Since one can copy the FAQ (and should, if there is any chance of
wanting to read it when not connected to the Net), such a statement
cannot be reliable.  Contrast with

"This is the comp.lang.javascript meta-FAQ, version 17.  The latest
version is available athttp://jibbering.com/faq/in HTML form.".

The original post in this thread dates from June 23, 2009 01:00 CEST.
Since yesterday, per Garrett's email request, the footer has been
changed into:

The complete comp.lang.javascript FAQ is at
http://jibbering.com/faq/

http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/2ef769b496e52ac7

In so far I can seen, this URL is indeed identical as mentioned in
section 1. If this is not okay, it can of course be modified...
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]>, Wed,
24 Jun 2009 09:07:30 said:
Don't be ridiculous. The URIs are different, the resource is the same.

The resource was not the same. It displayed different characters.
Since Garrett is active, what is seen may have changed between when I
wrote that article and when you had read it. You should have realised
that possibility.

Just before I wrote this paragraph, those URLs gave different versions
of "Version 18, Updated June 23, 2009 by Garrett Smith". There was a
difference in wording and an apparent difference in CSS.
In fact, since the former works, the former should be preferred.
And the name of the index document should be stripped from the URI.

There will be less potential for human confusion, GS included, if the
published URL matches, as closely as it can, the file structure at
Jibbering, and if the common "www." is included.



BTW, I'm currently re-reading an interesting old book - "Step by Step" -
not to be confused with the strange title Amazon alleges was written
(posthumously?) by Enid Blyton. It reminds me of you.
 
G

Garrett Smith

FAQ said:
-----------------------------------------------------------------------
FAQ Topic - How do I disable the right mouse button?
-----------------------------------------------------------------------

The ` oncontextmenu ` is a proprietary method and is not supported on
all browsers.
` <body oncontextmenu="return false"> `


The complete comp.lang.javascript FAQ is at
http://jibbering.com/faq/index.html.
Idea:

User hardware (including the mouse) can be configured by the user but
cannot be disabled by javascript.

The |oncontextmenu| event is not widely supported and browsers that do
support it may configured to prevent scripts from accessing that event.

Example:
<body oncontextmenu="return false;">

See also:
http://msdn.microsoft.com/en-us/library/ms536914(VS.85).aspx
https://developer.mozilla.org/En/DOM/Window.oncontextmenu

Garrett
 
T

Thomas 'PointedEars' Lahn

Dr said:
Thomas 'PointedEars' Lahn posted:
In fact, since [http://jibbering.com/faq/] works, the former should be
preferred [over http://www.jibbering.com/faq/index.html].
And the name of the index document should be stripped from the URI.

There will be less potential for human confusion, GS included,

Do you mean Garrett Smith by "GS"? If yes, I seriously doubt he will be
confused. If no, who/what do you mean?
if the published URL matches, as closely as it can, the file structure
at Jibbering,

Users could not be less interested in the file structures on servers. That
includes the file name of the index document of a given path. They simply
want things to work, easy to type and to remember. In fact, in my
experience they would prefer "cljs-faq.com" (or another TLD like .net, .org)
over "jibbering.com/faq".
and if the common "www." is included.

Granted,

www.jibbering.com/faq

is probably easier to recognize as a FAQ reference by humans and parsers than

jibbering.com/faq

However, that does not apply to

http://www.jibbering.com/faq/

instead of

http://jibbering.com/faq/

See [RFC3986], Appendices B and C.


PointedEars
___________
[RFC3986] RFC 3986 "Uniform Resource Identifier (URI): Generic Syntax"
<http://tools.ietf.org/html/rfc3986>
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]>, Thu,
25 Jun 2009 11:14:48 said:
Dr said:
Thomas 'PointedEars' Lahn posted:
In fact, since [http://jibbering.com/faq/] works, the former should be
preferred [over http://www.jibbering.com/faq/index.html].
And the name of the index document should be stripped from the URI.

There will be less potential for human confusion, GS included,

Do you mean Garrett Smith by "GS"? If yes, I seriously doubt he will be
confused. If no, who/what do you mean?

Not, of course, you : just ordinary people.
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
september.org>, Wed, 24 Jun 2009 20:10:56, Garrett Smith
Idea:

User hardware (including the mouse) can be configured by the user but
cannot be disabled by javascript.

The |oncontextmenu| event is not widely supported and browsers that do
support it may configured to prevent scripts from accessing that event.


Does not answer the question. It implies, weakly, that readers will
have heard of oncontextmenu, and strongly that they know that there is
no other method.

"Some browsers implement an oncontextmenu method for this; and, in
those, it may have been configured to be not available or to have no
effect."

It is supported, AIUI, by MS IE; therefore, most browser instances in
use will have it.

Since, although the default assumption is Internet/WWW, the group
supports Intranet, the FAQ entry must be appropriately helpful for an MS
IE Intranet. If the system managers can guarantee that it has not been
disabled, then system programmers can use it.

"The ` oncontextmenu ` is a proprietary method"
is better written as
"The method ` oncontextmenu ` is proprietary".
 
T

Thomas 'PointedEars' Lahn

Dr said:
Thomas 'PointedEars' Lahn posted:
Dr said:
Thomas 'PointedEars' Lahn posted:
In fact, since [http://jibbering.com/faq/] works, the former should be
preferred [over http://www.jibbering.com/faq/index.html].
And the name of the index document should be stripped from the URI.
There will be less potential for human confusion, GS included,
Do you mean Garrett Smith by "GS"? If yes, I seriously doubt he will be
confused. If no, who/what do you mean?

Not, of course, you : just ordinary people.

Are you even incapable of answering a straightforward question
without resorting to some kind of insult, I wonder?


PointedEars
 
J

Jorge

Dr J R Stockton wrote:
(...)


Are you even incapable of answering a straightforward question
without resorting to some kind of insult, I wonder?

Are you extra-ordinary, perhaps ?
 
T

Thomas 'PointedEars' Lahn

Dr said:
"Some browsers implement an oncontextmenu method for this; and, in
those, it may have been configured to be not available or to have no
effect."

`oncontextmenu' is not merely a method, when assigned a Function object
reference to; it is an (proprietary) event-handler property. The
corresponding event should be called `contextmenu', not `oncontextmenu'
(despite the MSDN Library.)
It is supported, AIUI, by MS IE; therefore, most browser instances in
use will have it.

That is not a conclusive argument. There are still many proprietary
features in MSHTML that are not supported by other user agents. ISTM
currently it is IE that is copying from other browsers, with MS trying
hard to keep pace.

However, Mozilla/5.0 rv:1.9.0.11 Gecko/2009061212 as of Iceweasel/3.0.11
supports the `contextmenu' event type (usable with addEventListener()) and
the `oncontextmenu' event-handler property on `document' and maybe other nodes.


PointedEars
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]>, Fri, 26
That is not a conclusive argument. There are still many proprietary
features in MSHTML that are not supported by other user agents. ISTM
currently it is IE that is copying from other browsers, with MS trying
hard to keep pace.

Pooh, about 2/3 of browser usage is MS IE. Therefore, most browser
instances used will have it. Additionally, most of those who normally
use, on the PC, Firefox Safari Opera Chrome will have MSIE and may
occasionally use it.

It's rather like asking what languages Germans speak. Between them, the
total is probably in the hundreds, at least; there's probably even the
odd Welsh speaker. Nevertheless, the majority of speaking done by
Germans is in the German language.
 
T

Thomas 'PointedEars' Lahn

Dr said:
Thomas 'PointedEars' Lahn posted:


Pooh, about 2/3 of browser usage is MS IE.

By my references 64.62 to 65.50%, but you can never know how much of this is
UA-forged. However, even if we assumed these figures to be almost correct,
it could be observed that IE usage has been constantly decreasing since
several years:

<http://marketshare.hitslink.com/bro...&qpdt=1&qpct=4&qptimeframe=M&qpsp=101&qpnp=25>
Therefore, most browser instances used will have it.

Currently, maybe yes. However, it does not matter how many browser
instances, but how many different user agents there are to support the
feature. While one can go for an IE-only approach because of an assumed
current market dominance, it is hardly an approach to be taken by a
reasonable Web developer who would consider a solution as compatible as
possible if the costs can be justified. Because short-term thinking bites
you later and much more painfully in this field. I've seen it all too often
before.


PointedEars
 
G

Garrett Smith

Dr said:
In comp.lang.javascript message <[email protected]>, Fri, 26



Pooh, about 2/3 of browser usage is MS IE. Therefore, most browser
instances used will have it. Additionally, most of those who normally
use, on the PC, Firefox Safari Opera Chrome will have MSIE and may
occasionally use it.

A solution that works occasionally sounds rather haphazard. I think
introducing a new term "contextmenu event" should not be confusing. The
name contextmenu sounds like "context menu" when read aloud.

So, the slightly modified change:-

| User hardware (including the mouse) can be configured by the user but
| cannot be disabled by javascript.
|
| The |contextmenu| event is not widely supported and browsers that do
| support it may configured to prevent scripts from accessing that
| event.
|
|Example:
| <body oncontextmenu="return false;">
|
| Will disable the context menu where supported. Note that this will
| not prevent users from viewing your source code or copying images.
| To prevent copying, provide a copyright notice.
|
| See also:
| http://msdn.microsoft.com/en-us/library/ms536914(VS.85).aspx
| https://developer.mozilla.org/En/DOM/Window.oncontextmenu

Garrett
 
D

Dr J R Stockton

Sat said:
A solution that works occasionally sounds rather haphazard.

It is; and it should be clearly indicated as such. Amy positive FAQ
statement that the button can, or cannot, be disabled will lead to a
lack of confidence in the FAQ when a reader observes a contrary
situation.

So, the slightly modified change:-

| User hardware (including the mouse) can be configured by the user but may [1]
| cannot be disabled by javascript.
| The |contextmenu| event is not widely supported and browsers that do
^^^^^^^^^^^^^
You there introduce without explanation an unknown term.
| support it may configured to prevent scripts from accessing that ^?
| event.


Some browsers implement an |contextmenu| event which may be disabled as
below; those that do may be configured to prevent disabling it.
^^^^^^^^^^^^^^^^^^^^^^^

^^^ ?? Is that what it is meant to mean?


|Example:
| <body oncontextmenu="return false;">
| To prevent copying, provide a copyright notice.

Really, you should
(1) know your national law better than that
(2) recognise that applicable law varies with location
(3) recognise that the law is not always heeded

Copying of material shown on the Web cannot be prevented; showing a
copyright notice or watermarking an image may discourage it.

[1] User configuration may be limited by system policy.



This FAQ entry has a wrong subject line. Consider "Can copying of text
or images be prevented", to which the answer is, in essence "No, but it
can be variously discouraged. Reasons ...".


<body onClick="document.body.innerHTML=''"> will stop some people
copying.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top