Thursday, June 8, 2017

Change the Browser User-Agent by using Chrome DevTools

Either you are testing an app which verifies the User-Agent or you just want to see your app rendered in a different one. There is an option included in the Chrome Developer Tools which allows you to change this value without having to install any additional third-party software for this.

Steps:

1. In Chrome, open the DevTools (by pressing F12 key)
2. Display the "Customize and control DevTools" options menu:


3. Select the "Show console drawer" option
4. From the new Console section, display the options menu:


5. Select "Network conditions" option
6. Observe the new tab is added to the Console section
7. Look for "User agent" and uncheck the "Select automatically" option
8. Now you are able to select a different agent from the list:

9. Refresh the page so the changes take effect.