Search code examples
javascriptaemsightly

Get navigator object in sightly AEM backend


I am developing a component in AEM 6.1 using sightly. Is there any way to detect the browser in backend JS code. Is there any api that exposes those details to backend JS?


Solution

  • The browser sends this information in the HTTP header. You can use userAgent (from request object) to identify browser details. You can write your own code to identify device/browser/os or use some service.