how to hide my source code so to not be copied

前端 未结 8 1972
臣服心动
臣服心动 2020-11-30 05:51

I was recently informed by someone that my website was copied. When I looked at the linked that he gave me I so that the site was identic to mine except for the logo and tex

相关标签:
8条回答
  • 2020-11-30 06:25

    You can do stuff which amounts to security through obscurity, but the only way to prevent your client-side web source from being copyable is to not push it down the wire, to not deliver it in the first place, shut down your website.

    0 讨论(0)
  • 2020-11-30 06:27

    No, there is no way to hide one's code on the web. If you're sending information to the client-side, that information can be copied. That's not merely a fact of the web, that's a fact of information theory. The only option for cases like this is not prevention, but detection. Many services exist to help in these situations.

    Depending on your web host, preventing the listing of files in an images/ directory, for example, may be done by adding an .htaccess file with appropriate restrictions, or disabling directory listings from within your host's panel. The key words you need are "disabling directory listings". Talk to your webhost's support for more details, this is a very common request, so they likely already know exactly how to help you.

    Note that this will only prevent the listing of images in a convenient form. If they are referenced on other pages on your site, they can still be easily downloaded.

    0 讨论(0)
  • 2020-11-30 06:29

    Hiding the right click handler only stops honest people from getting the page source and not those using tools like wget or curl. You can obfuscate or minify your JavaScript (such as using Google Closure) but, if the browser needs to get access to the code or content, so can someone who is malicious.

    0 讨论(0)
  • 2020-11-30 06:42

    just create an empty index.html page and upload to your images folder, that solves it, so whenever they use /images..

    0 讨论(0)
  • 2020-11-30 06:42

    imho, it is impossible. Even if you block right click, F12, Ctrl+C/V, or others shortcut to copy, you can still counter with disable JavaScript and copy the the page source.

    0 讨论(0)
  • 2020-11-30 06:46

    Don't do this! It makes no sense to do this, since the user can disable the script, and there are many tools like Firebug by which a user can see the code.

    The best way to keep safe the store is installing a security camera while leaving the doors open.

    You can simply disable the right click by following:

    <body oncontextmenu="return false">
      ...
    </body>
    

    or

    <script language="javascript">
      document.onmousedown = disableclick;
      status = "Right Click Disabled";
      Function disableclick(e)
      {
        if(event.button == 2)
        {
          alert(status);
          return false; 
        }
      }
    </script> 
    

    The code above is from this article

    0 讨论(0)
提交回复
热议问题