Prohibit right-click, prohibit source code viewing, and prohibit saving code

Source: Internet
Author: User

1. Right-click prohibited
<HTML>
<Head>
<SCRIPT>
Function stop (){
Alert ("Can I crack it? ";
Return false;
}
Document. oncontextmenu = stop;
</SCRIPT>
<Boyd> you can right-click the key on the left of Shift + F10 and right CTRL to try it! Check whether the problem can be solved. ^ _ ^ </Body>

2. View prohibited informationSource code
Right-click the source file, but the source file is also displayed in the "View" source file.CodeTo solve this problem:
In fact, you only need to use a webpage with the <frame> </frame> mark to achieve the goal.
<Frameset>
<Frame src = "the URL of the file you want to keep confidential">
</Frameset>
In this way, when someone uses "View" the "source file", the above Code is displayed, and your real file is escaped.

3. Save the ban
The above two steps show that your source code is safe, but don't forget that others can save your page and analyze it slowly. But don't worry. Let's solve this problem.
Add the following code to the webpage you want to keep confidential:
<NoScript>
<IFRAME src = "*. htm"> </iframe>
</NoScript>
Now, if someone wants to save your webpage, ie will help you tell him that the webpage cannot be saved and the saved file will be deleted.

<NoScript> <IFRAME src = *> </iframe> </NoScript>
Between <body> </body>

After the above Code is added, the file cannot be stored separately, but the storage attributes can be changed. For example, you can save the text format page as another one.

[-About protection-]

First, use code to disable some ie operations.

: Save as prohibited

<NoScript> <IFRAME src = *. html> </iframe> </NoScript>
: Cancel selection, prevent copying and pasting, and prevent copying>
<Body
Bgcolor = # ffffff leftmargin = 0 topmargin = 0>

: Right-click prohibited>

<Script language = JavaScript>
<! --
If (window. Event)
Document. captureevents (event. mouseup );
Function nocontextmenu ()
{
Event. cancelbubble = true
Event. returnvalue = false;
Return false;
}

Function norightclick (E)
{
If (window. Event)
{
If (E. Which = 2 | E. Which = 3)
Return false;
}
Else
If (event. Button = 2 | event. Button = 3)
{
Event. cancelbubble = true
Event. returnvalue = false;
Return false;
}
}
Document. oncontextmenu = nocontextmenu; // For ie5 +
Document. onmousedown = norightclick; // for all others
// -->
</SCRIPT>

: Fixed Status Bar
<Body bgcolor = "# fef4d9">

Background/website properties/enable the news Copyright Protection Function

: Disable the use of HTML tags in pages for caching, as shown below:

<Head>
<Meta http-equiv = Pragma content = No-Cache>
<Meta http-equiv = cache-control content = No-Cache>
<Meta http-equiv = expires content = 0>
-Using the above code, you can disable the following methods-
1: Right-click to view the original file
3: file-Save
4: IE Cache
-It is difficult to use the Code itself to prohibit the following methods. I am confused about the method to prevent the original code from being called out-
2: View-original file
5: code extraction is also supported.
URL spoofing (real addresses can be hidden)

Tutorial code:
<Meta http-equiv = "refresh" content = "0; url = 'HTTP: // dongxie. Tomorrow is a new day after all @ www.cncms.com.cn/index.htm'">
Note that the URL in the Code is 'HTTP: // dongxie. Tomorrow is a new day after all @ www.cncms.com.cn/index.htm '"
@ Symbol in front of the [http: // dongxie. Tomorrow after all is a new day] Is cheated in IE after the effect can also be http://www.163.com
Not to mention the actual connection address www.cncms.com.cn/index.htm
URL Obfuscation
<Meta http-equiv = "refresh" content = "0; url = 'HTTP: // dongxie. Tomorrow is a new day after all @ .htm'">
What is .htm? What is the actual address?
How can I access it? Is there a. htm? If I want to do it, I will create an HTM without a name.
Just create a xxx.htm file and upload it to the hard drive dual-radical File Name of the QQ network. Delete xxxfrom sample .htm, so that even if you get the original code, it is difficult to see the real address.

Column 1: http: // dongxie. Tomorrow is a new day after all @.htm
Column 2: http://www.163.com/@.htm
It's hard to see what the real address is.

[forbidden to use IE-View-original file in JS]
This is also a confusing method, but it is absolutely forbidden to call the original file in the preceding method.
Javascript is required.
tutorial JS Code
var opopup = Window. createpopup ();
var PopTop = 50;
function popmsg (msgstr)
{< br> var winstr = "



Height =/" 172/"border =/" 0/"cellpadding =/" 0/" cellspacing =/"0/"> "; winstr + = "
align =/" center/">
border =/"0/" cellpadding =/"0/" cellspacing =/"0/"> "; winstr + = "
color: # f00000; face: tahoma/">" + msgstr + "
";
opopup.doc ument. body. innerhtml = winstr;
popshow ();
}

Function popshow ()
{
Window. Status = PopTop;
If (PopTop & gt; 1720 ){
Cleartimeout (mytime );
Opopup. Hide ();
Return;
}
Else if (PopTop> 1520 & PopTop <1720)
{
Opopup. Show (screen. Width-250, screen. Height, 241,1720-poptop );
}
Else if (PopTop> 1500 & PopTop <1520)
{
Opopup. Show (screen. Width-250, screen. height + (popTop-1720), 241,172 );
}
Else if (PopTop <180)
{
Opopup. Show (screen. Width-250, screen. Height, 241, PopTop );
}
Else if (PopTop <220)
{
Opopup. Show (screen. Width-250, screen. Height-PopTop, 241,172 );
}
PoPToP ++ = 10000;
VaR mytime = setTimeout ("popshow ();", 1 );
}
Popmsg ("");

Save as 17789897.js

Htm calls JS Code
<Script language = Javascript
Src = "17789897.js"> </SCRIPT>
Some write friends may be familiar with it, but I want to tell you that his current role is to prohibit the same [ie-View-original file]
Difference in this Code
PoPToP ++ = 10000;
VaR mytime = setTimeout ("popshow ();", 1 );
Have you seen it? The speed is 10000.
No, I know what it means.
Call the JS Code of the above JS AND HTM
You can add it to the webpage to disable [ie-View-original file].
This is what I know about protection.

[-About encryption-]
I suggest using composite encryption for important code
There are basically the following methods:
JS Code
Escape Encryption
8-digit escape string
Hexadecimal escape string
The 10-digit HTML encoding is as follows:
Hexadecimal HTML encoding:
<SCRIPT>
<! --
Document. Write (Unescape ("encrypted code "));
// -->
</SCRIPT>
I won't give it because of the huge code and JS files.
You can search for Baidu.com
[-About cracking-]
The so-called magic height, a high degree, and then complex encryption, in a lot of confusion, still use IE to decode
Give everyone a super skill
In the address bar or press Ctrl + O and enter:
Javascript: ssf-document.doc umentelement. outerhtml; document. Write (<body> </body> '); document. Body. innertext = s;
The source code comes out. No matter how complicated the encryption is, the HTML code that can be parsed by the browser must be restored, and documentelement. outerhtml is the final result.

Friends who often visit the Internet may want to save beautiful images. They can't help but look at the source code when they see beautiful pages. Unfortunately, some users use small JavascriptProgramThe right-click function is disabled, which makes it impossible to save and view data. So how can we disable the right-click function and remove it?

Add the right-click prohibited function to Your webpage

In fact, this is just a simple function implemented by using JavaScript to lock the right mouse. We only need to add the following program to Your webpage. The text section "sorry ......" You can replace the text you like as needed.

<Script language = JavaScript> function click () {If (event. button = 2) {alert ('Sorry, your right-click function cannot be used here ')} document. onmousedown = click </SCRIPT> 〉

In this way, the right-click function can be disabled. When you right-click your webpage, a text window containing the OK button will pop up.

How to crack the function of disabling right-click

It is also very easy to disable the right-click function. There are two methods:

First, right-click the page target and the window will pop up. Do not release the right-click button. Move the mouse over the OK button of the window and press the left button. Okay, now let go of the left mouse button, and the window disappears. Finally, move the mouse over the target and release the right mouse button. Now, all the functions you want are available. You can copy the file or open the join in a new window.

Second, right-click the page to be added to the favorites window. The above method cannot be used to crack the page, because when you click Cancel with the left mouse button, the point of intersection of the target will be lost, we use another method to suppress it: first, right-click the target, and a window to add to favorites appears. Do not release the right button or move the mouse. Then, use the tab key of the keyboard to move the focus to the cancel button. Press the Space key and the window disappears. Finally, right-click it. All the functions you want are available.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.