A8DOG

A8DOG

随便写写,记录折腾过程!
telegram

How to modify User-Agent in Chrome browser

In our work, we may find that certain websites behave differently on different browser clients, and the main criterion for this is the User-Agent (abbreviated as UA) of the client. For the convenience of debugging, we may wonder if there is a browser that allows us to customize and modify the UA, in order to disguise as different clients when accessing the same website. The answer is the versatile Chrome. Well, without further ado, let's introduce two methods to achieve this goal:

0x01: Modifying the UA for a single website through the developer tools#

  1. 0x001: Open Chrome, visit the website that needs to be debugged, and bring up the developer tools (F12 or Ctrl + Shift + I on Windows, option + command + I on Mac);

  2. 0x002: Click the three vertical dots, select More tools -> Network conditions;
    https://dysaniazzz.github.io/img/20190606/001.png

  3. 0x003: Uncheck the "Select automatically" option in the User agent column. By default, it is checked, which means the Chrome's default UA is used when accessing websites;
    https://dysaniazzz.github.io/img/20190606/002.png

  4. 0x004: Click the dropdown menu of Custom..., and select the UA you want to disguise as, or directly enter it in the input box below;
    https://dysaniazzz.github.io/img/20190606/003.png
    https://dysaniazzz.github.io/img/20190606/004.png

  5. 0x005: Refresh the page (F5 or Ctrl + R on Windows, command + R on Mac), and now the UA has been changed to the one you modified. You can verify it by entering navigator.userAgent in the Console.
    https://dysaniazzz.github.io/img/20190606/005.png

  • Note: This method only takes effect in the current tab. When opening a new tab, the UA will still be the default one.

0x02: Modifying the UA globally using extension plugins#

  • 0x001: Download the Chrome extension: User-Agent Switcher and Manager;
  • 0x002: Select the browser and operating system, click Apply, and after setting this, the browser will use the UA you set when accessing any website.

https://dysaniazzz.github.io/img/20190606/006.png

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.