How does this website know I have copied data (and how can I stop it?)

14,187

Solution 1

They are using Ajax Javascript on their webpage extensively. Ajax is capable of monitoring the clipboard.

A script can easily be made to check if the title has been copied to the clipboard and display a popup, as they did here.

To stop it, disable javascript execution of websites. Depending on your browser you may be able to stop it just on this website, but please understand that websites like this who have javascript so well buildin, will stop to function correctly. You are likely not going to be able to order on that website anymore for example.

Solution 2

Looking at the code on the page, they are using Javascript to detecty a copy method.

If you look at this link, there is a good tutorial on how to implement this function yourself.


From the article (in case the link ever becomes dead), something like this will work:

<html>
<head>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<style type="text/css">
    span{
        color:blue;
    }
</style>
</head>
<body>
  <h1>jQuery copy, paste and cut example</h1>
  <form action="#">
    <label>TextBox : </label>
    <input id="textA" type="text" size="50" 
          value="Copy, paste or cut message here" />
  </form>
  <span></span>
<script type="text/javascript">
$(document).ready(function() {
    $("#textA").bind({
        copy : function(){
            $('span').text('copy behaviour detected!');
        },
        paste : function(){
            $('span').text('paste behaviour detected!');
        },
        cut : function(){
            $('span').text('cut behaviour detected!');
        }
    });
}); 
</script>
</body>
</html>

It is worth noting that by changing the referenced object $("#textA") that the actions are bound to, you can change which elements you detect the copy of (for example, bind to a DIV, a span, a whole page etc).

You can also change the action by modifying the $('span').text('copy behaviour detected!'); code inside the action function. Instead, you could use alert('copy detected');, you could call a function, show (or hide) a DIV containing info, open a popup, clear the users clipboard so the copied text doesnt actually copy, pretty much anything you like.

To stop this happening, disable Javascript. However, if you do that, nothing else will work. Looking at the code on Currys website, it's not posting back to their servers that you copied - so while the webpage alert you to the fact that you're coping text, the website owners dont appear to be logging or recording this anywhere

Share:
14,187

Related videos on Youtube

seagull
Author by

seagull

Updated on September 18, 2022

Comments

  • seagull
    seagull 4 months

    Navigate to the following website: www.currys.co.uk - and look at any product. Here's a TV for example:

    http://www.currys.co.uk/gbuk/tv-and-home-entertainment/televisions/televisions/panasonic-viera-tx-49dx650b-smart-4k-ultra-hd-49-led-tv-10144937-pdt.html

    Now select the title of the product ("PANASONIC VIERA TX-49DX650B Smart 4k Ultra HD 49" LED TV") and you'll see a little box popping up, telling you that they have a price comparison service, clearly in an attempt to stop you from googling the product and finding it cheaper elsewhere.

    This is a very clever piece of code, and I don't really begrudge how this retailer is using it, but it upsets me that a website knows when I am copying information from it. How are they doing this, and how can I stop it? I know it isn't a Flash applet because I have click-to-run enabled.

    • NetworkKingPin over 6 years
      Could possibly be java. Although im not 100% sure just an idea. I know you can pull the local time through java or Flash.
    • seagull
      seagull over 6 years
      Nah, I don't have Java installed.
    • NetworkKingPin over 6 years
      Ive noticed if you select any piece of the text even a letter the message comes up. Its in the source code. I believe its setup to only pop up when you copy any part of that text line. its in their webpage javascript addEventListener("copy",function(n){t=c.getString("tourguide‌​.pricepromise.label" The title is labeled as Tourguide.PricePromise. Which leads to the text you see when you copy it.
    • Xavierjazz
      Xavierjazz over 6 years
      I'm voting to close this question as off-topic because this is spam.
    • seagull
      seagull over 6 years
      It isn't, although looking at it I can see why you'd come to that conclusion. Let the admins decide what they want, but please understand I didn't mean to advertise anything.
    • fixer1234
      fixer1234 over 6 years
      It isn't clear whether your question stems from a potentially wrong premise. They aren't stopping your from copying anything or doing comparisons elsewhere, just offering a convenience (added feature). So it isn't clear what your question is (how to turn off/suppress that feature? How does the code work?). BTW, I opened the link and followed your procedure and nothing special happened (no box or anything). I use an ad blocker and tracker blocker, so maybe your solution is as simple as that.
  • seagull
    seagull over 6 years
    Good answer, thanks. I hate it, but it's a great answer.
  • seagull
    seagull over 6 years
    Thanks, but my concern was more how to stop it rather than how to do it myself.
  • Fazer87
    Fazer87 over 6 years
    Disable Javascript... and if you do that, nothing else will work. Looking at the code on Currys website, it's not posting back to their servers that you copied - so while the webpage alert you to the fact that you're coping text, the website owners dont appear to be logging or recording this anywhere