Disabling right click without annoying popup

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dukeleto

    Disabling right click without annoying popup

    I know this is an annoying thing on some sites.

    I have set some images in an online gallery to have their own java po
    up window that is set to be the same size as the image.

    I would like to set ONLY the pop up window so it does not allow th
    user to right click.

    Now I did a search, and found some options, but when you right click
    it gives the user an annoying pop up saying stuff like "you cant d
    this".

    I have seen a site recently where nothing came up at all, but the righ
    click was disabled.

    If anyone knows how to do this, please let me know.

    Cheers,

    Jason
    -
    dukelet

  • Lasse Reichstein Nielsen

    #2
    Re: Disabling right click without annoying popup

    dukeleto <dukeleto.19pa7 6@mail.forum4de signers.com> writes:
    [color=blue]
    > I know this is an annoying thing on some sites.[/color]

    Yes, and luckily some browsers ignore it completely. Mine included :)
    [color=blue]
    > I have set some images in an online gallery to have their own java pop
    > up window that is set to be the same size as the image.[/color]

    JavaScript(!), not Java. Two different things.
    [color=blue]
    > I would like to set ONLY the pop up window so it does not allow the
    > user to right click.[/color]

    If the window contains an HTML document, then you can just add an
    oncontextmenu handler to the img element:
    <img ... oncontextmenu=" return false;">
    If it just contains the image, then I am not sure you can do anything.
    [color=blue]
    > Now I did a search, and found some options, but when you right click,
    > it gives the user an annoying pop up saying stuff like "you cant do
    > this".[/color]

    A good sign that whoever made it doesn't know what he is doing. Most
    of these scripts use the "original" right click action that just
    opens an alert. It can be bypassed simply by holding the right button
    down and dismissing the alert with the keyboard. :)
    [color=blue]
    > I have seen a site recently where nothing came up at all, but the right
    > click was disabled.[/color]

    Use the oncontextmenu=" return false" attribute on the elements where
    you want to disable the context menu. Don't do it on the entire page,
    there is no need for that. And know that My browser and I don't care :)

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • kaeli

      #3
      Re: Disabling right click without annoying popup

      In article <6fe73b52dd53fe c8b89be5b584838 a01@news.thenew sgroups.com>,
      dukeleto.19pa76 @mail.forum4des igners.com enlightened us with...[color=blue]
      >
      > I would like to set ONLY the pop up window so it does not allow the
      > user to right click.
      >[/color]

      *laughs*

      I don't know why you think you need it, since I can get it back really
      easily, but if you're dying for it...

      <body onLoad="documen t.oncontextmenu = function(){retu rn false}">

      Works in most browsers in use these days. Last I checked, Opera has no
      way to disable this. If you care about NN4, you'll need something a
      little more complicated.

      Note that this violates the guidelines for accessibility for the
      disabled.

      This will not prevent:
      Getting the image from the cache.
      Screen capture.
      Drag and drop the image into an image editor.
      Disable javascript and reload popup with F5.

      If I want your image, it's mine unless you really go to extremes with
      password protected directories that won't show the full image without a
      user name and password (once I DO see it, it's also mine).
      Don't want me to have it? Watermark it in an obvious place so I don't
      want it. I can remove digital watermarks in about 3 seconds. You have to
      use a real one that obscures the image and renders it undesirable.

      --
      --
      ~kaeli~
      It was recently discovered that research causes cancer in
      rats.



      Comment

      • Lasse Reichstein Nielsen

        #4
        Re: Disabling right click without annoying popup

        kaeli <tiny_one@NOSPA M.comcast.net> writes:
        [color=blue]
        > Last I checked, Opera has no way to disable this.[/color]

        It can be disabled by canceliing the appropriate mouse events, but
        catching right clicks has to be enabled. It is disabled as default.

        /L
        --
        Lasse Reichstein Nielsen - lrn@hotpop.com
        DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
        'Faith without judgement merely degrades the spirit divine.'

        Comment

        • David Dorward

          #5
          Re: Disabling right click without annoying popup

          dukeleto wrote:
          [color=blue]
          > I know this is an annoying thing on some sites.[/color]

          On *all* sites that implement it.
          [color=blue]
          > I would like to set ONLY the pop up window so it does not allow the
          > user to right click.[/color]

          You can't. Most browsers have options to prevent sites from interfering with
          the context menu these days, and for those which don't you'll just confuse
          a lot of users.

          What do you hope to achieve anyway? Prevent people from saving the image?
          Its already in the browser cache, is available by viewing source code,
          available by turning JavaScript off, available through the many
          bookmarklets which unblock context menu blockers, and the most simple
          option is still there - drag and dropping the image somewhere.

          --
          David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
          Home is where the ~/.bashrc is

          Comment

          • kaeli

            #6
            Re: Disabling right click without annoying popup

            In article <fz7mek8m.fsf@h otpop.com>, lrn@hotpop.com enlightened us
            with...[color=blue]
            > kaeli <tiny_one@NOSPA M.comcast.net> writes:
            >[color=green]
            > > Last I checked, Opera has no way to disable this.[/color]
            >
            > It can be disabled by canceliing the appropriate mouse events, but
            > catching right clicks has to be enabled. It is disabled as default.
            >[/color]

            Ah, gotcha.
            I left mine that way. :)


            --
            --
            ~kaeli~
            If at first you don't succeed, skydiving is not for you.



            Comment

            • Andrew Thompson

              #7
              Re: Disabling right click without annoying popup

              On Tue, 20 Jul 2004 15:17:10 GMT, dukeleto wrote:
              [color=blue]
              > I would like to set ONLY the pop up window so it does not allow the
              > user to right click.[/color]

              Huh! Is that a way to get pics from web-pages?

              I usually just D'n'D 'em to the desktop,
              ...if they're any good! ;-)

              --
              Andrew Thompson
              http://www.PhySci.org/ Open-source software suite
              http://www.PhySci.org/codes/ Web & IT Help
              http://www.1point1C.org/ Science & Technology

              Comment

              • Paul Cooper

                #8
                Re: Disabling right click without annoying popup

                On Tue, 20 Jul 2004 11:01:54 -0500, kaeli
                <tiny_one@NOSPA M.comcast.net> wrote:
                [color=blue]
                >Note that this violates the guidelines for accessibility for the
                >disabled.
                >[/color]

                You might like to note that according to an official from the UK
                eGovernment initiative (AFAIR run by the Office of the Deputy Prime
                Minister), failing to comply with W3C WAI rules is illegal in the UK.
                There has been no case law as yet, but it is worth bearing in mind
                that the Government thinks that the guidance it has given (to adhere
                to WAI) has the force of law, and I presume that if the courts decided
                otherwise they'd bring in legislation to enforce it. It wouldn't
                surprise me if the current problems with the "Odeon" web-site
                developed into a test case.

                Paul

                Comment

                • Richard Cornford

                  #9
                  Re: Disabling right click without annoying popup

                  Paul Cooper wrote:[color=blue]
                  > kaeli wrote:
                  >[color=green]
                  >>Note that this violates the guidelines for accessibility
                  >>for the disabled.[/color]
                  >
                  > You might like to note that according to an official from the
                  > UK eGovernment initiative (AFAIR run by the Office of the
                  > Deputy Prime Minister), failing to comply with W3C WAI rules
                  > is illegal in the UK.[/color]
                  <snip>

                  WAI "rules" take the form of guidelines and some of those guidelines are
                  extremely subjective. e.g.:-

                  <quote cite="Web Content Accessibility Guidelines 1.0">
                  Checkpoints:
                  14.1 Use the clearest and simplest language appropriate for
                  a site's content. [Priority 1]
                  </quote>

                  Simplicity and appropriateness would be difficult to measure. Some
                  automated measure of simplicity might be available:-

                  <quote cite="http://www.w3.org/TR/WCAG10-CORE-TECHS/#comprehension" >
                  To help determine whether your document is easy to read, consider using
                  the Gunning-Fog reading measure (described in [SPOOL] with examples and
                  the algorithm online at [TECHHEAD]). This algorithm generally produces a
                  lower score when content is easier to read. As example results, the
                  Bible, Shakespeare, Mark Twain, and TV Guide all have Fog indexes of
                  about 6. Time, Newsweek, and the Wall St. Journal an average Fog index
                  of about 11.
                  </snip>

                  - but the fact that these figures have grouped the Bible, Shakespeare,
                  and TV Guide highlights the problem of appropriateness (TV Guide in the
                  style of Shakespeare; maybe simple, but far from appropriate).

                  If the WAI cannot lay down hard and fast rules (and they are far too
                  realistic to believe that they can effectively do that in many cases)
                  then the UK government cannot require that those "rules" be followed as
                  such.

                  My interpretation of the (UK) DDA, especially; PART III - DISCRIMINATION
                  IN OTHER AREAS: 19(3)(c) "access to and use of information services"
                  (19(3). 'examples of services to which ... apply'), is that the act is
                  intended to apply to web sites (commercial and otherwise - 19(2)(c) "it
                  is irrelevant whether a service is provided on payment or without
                  payment"). And following WCAG 1.0 (with a reasonable interpretation of
                  the more ambiguous/subjective parts) should satisfy the requirements of
                  the act.

                  Richard.


                  Comment

                  • kaeli

                    #10
                    Re: Disabling right click without annoying popup

                    In article <dl8sf0dlas8g6q sthl56731ih9589 5m2dt@4ax.com>,
                    paul.cooper@Nob asspam.ac.uk enlightened us with...[color=blue]
                    >
                    > You might like to note that according to an official from the UK
                    > eGovernment initiative (AFAIR run by the Office of the Deputy Prime
                    > Minister), failing to comply with W3C WAI rules is illegal in the UK.
                    > There has been no case law as yet, but it is worth bearing in mind
                    > that the Government thinks that the guidance it has given (to adhere
                    > to WAI) has the force of law, and I presume that if the courts decided
                    > otherwise they'd bring in legislation to enforce it. It wouldn't
                    > surprise me if the current problems with the "Odeon" web-site
                    > developed into a test case.
                    >[/color]


                    I live in the States, but I'm curious - do you know if the UK law
                    applies to:
                    1. personal (non-business, owned by private citizens) pages with .uk
                    domains?
                    2. any pages outside .uk domains?

                    If yes to 2, how could they possibly hope to enforce it? They'd be out
                    of their jurisdiction, wouldn't they?

                    Just wondering.

                    This might be worth noting on my site when I put up scripts that don't
                    meet the guidelines.
                    IIRC, anything that disables the contextmenu is bad and anything that
                    does something with mouse events must also do it for key events, right?

                    --
                    --
                    ~kaeli~
                    What do they use to ship styrofoam?



                    Comment

                    • Paul Cooper

                      #11
                      Re: Disabling right click without annoying popup

                      On Wed, 21 Jul 2004 07:55:42 -0500, kaeli
                      <tiny_one@NOSPA M.comcast.net> wrote:
                      [color=blue]
                      >In article <dl8sf0dlas8g6q sthl56731ih9589 5m2dt@4ax.com>,
                      >paul.cooper@No basspam.ac.uk enlightened us with...[color=green]
                      >>
                      >> You might like to note that according to an official from the UK
                      >> eGovernment initiative (AFAIR run by the Office of the Deputy Prime
                      >> Minister), failing to comply with W3C WAI rules is illegal in the UK.
                      >> There has been no case law as yet, but it is worth bearing in mind
                      >> that the Government thinks that the guidance it has given (to adhere
                      >> to WAI) has the force of law, and I presume that if the courts decided
                      >> otherwise they'd bring in legislation to enforce it. It wouldn't
                      >> surprise me if the current problems with the "Odeon" web-site
                      >> developed into a test case.
                      >>[/color]
                      >
                      >
                      >I live in the States, but I'm curious - do you know if the UK law
                      >applies to:
                      >1. personal (non-business, owned by private citizens) pages with .uk
                      >domains?
                      >2. any pages outside .uk domains?
                      >
                      >If yes to 2, how could they possibly hope to enforce it? They'd be out
                      >of their jurisdiction, wouldn't they?
                      >
                      >Just wondering.
                      >
                      >This might be worth noting on my site when I put up scripts that don't
                      >meet the guidelines.
                      >IIRC, anything that disables the contextmenu is bad and anything that
                      >does something with mouse events must also do it for key events, right?
                      >
                      >--[/color]


                      As far as I am aware (and I am very aware I am not an expert in this
                      field) it applies to any web page that is providing a service, whether
                      paid for or not. Of course, it only applies to pages hosted in the UK,
                      but similar rules apply over the whole EC. The principle is that
                      information or services available to an able bodied person _must_ also
                      be available to disabled persons. I think the basic context is that of
                      Human Rights. This is easy enough to comply with in some contexts -
                      for example, all images should have ALT text describing the
                      information content of the image. In others (and I was at a meeting of
                      mapping and GIS people!) it is clearly very difficult.

                      The person who gave the presentation suggested there were three levels
                      of compliance with the WAI - one "A" which about 70-80% of sites
                      manage, 2 "A", which about 20% of sites manage and 3 "A" which almost
                      none manage. His opinion was that the level to strive for was 2 "A". I
                      don't know if that is meaningful to persons who know the WAI better
                      than I.

                      If I understood the context properly, there was also a
                      "reasonableness " judgement. For example, it is unreasonable to ask
                      that a general location map be made accessible to a blind person -
                      there is no generally available technology that a blind person could
                      use to "visualize" the map - even the idea of visualization may be
                      foreign to a person blind from birth. However, the web-site should
                      make available (for example) directions from public transport nodes to
                      the place located by the map. And sites which (for example) show the
                      nearest hotels to your location should have this information available
                      in forms accessible to screen-readers. I did ask how you were expected
                      to make (say) the "Eroica" Symphony accessible to a profoundly deaf
                      person and got a wry answer!

                      Paul

                      Comment

                      • kaeli

                        #12
                        W3C WAI rules (was Re: Disabling right click without annoying popup)

                        In article <g2ssf0pehmnfbv 31u5t6fqdk5hgme lrbv6@4ax.com>,
                        paul.cooper@Nob asspam.ac.uk enlightened us with...[color=blue]
                        > As far as I am aware (and I am very aware I am not an expert in this
                        > field) it applies to any web page that is providing a service, whether
                        > paid for or not.[/color]

                        But don't ALL pages provide a "service", even if that service is just to
                        inform or entertain?
                        How might they define "service"?
                        [color=blue]
                        >
                        > If I understood the context properly, there was also a
                        > "reasonableness " judgement.[/color]

                        This makes sense, but would be hard to make concrete.

                        Thanks for the info.

                        --
                        --
                        ~kaeli~
                        Those who jump off a bridge in Paris... are in Seine.



                        Comment

                        • Paul Cooper

                          #13
                          Re: W3C WAI rules (was Re: Disabling right click without annoying popup)

                          On Wed, 21 Jul 2004 09:13:19 -0500, kaeli
                          <tiny_one@NOSPA M.comcast.net> wrote:
                          [color=blue]
                          >In article <g2ssf0pehmnfbv 31u5t6fqdk5hgme lrbv6@4ax.com>,
                          >paul.cooper@No basspam.ac.uk enlightened us with...[color=green]
                          >> As far as I am aware (and I am very aware I am not an expert in this
                          >> field) it applies to any web page that is providing a service, whether
                          >> paid for or not.[/color]
                          >
                          >But don't ALL pages provide a "service", even if that service is just to
                          >inform or entertain?
                          >How might they define "service"?
                          >[color=green]
                          >>
                          >> If I understood the context properly, there was also a
                          >> "reasonableness " judgement.[/color]
                          >
                          >This makes sense, but would be hard to make concrete.
                          >
                          >Thanks for the info.
                          >
                          >--[/color]

                          Agree to both points! Which is why this is regarded as such a big deal
                          by corporate web-masters over here. It is, of course, very unlikely
                          that someone running a small personal set of pages would be bothered.
                          However, it is a big deal for government web-sites, or for large
                          corporations.

                          Paul

                          Comment

                          • Richard Cornford

                            #14
                            Re: W3C WAI rules (was Re: Disabling right click without annoying popup)

                            kaeli wrote:[color=blue]
                            > paul.cooper@Nob asspam.ac.uk wrote:[color=green]
                            >> As far as I am aware (and I am very aware I am not an expert in this
                            >> field) it applies to any web page that is providing a service,
                            >> whether paid for or not.[/color]
                            >
                            > But don't ALL pages provide a "service", even if that
                            > service is just to inform or entertain?
                            > How might they define "service"?[/color]

                            Information and entertainment are explicitly covered:-

                            <quote cite="(UK) DDA, PART III-DISCRIMINATION IN OTHER AREAS">
                            19.Discriminati on in relation to goods, facilities and services.
                            ....
                            (2) For the purposes of this section and sections 20 and 21-

                            (a) the provision of services includes the provision of any goods
                            or facilities;

                            (b) a person is "a provider of services" if he is concerned with
                            the provision, in the United Kingdom, of services to the
                            public or to a section of the public; and

                            (c) it is irrelevant whether a service is provided on payment or
                            without payment.

                            (3) The following are examples of services to which this section and
                            sections 20 and 21 apply-

                            (a) access to and use of any place which members of the public
                            are permitted to enter;

                            (b) access to and use of means of communication;

                            (c) access to and use of information services;

                            (d) accommodation in a hotel, boarding house or other similar
                            establishment;

                            (e) facilities by way of banking or insurance or for grants,
                            loans, credit or finance;

                            (f) facilities for entertainment, recreation or refreshment;

                            (g) facilities provided by employment agencies or under section
                            2 of the Employment and Training Act 1973;

                            (h) the services of any profession or trade, or any local or
                            other public authority.
                            ....
                            </quote>
                            [color=blue][color=green]
                            >> If I understood the context properly, there was also a
                            >> "reasonableness " judgement.[/color]
                            >
                            > This makes sense, but would be hard to make concrete.[/color]

                            Reasonableness is always subject to interpretation, but there is also a
                            criteria of expense (equally unclear):-

                            <quote cite="(UK) DDA, PART III-DISCRIMINATION IN OTHER AREAS">
                            21.Duty of providers of services to make adjustments. -

                            (1) Where a provider of services has a practice, policy or procedure
                            which makes it impossible or unreasonably difficult for disabled
                            persons to make use of a service which he provides, or is
                            prepared to provide, to other members of the public, it is his
                            duty to take such steps as it is reasonable, in all the
                            circumstances of the case, for him to have to take in order to
                            change that practice, policy or procedure so that it no longer
                            has that effect.

                            ....

                            (4) Where an auxiliary aid or service (for example, the provision of
                            information on audio tape or of a sign language interpreter) would-

                            (a) enable disabled persons to make use of a service which a
                            provider of services provides, or is prepared to provide,
                            to members of the public, or

                            (b) facilitate the use by disabled persons of such a service,

                            it is the duty of the provider of that service to take such steps
                            as it is reasonable, in all the circumstances of the case, for
                            him to have to take in order to provide that auxiliary aid or
                            service.

                            (5) Regulations may make provision, for the purposes of this section-

                            (a) as to circumstances in which it is reasonable for a provider
                            of services to have to take steps of a prescribed description;

                            (b) as to circumstances in which it is not reasonable for a
                            provider of services to have to take steps of a prescribed
                            description;

                            (c) as to what is to be included within the meaning of "practice,
                            policy or procedure";

                            (d) as to what is not to be included within the meaning of that
                            expression;

                            (e) as to things which are to be treated as physical features;

                            (f) as to things which are not to be treated as such features;

                            (g) as to things which are to be treated as auxiliary aids or
                            services;

                            (h) as to things which are not to be treated as auxiliary aids
                            or services.

                            (6) Nothing in this section requires a provider of services to take
                            any steps which would fundamentally alter the nature of the
                            service in question or the nature of his trade, profession or
                            business.

                            (7) Nothing in this section requires a provider of services to take
                            any steps which would cause him to incur expenditure exceeding
                            the prescribed maximum.

                            (8) Regulations under subsection (7) may provide for the prescribed
                            maximum to be calculated by reference to-

                            (a) aggregate amounts of expenditure incurred in relation to
                            different cases;

                            (b) prescribed periods;

                            (c) services of a prescribed description;

                            (d) premises of a prescribed description; or

                            (e) such other criteria as may be prescribed.

                            (9) Regulations may provide, for the purposes of subsection (7),
                            for expenditure incurred by one provider of services to be
                            treated as incurred by another.

                            (10) This section imposes duties only for the purpose of determining
                            whether a provider of services has discriminated against a
                            disabled person; and accordingly a breach of any such duty is
                            not actionable as such.
                            </quote>

                            Richard.


                            Comment

                            • kaeli

                              #15
                              Re: W3C WAI rules (was Re: Disabling right click without annoying popup)

                              In article <cdm1ou$nr7$1$8 302bc10@news.de mon.co.uk>,
                              Richard@litotes .demon.co.uk enlightened us with...[color=blue]
                              >
                              > <quote cite="(UK) DDA, PART III-DISCRIMINATION IN OTHER AREAS">[/color]

                              Do you have the URL handy to this site, assuming it is online?
                              I'd like to look over the whole thing.

                              Thanks!

                              --
                              --
                              ~kaeli~
                              A little rudeness and disrespect can elevate a meaningless
                              interaction to a battle of wills and add drama to an
                              otherwise dull day.



                              Comment

                              Working...