Please tell me how to do such things, and perhaps even do them:

1. How to close the Source Code to the user.

2. How to block the URL string (so that the user could not change it)

  • url string - this is where the user enters the address? - KoVadim
  • one
    What is this protection? from cockroaches in the developer's head? - uvlad

5 answers 5

Block viewing of the source code, as well as changing the e-book is impossible.

    <body oncontextmenu = "return false;"> - a ban on the context menu (right-click)

      Apparently, the third question will be: "How to block the launch of the task manager, registry editor, as well as the boot in safe mode and the keyboard with the mouse."

      Admit it, are you writing Trojan.winlock? Just kidding.

      But tell me honestly, why do you block the URL string?

      By sabzh: you can of course sophistically ban the right click (you can see an example here ), but this will not solve the problem itself. In Opera there is, for example, the magic combination CTRL + U.

      [upd] Well, after. Having a little tormented Google, we have the following options:

      1. Encrypt. The best option available. You can write the encoder yourself or take it ready.

      2. Block right click. Problems will not solve at all, but get moral satisfaction.

      3. Do not go online. Heh.

      • Sometimes it seems to me that precisely because the opera so easily unlocks the right button or spits on some "standards", they dislike it :). But ordinary users love. - KoVadim
      • Either ctr + s and in many browsers you will be offered to choose a folder where to save the page) - Andrey Arshinov

      The source code of what you have already sent to the user (HTML / Javascript) cannot be hidden.

      • I saw something on websites that when you click on the right mouse button, this action is prohibited for you .. - oOKomarOo
      • do not prohibit anything. No one can forbid me to press the right mouse button (well, unless it will just be absent or will there be a stern uncle with a baton standing next to it). - KoVadim
      • >>> I saw something on websites that when you click on the right mouse button, this action is forbidden to you. >>> Properties / Web Development / Source Code of the page in Firefox. So do not give a ride. You can compress JS. Then the source code will not dig. - Anton Mukhin

      You can prevent the string from being modified by creating a new window using the javascript method window.open ('URL of the page', '_blank', 'location = no') . True URL can be either not editable, or even may not be the address bar - depends on the browser.

      • Something like this: <a href=javascript: onClick=window.open('URL pages','_blank','location=no')>? - oOKomarOo
      • Yes. Only <a href=javascript: window.open('URL pages ’, _b_blank’, loclocation=no')> or put it on onClick. But not all together in one attribute. - DUP