We have released a new book “Content Marketing in in social networks: How to get into your subscribers’ heads and make them fall in love with your brand.”

The source code of the site is a set of HTML markup, CSS styles and JavaScript scripts that the browser receives from the web server.

More videos on our channel - learn internet marketing with SEMANTICA

It can be compared to a set of commands given to soldiers by a commander. Imagine that the audience does not see or hear the boss. From their point of view, the military carries out actions independently. In our case, the commander is the browser, the commands are source, and marching soldiers are the end result.

The site is stored on a web server, which sends the page upon user request. A request is typing a URL in the address bar, clicking a link, or clicking a submit button on a form. It doesn’t matter what language the web pages are written in or whether they include a software component. The end result of any server-side algorithm is a set of html tags and text.
The page source code is a set of data that includes:

  • html markup;
  • style sheet or file link;
  • programs written in JavaScript or links to files with code.

These three sections are processed by the browser. For the server, this is simply the text that needs to be sent in response to the request.

Why we might need to study the source code

Everything we see, we can analyze and apply to solve certain problems that arise while working with the site, especially when optimizing it. By looking at the source code, we can:

  • See the meta tags of your or someone else’s site to analyze them.
  • See the presence or absence of certain elements on the site: counters, identification codes in various systems, certain scripts and other things.
  • Find out the parameters of the elements: sizes, colors, fonts.
  • Find the path to photos and other elements located on the page.
  • Explore links from the page.
  • Find problems with the code that interfere with the process of website optimization: those not addressed in separate files styles, scripts, invalid code.

These are the basic features, but in fact, by being able to read the code, you can learn a lot more about the page.

How to view the source code of a site

It will not be possible to do this completely in the form in which it is posted on the server from the browser. But you can see all the markup by right-clicking on the page. Here and below using Google Chrome as an example.

Select the “View page code” option and get the full listing in a separate tab.

It's just text that you have to analyze to understand. But you can get interactive code using the developer tools.

How to find the source code of a website page

Click on the menu icon in the browser. Most often it is on the right and looks like three dots or stripes.

In the additional tools section, select “Developer Tools”.

A window will open showing the active state of the code. This means that when you click on the markup, the element style will appear next to it, and the selected blocks will be highlighted on the page.

In the “Source” tab you can view the contents of some files: scripts, fonts, images.

In the “Security” tab, you can check the site’s certificate.

The “Audits” tab will help you check the resource posted on the hosting.

If the location of the panel on the right is inconvenient, you can click the three dots and change it by selecting the desired item.

How to view meta tags

Every HTML document includes structure tags. Here are some of them:

  • Html – the entire document.
  • Head – section of service headers.
  • Title – page title (displayed on the tab).
  • Body – the body of the document.
  • H1-H6 – page text headings.
  • Article – article.
  • Section - section.
  • Menu – menu.
  • Div – block.
  • Span – string.
  • P – paragraph.
  • Table – table.
  • Elements are designed to logically delimit sections on a page; if necessary, they are designed using styles. They contain text that is somehow visible on the page. But the Head tag contains service information. Meta tags are used to indicate it. Everything that is written in them is intended for the server and search engines.

    Their contents cannot be found out in any other way.

    Let's pay attention to the Link tag. With its help, links to external included files are specified. If desired, you can see the contents and save to disk. To do this, move the pointer to the address and press RMB. Select "Open in new Tab".

    Will open in a new tab specified file, which you can view or save.

    How to view the source code of a page to debug a script

    In this case, it is most convenient to open the page on the local machine. If you only need to correct markup, styles and scripts, then this can be done directly from the folder. The HTML code is viewed in the same way. Here are the mistakes JavaScript code can be seen in the “Console” tab. This shows the description of the error and the line number where it occurred.

    The syntax can be seen directly in the code. This is what the “Source” tab is for.

    How to view the code of a specific element

    For large pages with many elements it is difficult to find required code throughout the markup. In this case, you should use special team context menu. Move the mouse over the fragment and press RMB. Select the “View Code” command.

    The same window will open, but with the focus on the selected object.

    Summary

    We told you what the page source code is. It is enough to master basic knowledge of HTML and CSS, and using convenient developer tools, you will be able to debug your own HTML documents.

    Viewing resource code on the Internet will allow you to learn not only from own experience, but also use real working examples. And for SEO specialists, meta tags will be useful, the information in which can tell a lot about the site.

    The article will discuss the basic principles of encryption and packaging, weak points of protection, methods of manual removal, as well as universal tools for automatic removal packers and padding protection from JavaScript scripts.

    Hidden text

    IN Lately Increasingly, the source code of scripts is encrypted or packaged. Yandex, DLE and other popular projects began to get carried away with this, and beautiful stories about “taking care of users”, “saving traffic” and other nonsense look very funny. Well, if someone has something to hide, then our task is to bring them to light.

    Let's start with the theory. Due to the peculiarities of JavaScript execution, all encryptors and packers, despite their diversity, have only two variants of the algorithm:

    Var encrypted="encrypted data";
    function decrypt(str) (

    }
    // Execute the decrypted script
    eval(decrypt(encrypted));


    or alternatively:

    var encrypted="encrypted data";
    function decrypt(str) (
    // decryption or unpacking function
    }
    // Display decrypted data
    document.write(decrypt(encrypted));

    The second method is most often used to protect the source html code of the page, as well as various Trojans for injection into the page malicious code, such as a hidden frame. Both algorithms can be combined, the “sophistication” and complexity of the decryptor can be anything, only the principle itself remains unchanged.

    In both cases, it turns out that the eval() and document.write() functions are passed fully decrypted data. How to intercept them? Try replacing eval() with alert() , and in the opened MessageBox you will immediately see the decrypted text. Some browsers allow you to copy text from MessageBoxes, but it is better to use this semi-automatic decoder:


    JavaScript Decoder


    // Function for writing decryption results to the log
    function decoder(str) (
    document.getElementById("decoded").value+=str+"\n";
    }









    For example, let's take some script from Yandex; after looking at the source code, we see something unhealthy:

    eval(function(p,a,c,k,e,r)(e=function(c)(return(c35?String.fromCharCode(c+29):c.toString(36)));if(!
    "".replace(/^/,String))(while(c--)r=k[c]||e(c);k=)];e=function())(return"\w+"); c=1);while(c--)if(k[c])
    p=p.replace(new RegExp("\b"+e(c)+"\b","g"),k[c]);return p)("$.1e
    .18=8(j)(3 k=j["6-9"]||"#6-9";3 l=j["6-L"]||".u-L";3 m=j ["6-L-17"]
    ||"";3 n=j["1d"]||0;$(5).2(".6-9").14("7");$(5).2(".6 -9").Z("7",8(
    )(3 a=$(5).x();3 o=$(5).x();3 h=$(5).B("C");$(5).v("g -4");$(5).16(
    $(k).q());3 t=$(o).2("15");3 c=$(o).2(".b-r");3 d=$(o).2 (".b-12");
    [the rest of the same nonsense is cut off]


    I’ll say right away that this script is processed by JavaScript Compressor, it is easy to recognize by its signature - the characteristic name of the function at the beginning of the script. We copy the entire source text of the script, replace the first eval with decoder , paste it into the decoder and save it as an html page.


    // Paste the encrypted script here, first
    // replace all calls to eval() and document.write() with decoder().
    decoder(function(p,a,c,k,e,r)(e=function(c)(return(cQAPKRV%22NCLEWCEG? HctcQa ...
    hp_d01(unescape(">`mf(%22`eamnmp? !DDDDDD %22v ...


    For convenience, the scripts are not given in full in this article; you must copy them in their entirety. We open the decoder in the browser and see the security scripts added by the program and the decrypted source text of the page. For convenience, you can decrypt only the third script, which contains the html code of the page. That's all the protection is. As you can see, nothing complicated. Other protections for HTML pages are removed in the same way.

    Let's move on from manual decryption to automatic decryption. To remove the first type of protection, I slightly modified the Beautify Javascript script already known to you and compiled it into an exe file. It handles most JavaScript protections and wrappers I've seen without any problems.

    Eval JavaScript Unpacker 1.1
    Eval.JavaScript.Unpacker.1.1-PCL.zip (12,073 bytes)

    For more difficult cases, you will have to use heavy artillery. This is a free Malzilla project designed to research Trojans and other malicious code. Since all programs designed to protect copyright are clearly malicious, Malzilla will help us in the fight against them. Download latest version(today it is 1.2.0), unpack it, run it. Open the second Decoder tab, paste the encrypted script code into the top window, and press the Run script button.

    It has fewer functions, but it has a place to be. From the offsite you can download a demo video showing an example of working with the program.

    As you can see, there is nothing difficult in removing protection from JavaScript scripts and html pages. Are you still continuing to defend your vile "author's rights"? Then we go to you!

    HTML code is essentially your page itself; it specifies exactly how your site will be built and displayed on the user’s display. As a rule, this code is open, meaning any user can easily see and read it. If, for one reason or another, you do not want anyone to have access to your code, you can. This involves creating a special algorithm that encodes your code, that is, hides its primary form, making it inaccessible to site users. When and who might need this? Absolutely any webmaster or site owner can do this encryption. The question is to what extent this is justified and necessary. For example, if you have a regular landing page made using a template and which is no different from others, there is no point in coding, since such a template is already publicly available. In this case, it is unlikely that anyone will copy and study your code. But if you have a website that has a unique design, you worked long and painstakingly on it, or paid a lot of money for it, then it’s still worth thinking about the code. There are very frequent cases when the owner has a website into which a lot of effort, time and money have been invested, and after some time, one way or another, he discovers exactly the same website, with the same design and structure, but on a different domain and hosting. Very often, site owners are told this by users themselves in the comments. In this case, we can safely conclude that someone simply copied the HTML code of your site and launched it on their own. What should you do to protect yourself? It’s not so easy to protect yourself from situations of copying and using someone else’s HTML code without permission. And in general, if a person has already seen your site, he will be able to duplicate it even without code, provided he has certain knowledge in the field of web development. But, as for the HTML code itself, it can be encrypted. This works based on a special javascript script. With our tool you... In this case, a special script is created, which is intended for decryption. It works quite simply: when a visitor goes to your site, an encrypted code is loaded that he cannot understand. At the same moment, the created javascript is launched, which decrypts the code and displays the site on the user’s screen. At the same time, the visitor himself cannot see the real code. However, this method also has a slight drawback. There are users whose browsers are prohibited running javascript on the site, in this case the script will not run, therefore the HTML code will not be decrypted and the site will not be displayed. But don’t be upset, such browser settings are very rare, we can say that 99% of browsers allow running javascript. How to do this? This is done very simply, using our tool. All you have to do is paste your HTML code into the field on this page and click on the button to start encryption. As a result, in another field you will receive an already encrypted code that can already be used directly on your website. Ctrl + U How to view the source code of an element?

    Right-click on the page element of interest.

    Google Chrome: “View element code”

    Opera : “Inspect element”

    FireFox : “Analyze element”

    In other browsers, look for a menu item with a similar meaning.

    Hi all!

    I especially laid out the whole point at the beginning of the article, for those who are looking for a quick answer.

    The information may be known to many, but since I am writing for novice bloggers, web programmers and other prospectors, this reference article is a must-have.

    In the future, you will definitely study the source code of pages and individual elements.

    Let's take a look at specific example how you can use viewing the source code of a page.

    For example, we want to see what keywords(keywords) are used for specific page. We go to the web page we are interested in and press Ctrl+U. The source code of this page will open in a separate window or in a separate tab. Press Ctrl+F to search for a code fragment. In this case, we type the word “ keywords". You will be automatically redirected to a piece of code with this meta tag and the searched word will be highlighted.

    By analogy, you can search and study other code fragments.

    Viewing the entire source code of a page is not very convenient in most cases, so it is possible to view the code in all browsers individual element or fragment.

    Let's use a specific example of viewing an element's code. For example, let's see if the link has a nofollow attribute. Click right click mouse on the link we are interested in and in the drop-down context menu Left-click on the item “View element code” or similar (depending on your browser). Below, in a special window for code analysis, we get something similar.

    We see that the link code contains rel=”nofollow” . This means that PR will not “leak” through this link. We will talk about this in more detail in the following articles. Now the important thing is that you now know how to view the source code of the page and the source code of an individual element.

    Enter text to encrypt:

    What is the "html cryptographer" tool used for?

    The HTML Encryptor tool will be useful for webmasters who want to protect their software products from search robots, hackers and those who like to take advantage of the results of other people’s work. We are talking about protecting HTML code, which is freely available on most resources and can be easily reproduced by anyone. Using the "Encoder for HTML" tool, you can obfuscate (encrypt, confuse) the source HTML code without any extra effort.

    In fact, an encoder can protect everything that is displayed on website pages: texts, images and other web page elements created using the language HTML programming(HyperText Markup Language). Or CSS codes (Cascading Style Sheets) - special tables in which the code is written once and saved in a separate file.

    How it works?

    The "html Encryptor" tool allows you to transform the source code of a software product so that its functionality is preserved, and analysis and decryption of the code by third parties or robots becomes almost impossible.

    First of all, the page's HTML code and CSS code need protection, that is, those software products that the end user can see on their computer. Of course, you shouldn’t expect 100% code protection from encryption services, but you shouldn’t make life easier for lovers of easy money either. So enter the text to be encrypted in the field you see below and click the "Encode" button. As a result, you will receive new text, encrypted via JavaScript, which visitors to your resource and search robots will not be able to read.

    Is it worth playing it safe and encrypting everything?

    In our opinion, it is necessary to protect not only valuable software products, which are expensive intellectual property, but also simply successful projects into which a lot of effort and time have been invested. It is unlikely that anyone will copy a program written according to a template. But many people will want to use the “beautiful” code or copy a successful website design. It is in such cases that our “html encryption tool” will help you. When a user visits your site, he will only see the encrypted code, and “behind the scenes” of the browser, at the same time, javascript will decipher the code and display the resource pages in the proper form.

    It is worth noting that this encryption method has its disadvantages. For example, if javascript is disabled in the user's browser, the site will not be displayed. Fortunately, this is quite rare.