Question 88

2.4.2 Question

Multiple Choices

What are common methods for detecting the type of browser running on a client? (Choose all that apply.)

  • A. Use JavaScript to query for the userAgent header.
  • B. Use the window.addEventListener method.
  • C. Use the viewport <meta> tag.
  • D. Use the DisplayMode provider.


A. Correct: Using JavaScript to query the userAgent gives you information about the type of browser being used by the client.
B. Incorrect: The window.addEventlistener does not give any information on the browser being used by the client, but it can be used to see whether a browser is HTML5-compliant.
C. Incorrect: The viewport <meta> tag gives access to the visible area of the device; it does not tell you anything about the device itself.
D. Correct: The display mode provider performs some of the analysis of the HTTP request to try and determine what kind of browser made the request.