Sign in Registration
ruen

Receiving and analyzing the JavaScript code connected on the site page

Sometimes, when visiting a site, you may need to look at which JavaScript code is enabled on the page. This may be needed in various situations, for example, you need to figure out how this or that functionality works on the site in question.

js-get-analize

JavaScript-code can be embedded directly into the source code of the website page, then there will be no problems with obtaining such code. But often, in addition to such code, third-party code files are also connected, then it is more difficult to find a piece of code responsible for a specific functionality. In this case, you need to analyze which files are included in the page.

The procedure for getting JavaScript code usually boils down to the following:

  • open the source code of the site page and pay attention to the connection of scripts. Usually scripts are included either at the top of the page or at the bottom - this is done using the script ;
  • tag
  • copy the address specified in the src attribute of the script tag;
  • addresses are usually specified relative, so then you need to substitute the domain of the site in question in the beginning of the received address of the script;
  • after that, it is enough to insert the prepared address into the browser address bar in a new tab, as a result, all the code from the file will be displayed on the page;
  • copy the code and paste into the editor with syntax highlighting.

This procedure can be repeated for each connected file using a search in the source code, just specify the keyword script .

When the source code is received, you can analyze the JavaScript code :

  • , you need to hover the cursor over the element under study and open the developer console using the context menu above this element. In the console, you should pay attention to what classes or identifiers are registered for the element. Having received the keywords, you can move on to the next item;
  • use the search in the editor with the received source code to find the desired section of code by the extracted keywords;
  • when matches are found, you can start examining the code section.

Using this technique, you can get JavaScript code of almost any page on the site, and then perform a complex analysis of JavaScript code . In some cases, code analysis can be complicated, as there may be JavaScript protection is applied -code , but often such code is not protected in any way.

Comments (0)
For commenting sign in or register.
Оставить заявку

Latest articles

Popular sections

Eqsash (Tools)

Android app - VK LAST USER ID, отучитель от зависимости и т.д.:
Available on Google Play

Amessage (Communication)

Login to the web version
Android app:
Available on Google Play

Share this

Subscribe to

YouTube

Books

IT notes - In simple language about the most necessary things (HTML, CSS, JavaScript, PHP, databases, Drupal, Bitrix, SEO, domains, security and more), PDF, 500 p.