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

Discussion in 'Javascript' started by FAQ server, Jun 23, 2009.

  1. FAQ server

    FAQ server Guest

    -----------------------------------------------------------------------
    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.

    --

    The sendings of these daily posts are proficiently hosted
    by http://www.pair.com.
    FAQ server, Jun 23, 2009
    #1
    1. Advertising

  2. In comp.lang.javascript message <4a400cf8$0$48241$.
    dk>, Mon, 22 Jun 2009 23:00:02, FAQ server <>
    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.".

    --
    (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
    Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
    Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
    Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
    Dr J R Stockton, Jun 23, 2009
    #2
    1. Advertising

  3. Dr J R Stockton wrote:
    > In comp.lang.javascript message <4a400cf8$0$48241$.
    > dk>, Mon, 22 Jun 2009 23:00:02, FAQ server <>


    [...]

    >
    > 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
    --
    comp.lang.javascript FAQ: http://jibbering.com/faq/
    Garrett Smith, Jun 24, 2009
    #3
  4. Dr J R Stockton wrote:
    > FAQ server 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.


    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
    Thomas 'PointedEars' Lahn, Jun 24, 2009
    #4
  5. Dr J R Stockton wrote:

    > In comp.lang.javascript message <4a400cf8$0$48241$.
    > dk>, Mon, 22 Jun 2009 23:00:02, FAQ server <>
    > 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 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...

    --
    Bart
    Bart Van der Donck, Jun 24, 2009
    #5
  6. In comp.lang.javascript message <>, Wed,
    24 Jun 2009 09:07:30, Thomas 'PointedEars' Lahn <>
    posted:
    >Dr J R Stockton wrote:
    >> FAQ server 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.

    >
    >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.

    --
    (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
    Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
    Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
    Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
    Dr J R Stockton, Jun 24, 2009
    #6
  7. FAQ server wrote:
    > -----------------------------------------------------------------------
    > 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
    --
    comp.lang.javascript FAQ: http://jibbering.com/faq/
    Garrett Smith, Jun 25, 2009
    #7
  8. Dr J R Stockton wrote:
    > 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>
    Thomas 'PointedEars' Lahn, Jun 25, 2009
    #8
  9. On Thu, 25 Jun 2009 at 11:14:48, in comp.lang.javascript, Thomas
    'PointedEars' Lahn wrote:

    <snip>
    >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.


    What has appendix B or C got to do with it ? Do tell us.

    John
    --
    John Harris
    John G Harris, Jun 25, 2009
    #9
  10. In comp.lang.javascript message <>, Thu,
    25 Jun 2009 11:14:48, Thomas 'PointedEars' Lahn <>
    posted:
    >Dr J R Stockton wrote:
    >> 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.

    --
    (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
    Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
    Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
    Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
    Dr J R Stockton, Jun 25, 2009
    #10
  11. In comp.lang.javascript message <h1ups4$eb3$-
    september.org>, Wed, 24 Jun 2009 20:10:56, Garrett Smith
    <> posted:
    >FAQ server wrote:
    >> -----------------------------------------------------------------------
    >> 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/f
    >>aq/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.



    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".

    --
    (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
    Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
    Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
    Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
    Dr J R Stockton, Jun 25, 2009
    #11
  12. Dr J R Stockton wrote:
    > Thomas 'PointedEars' Lahn posted:
    >> Dr J R Stockton wrote:
    >>> 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
    Thomas 'PointedEars' Lahn, Jun 26, 2009
    #12
  13. FAQ server

    Jorge Guest

    On Jun 26, 11:00 am, Thomas 'PointedEars' Lahn <>
    wrote:
    > Dr J R Stockton wrote:
    > (...)
    >
    > > 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?


    Are you extra-ordinary, perhaps ?

    --
    Jorge.
    Jorge, Jun 26, 2009
    #13
  14. Jorge wrote:
    > On Jun 26, 11:00 am, Thomas 'PointedEars' Lahn <>
    > wrote:
    >> Dr J R Stockton wrote:
    >> (...)
    >>
    >>> 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?

    >
    > Are you extra-ordinary, perhaps ?
    >
    > --
    > Jorge.

    ABnormal certainly. But, who isn't?
    The Natural Philosopher, Jun 26, 2009
    #14
  15. Dr J R Stockton wrote:
    > "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
    Thomas 'PointedEars' Lahn, Jun 26, 2009
    #15
  16. In comp.lang.javascript message <>, Fri, 26
    Jun 2009 13:59:54, Thomas 'PointedEars' Lahn <>
    posted:
    >Dr J R Stockton wrote:
    >> "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.


    >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.

    --
    (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
    Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
    Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
    Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
    Dr J R Stockton, Jun 26, 2009
    #16
  17. Dr J R Stockton wrote:
    > Thomas 'PointedEars' Lahn posted:
    >> Dr J R Stockton wrote:
    >>> "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.

    >
    >> 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.


    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/browser-market-share.aspx?qprid=1&qpdt=1&qpct=4&qptimeframe=M&qpsp=101&qpnp=25>
    <http://marketshare.hitslink.com/browser-market-share.aspx?qprid=3>

    > 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
    Thomas 'PointedEars' Lahn, Jun 27, 2009
    #17
  18. Dr J R Stockton wrote:
    > In comp.lang.javascript message <>, Fri, 26
    > Jun 2009 13:59:54, Thomas 'PointedEars' Lahn <>
    > posted:
    >> Dr J R Stockton wrote:
    >>> "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.

    >
    >> 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.
    >


    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

    > 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.
    >



    --
    comp.lang.javascript FAQ: http://jibbering.com/faq/
    Garrett Smith, Jun 27, 2009
    #18
  19. In comp.lang.javascript message <h267ad$hpq$>, Sat,
    27 Jun 2009 15:43:24, Garrett Smith <> posted:

    >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.

    --
    (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
    Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
    Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
    Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
    Dr J R Stockton, Jun 28, 2009
    #19
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. FAQ server
    Replies:
    0
    Views:
    76
    FAQ server
    Sep 9, 2006
  2. FAQ server
    Replies:
    0
    Views:
    91
    FAQ server
    Nov 6, 2006
  3. FAQ server
    Replies:
    0
    Views:
    61
    FAQ server
    Aug 22, 2009
  4. FAQ server
    Replies:
    9
    Views:
    83
    Garrett Smith
    Oct 20, 2009
  5. FAQ server
    Replies:
    2
    Views:
    62
    Garrett Smith
    Dec 18, 2009
Loading...

Share This Page