Precluding the Downloading of Pictures

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Doug van Vianen

    Precluding the Downloading of Pictures

    Hi,

    Is there some way in JavaScript to stop the downloading of pictures from a
    web page?

    Thank you.

    Doug van Vianen


  • Thomas 'PointedEars' Lahn

    #2
    Re: Precluding the Downloading of Pictures

    Doug van Vianen wrote:
    [color=blue]
    > Is there some way in JavaScript to stop the downloading of pictures from a
    > web page?[/color]

    No. Why do you ask?


    PointedEars

    Comment

    • Randy Webb

      #3
      Re: Precluding the Downloading of Pictures

      Thomas 'PointedEars' Lahn said the following on 1/12/2006 3:01 PM:[color=blue]
      > Doug van Vianen wrote:
      >
      >[color=green]
      >>Is there some way in JavaScript to stop the downloading of pictures from a
      >>web page?[/color]
      >
      >
      > No.[/color]

      Sure there is.

      document.locati on.href = 'someOtherPage. html';

      I bet that stops the images from loading in the previous page.

      Or, loop through the images collection and set all src properties to '';
      and it will stop downloading them.
      [color=blue]
      > Why do you ask?[/color]

      Maybe because he wanted to know?


      --
      Randy
      comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
      Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: Precluding the Downloading of Pictures

        Randy Webb wrote:
        [color=blue]
        > Thomas 'PointedEars' Lahn said the following on 1/12/2006 3:01 PM:[color=green]
        >> Doug van Vianen wrote:[color=darkred]
        >>> Is there some way in JavaScript to stop the downloading of pictures from
        >>> a web page?[/color]
        >> No.[/color]
        >
        > Sure there is.
        >
        > document.locati on.href = 'someOtherPage. html';
        >
        > I bet that stops the images from loading in the previous page.[/color]

        Sure, but if you think about it, it is highly unlikely that the OP also
        wants to stop the current document from being loaded.
        [color=blue]
        > Or, loop through the images collection and set all src properties to '';
        > and it will stop downloading them.[/color]

        You cannot reliably access the DOM tree, including the document.images
        collection, before the document has finished loading, so you cannot
        reliably prevent the images from loading.

        Which leaves us with: No. (Surprise!)


        PointedEars

        Comment

        • Randy Webb

          #5
          Re: Precluding the Downloading of Pictures

          Thomas 'PointedEars' Lahn said the following on 1/12/2006 3:54 PM:[color=blue]
          > Randy Webb wrote:
          >
          >[color=green]
          >>Thomas 'PointedEars' Lahn said the following on 1/12/2006 3:01 PM:
          >>[color=darkred]
          >>>Doug van Vianen wrote:
          >>>
          >>>>Is there some way in JavaScript to stop the downloading of pictures from
          >>>>a web page?
          >>>
          >>>No.[/color]
          >>
          >>Sure there is.
          >>
          >>document.loca tion.href = 'someOtherPage. html';
          >>
          >>I bet that stops the images from loading in the previous page.[/color]
          >
          >
          > Sure, but if you think about it, it is highly unlikely that the OP also
          > wants to stop the current document from being loaded.[/color]

          Not my decision to make. The question was asked if you could stop the
          images from loading, you said No. I proved you wrong. Now, take it like
          a man and move on.
          [color=blue]
          >[color=green]
          >>Or, loop through the images collection and set all src properties to '';
          >>and it will stop downloading them.[/color]
          >
          >
          > You cannot reliably access the DOM tree, including the document.images
          > collection, before the document has finished loading, so you cannot
          > reliably prevent the images from loading.[/color]

          Put it at the end of the document, do not use the onload. You should
          test stuff before you babble your crap.
          [color=blue]
          > Which leaves us with: No. (Surprise!)[/color]

          Yes I can, you just don't realize it.

          Now, open a page with 200,000 image tags in it. Hit the STOP button on
          the browser. Then come babble to me some more.

          --
          Randy
          comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
          Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

          Comment

          • Thomas 'PointedEars' Lahn

            #6
            Re: Precluding the Downloading of Pictures

            Randy Webb wrote:
            [color=blue]
            > Thomas 'PointedEars' Lahn said the following on 1/12/2006 3:54 PM:[color=green]
            >> Randy Webb wrote:[color=darkred]
            >>> Thomas 'PointedEars' Lahn said the following on 1/12/2006 3:01 PM:
            >>>> Doug van Vianen wrote:
            >>>>> Is there some way in JavaScript to stop the downloading of pictures
            >>>>> from a web page?
            >>>> No.
            >>> Sure there is.
            >>>
            >>> document.locati on.href = 'someOtherPage. html';
            >>>
            >>> I bet that stops the images from loading in the previous page.[/color]
            >> Sure, but if you think about it, it is highly unlikely that the OP also
            >> wants to stop the current document from being loaded.[/color]
            >
            > Not my decision to make.[/color]

            Providing nonsensical "solutions" such as this is not going to help anyone.
            But then I doubt that was your intention; you are merely trolling here,
            again. Can't you find some nice bag around to work out your aggressions?
            [color=blue]
            > The question was asked if you could stop the images from loading,[/color]

            Yes, it was.
            [color=blue]
            > you said No.[/color]

            Yes, I did.
            [color=blue]
            > I proved you wrong.[/color]

            No, you did not. You talked about something that has a low probability of
            being helpful at all, and then you talked about something that is far too
            less reliable to qualify as a solution to the OP's problem.

            And *I* _proved_ *you* wrong, every time.
            [color=blue]
            > [...][color=green][color=darkred]
            >>>Or, loop through the images collection and set all src properties to '';
            >>>and it will stop downloading them.[/color]
            >> You cannot reliably access the DOM tree, including the document.images
            >> collection, before the document has finished loading, so you cannot
            >> reliably prevent the images from loading.[/color]
            >
            > Put it at the end of the document, do not use the onload. [...][/color]

            Makes no difference. Most of the images will already be loaded by then.
            [color=blue][color=green]
            >> Which leaves us with: No. (Surprise!)[/color]
            >
            > [...]
            > Now, open a page with 200,000 image tags in it. Hit the STOP button on
            > the browser. [...][/color]

            The OP asked:

            | Is there some way in JavaScript to stop the downloading of pictures
            | from a web page?

            It was not asked:

            "Is there some way to prevent pictures of a web page from being displayed?"


            HTH & HAND

            PointedEars

            Comment

            • Randy Webb

              #7
              Re: Precluding the Downloading of Pictures

              Thomas 'PointedEars' Lahn said the following on 1/12/2006 7:41 PM:[color=blue]
              > Randy Webb wrote:
              >
              >[color=green]
              >>Thomas 'PointedEars' Lahn said the following on 1/12/2006 3:54 PM:
              >>[color=darkred]
              >>>Randy Webb wrote:
              >>>
              >>>>Thomas 'PointedEars' Lahn said the following on 1/12/2006 3:01 PM:
              >>>>
              >>>>>Doug van Vianen wrote:
              >>>>>
              >>>>>>Is there some way in JavaScript to stop the downloading of pictures
              >>>>>>from a web page?
              >>>>>
              >>>>>No.
              >>>>
              >>>>Sure there is.
              >>>>
              >>>>document.lo cation.href = 'someOtherPage. html';
              >>>>
              >>>>I bet that stops the images from loading in the previous page.
              >>>
              >>>Sure, but if you think about it, it is highly unlikely that the OP also
              >>>wants to stop the current document from being loaded.[/color]
              >>
              >>Not my decision to make.[/color]
              >
              >
              > Providing nonsensical "solutions" such as this is not going to help anyone.[/color]

              I didn't offer it as a "solution". Call it a "proof of concept" as it
              shows that you can indeed stop image loading via JS. Is it realistic?
              No. But it can be done.
              [color=blue]
              > But then I doubt that was your intention; you are merely trolling here,
              > again.[/color]

              I will take that as a compliment as it is coming from you. It is typical
              of you that when you are wrong and get corrected and then proven wrong
              that you call the person who corrected you a troll.
              [color=blue][color=green]
              >>The question was asked if you could stop the images from loading,[/color]
              >
              > Yes, it was.
              >[color=green]
              >>you said No.[/color]
              >
              > Yes, I did.
              >[color=green]
              >>I proved you wrong.[/color]
              >
              >
              > No, you did not. You talked about something that has a low probability of
              > being helpful at all, and then you talked about something that is far too
              > less reliable to qualify as a solution to the OP's problem.[/color]

              Again, it was not posted as a "solution", but as a "proof of concept" to
              show you that you can indeed stop it. Once again, not realistic but
              possible.
              [color=blue]
              > And *I* _proved_ *you* wrong, every time.[/color]

              I suppose that if your definition of wrong is that you are right, then
              so be it.
              [color=blue]
              >[color=green]
              >>[...]
              >>[color=darkred]
              >>>>Or, loop through the images collection and set all src properties to '';
              >>>>and it will stop downloading them.
              >>>
              >>>You cannot reliably access the DOM tree, including the document.images
              >>>collection , before the document has finished loading, so you cannot
              >>>reliably prevent the images from loading.[/color]
              >>
              >>Put it at the end of the document, do not use the onload. [...][/color]
              >
              >
              > Makes no difference. Most of the images will already be loaded by then.[color=green]
              >>Now, open a page with 200,000 image tags in it. Hit the STOP button on
              >>the browser. [...][/color][/color]

              Given your above comment about "most of the images will already be
              loaded". Are you saying that your computer will download 200,000 images
              before the browser reads the HTML file to the end?
              [color=blue]
              >
              > The OP asked:
              >
              > | Is there some way in JavaScript to stop the downloading of pictures
              > | from a web page?
              >
              > It was not asked:
              >
              > "Is there some way to prevent pictures of a web page from being displayed?"[/color]

              And I did not answer that question. I corrected your incorrect answer.
              Even though it is not realistic to do what I said you *could* do, it is
              still technically possible and that makes your answer *WRONG*.

              HAND

              --
              Randy
              comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
              Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

              Comment

              • Doug van Vianen

                #8
                Re: Precluding the Downloading of Pictures

                Hi,

                Oh oh! Sorry I asked now.

                However, there are web sites that have web pages that do not let one
                download pictures by right clicking on them and selecting Save image as....
                I was just wondering how this was done. Maybe it was not done using
                JavaScript.

                Doug vV

                "Randy Webb" <HikksNotAtHome @aol.com> wrote in message
                news:s-ydnZtU7orYy1reR Vn-ig@comcast.com. ..[color=blue]
                > Thomas 'PointedEars' Lahn said the following on 1/12/2006 7:41 PM:[color=green]
                >> Randy Webb wrote:
                >>
                >>[color=darkred]
                >>>Thomas 'PointedEars' Lahn said the following on 1/12/2006 3:54 PM:
                >>>
                >>>>Randy Webb wrote:
                >>>>
                >>>>>Thomas 'PointedEars' Lahn said the following on 1/12/2006 3:01 PM:
                >>>>>
                >>>>>>Doug van Vianen wrote:
                >>>>>>
                >>>>>>>Is there some way in JavaScript to stop the downloading of pictures
                >>>>>>>from a web page?
                >>>>>>
                >>>>>>No.
                >>>>>
                >>>>>Sure there is.
                >>>>>
                >>>>>document.l ocation.href = 'someOtherPage. html';
                >>>>>
                >>>>>I bet that stops the images from loading in the previous page.
                >>>>
                >>>>Sure, but if you think about it, it is highly unlikely that the OP also
                >>>>wants to stop the current document from being loaded.
                >>>
                >>>Not my decision to make.[/color]
                >>
                >>
                >> Providing nonsensical "solutions" such as this is not going to help
                >> anyone.[/color]
                >
                > I didn't offer it as a "solution". Call it a "proof of concept" as it
                > shows that you can indeed stop image loading via JS. Is it realistic? No.
                > But it can be done.
                >[color=green]
                >> But then I doubt that was your intention; you are merely trolling here,
                >> again.[/color]
                >
                > I will take that as a compliment as it is coming from you. It is typical
                > of you that when you are wrong and get corrected and then proven wrong
                > that you call the person who corrected you a troll.
                >[color=green][color=darkred]
                >>>The question was asked if you could stop the images from loading,[/color]
                >>
                >> Yes, it was.
                >>[color=darkred]
                >>>you said No.[/color]
                >>
                >> Yes, I did.
                >>[color=darkred]
                >>>I proved you wrong.[/color]
                >>
                >>
                >> No, you did not. You talked about something that has a low probability
                >> of
                >> being helpful at all, and then you talked about something that is far too
                >> less reliable to qualify as a solution to the OP's problem.[/color]
                >
                > Again, it was not posted as a "solution", but as a "proof of concept" to
                > show you that you can indeed stop it. Once again, not realistic but
                > possible.
                >[color=green]
                >> And *I* _proved_ *you* wrong, every time.[/color]
                >
                > I suppose that if your definition of wrong is that you are right, then so
                > be it.
                >[color=green]
                >>[color=darkred]
                >>>[...]
                >>>
                >>>>>Or, loop through the images collection and set all src properties to
                >>>>>'';
                >>>>>and it will stop downloading them.
                >>>>
                >>>>You cannot reliably access the DOM tree, including the document.images
                >>>>collectio n, before the document has finished loading, so you cannot
                >>>>reliably prevent the images from loading.
                >>>
                >>>Put it at the end of the document, do not use the onload. [...][/color]
                >>
                >>
                >> Makes no difference. Most of the images will already be loaded by then.[color=darkred]
                >>>Now, open a page with 200,000 image tags in it. Hit the STOP button on
                >>>the browser. [...][/color][/color]
                >
                > Given your above comment about "most of the images will already be
                > loaded". Are you saying that your computer will download 200,000 images
                > before the browser reads the HTML file to the end?
                >[color=green]
                >>
                >> The OP asked:
                >>
                >> | Is there some way in JavaScript to stop the downloading of pictures
                >> | from a web page?
                >>
                >> It was not asked:
                >>
                >> "Is there some way to prevent pictures of a web page from being
                >> displayed?"[/color]
                >
                > And I did not answer that question. I corrected your incorrect answer.
                > Even though it is not realistic to do what I said you *could* do, it is
                > still technically possible and that makes your answer *WRONG*.
                >
                > HAND
                >
                > --
                > Randy
                > comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
                > Javascript Best Practices -
                > http://www.JavascriptToolbox.com/bestpractices/[/color]


                Comment

                • Thomas 'PointedEars' Lahn

                  #9
                  Re: Precluding the Downloading of Pictures

                  Doug van Vianen wrote:
                  [color=blue]
                  > Oh oh! Sorry I asked now.[/color]

                  No need for /you/ to apologize for asking. Some people on Usenet,
                  called trolls, just like to provoke others. Unfortunately, most of
                  the time Randy does not do anything else here.
                  [color=blue]
                  > However, there are web sites that have web pages that do not let one
                  > download pictures by right clicking on them and selecting Save image
                  > as.... I was just wondering how this was done. Maybe it was not done
                  > using JavaScript.[/color]

                  Ahhh -- the ambiguity of the word "download" :) What you mean refers
                  to a different kind of download than was discussed -- a _file_ download.
                  People that tried to prevent that, used client-side scripting. However,
                  you should not try to reproduce that. The main reason has already been
                  mentioned: the images are downloaded to the local cache when the document
                  is loaded (they could not be displayed otherwise), so preventing a second
                  download will not change anything. See the archives for details and
                  further cons.
                  [color=blue]
                  > [Top post][/color]

                  This /is/ a reason for you to apologize, though.


                  PointedEars

                  Comment

                  • Randy Webb

                    #10
                    Re: Precluding the Downloading of Pictures

                    Thomas 'PointedEars' Lahn said the following on 1/13/2006 2:38 PM:[color=blue]
                    >
                    > No need for /you/ to apologize for asking. Some people on Usenet,
                    > called trolls, just like to provoke others. Unfortunately, most of
                    > the time Randy does not do anything else here.[/color]

                    Another compliment from you I see. Thanks. That makes 2 and I didn't
                    even have to invoke this one other than by proving you wrong. But, that
                    is to be expected from you.

                    --
                    Randy
                    comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
                    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

                    Comment

                    • __. ___ _. __.. ___

                      #11
                      Re: Precluding the Downloading of Pictures

                      Doug van Vianen wrote:
                      [color=blue]
                      > However, there are web sites that have web pages that do
                      > not let one download pictures...[/color]

                      If they don't let you download the image file, how is your
                      browser supposed to guess what the image looks like?
                      :-)

                      If you see the image on your screen, it means that the image
                      file *has* been downloaded. You just have to know where to
                      look. The cache.

                      Comment

                      • Jason S

                        #12
                        Re: Precluding the Downloading of Pictures

                        Doug van Vianen wrote:[color=blue]
                        > However, there are web sites that have web pages that do not let one
                        > download pictures by right clicking on them and selecting Save image as....
                        > I was just wondering how this was done. Maybe it was not done using
                        > JavaScript.[/color]

                        flickr.com does this in some circumstances by using a transparent GIF,
                        I believe they have a 1pixel by 1pixel transparent GIF which they
                        resize & place on top of the image in question, so your right-clicking
                        accesses the gif and not the real image.

                        it is a hindrance but doesn't stop someone from getting the real image
                        if they really want to. (easiest way is to look at the HTML source,
                        then find the image in question, assuming it's not dynamically loaded,
                        and type in the URL into your browser)

                        in order to stop someone from saving an image Y.jpg which is displayed
                        on the screen when webpage X.htm is downloaded, you'd have to have some
                        method which closes the following "loopholes" :

                        (1) ctrl+printscree n, paste into favorite drawing application
                        (2) the manually-look-at-the-source method mentioned above
                        (3) use curl.exe (or some other non-browser application) to act
                        identically to a standard browser & access the server, download the
                        webpage X.htm (& its referenced images), and save image accordingly.

                        Some of my state's registries of deeds use a fancy Java application to
                        display images from their scanned-in archive w/o allowing any direct
                        access to images (to get around this you'd have to figure out how to
                        extract the images from whatever binary image encoding format this app
                        is using). They want you to pay $$$ in order to be able to print the
                        images in question -- but you can still use Ctrl-Printscreen to get a
                        (perhaps) lower-quality copy.

                        Comment

                        • Jasen Betts

                          #13
                          Re: Precluding the Downloading of Pictures

                          On 2006-01-13, Thomas 'PointedEars' Lahn <PointedEars@we b.de> wrote:
                          [color=blue]
                          >| Is there some way in JavaScript to stop the downloading of pictures
                          >| from a web page?
                          >
                          > It was not asked:
                          >
                          > "Is there some way to prevent pictures of a web page from being displayed?"[/color]

                          It masn't specifically asked for a way to stop people from
                          saving copies of the images that the browser has already
                          downloaded to render the web page...

                          Bye.
                          Jasen

                          Comment

                          • Jasen Betts

                            #14
                            Re: Precluding the Downloading of Pictures

                            On 2006-01-12, Doug van Vianen <courses@shaw.c a> wrote:[color=blue]
                            > Hi,
                            >
                            > Is there some way in JavaScript to stop the downloading of pictures from a
                            > web page?[/color]

                            var x,y=document.ge tElementsByTagN ame("img");
                            for( x=0;x<y.length; x++)document.wr y[x].src="";

                            --

                            Bye.
                            Jasen

                            Comment

                            • Jasen Betts

                              #15
                              Re: Precluding the Downloading of Pictures

                              On 2006-01-13, Doug van Vianen <courses@shaw.c a> wrote:[color=blue]
                              > Hi,
                              >
                              > Oh oh! Sorry I asked now.
                              >
                              > However, there are web sites that have web pages that do not let one
                              > download pictures by right clicking on them and selecting Save image as....
                              > I was just wondering how this was done. Maybe it was not done using
                              > JavaScript.
                              >[/color]

                              I think mostly it's done using CSS. the pictures are background images.
                              it doesn't stop the images from being downloaded, it only stops them from
                              being displayed.

                              --

                              Bye.
                              Jasen

                              Comment

                              Working...