User Agent - Instructions
Different pages will be shown, depending on the user-agent header.
About
Click the button or the link to trigger the server into detecting if you are using a mobile or non-mobile device.
If you hit the page with a browser, that the server thinks is a mobile browser then you will be shown the mobile version of this page. The server decides when to show different pages based on the user-agent header in the request.
The server does not have particularly good user agent detection so it will not work for all mobile user agents. It is deliberately buggy.
Note: This is a pretty old fashioned way of handling mobile devices. Most websites now are responsive, and will work on both desktop and mobile, and so no separate mobile pages, or subdomain would be used.
In the real world, you may find a subdomain being used e.g. instead of https://eviltester.com it would be https://m.eviltester.com.
Functionality
- The page which detects user-agent for redirection is /pages/mobile/user-agent-redirect/go
If you are automating, then you can detect if you were redirected by looking at the title, or the page contents.
- If the title of heading contains “Mobile” then the system thought you were using a mobile device.
- If the title of heading contains “Desktop” then the system thought you were using a non-mobile device like a laptop or a desktop browser.
Dev Tools
You can change the browser user-agent header by using the dev tools.
e.g. the “Toggle Device Toolbar” in Chrome.
This simulates a mobile device by changing the view port size and sending the appropriate header to the server when the page is refreshed.
Extensions
There are many browser extensions which will also do this for you, these often come with more user-agents and make it possible to simulate visiting the site as GoogleBot or BingBot.