Skip to content

A JavaScript library to detect browser properties like browser name, device, OS, referrer, timezone, screen resolution and much more.

License

Notifications You must be signed in to change notification settings

Ahmdrza/detect-browser

Repository files navigation

detect-browser

A JavaScript library to detect browser properties like browser name, device, OS, referrer, timezone, screen resolution and much more.

How to use

Add js file in src folder or wherever you like.
Add <script type="text/javascript" src="path-to-your-file/detect-browser.js"></script> in html file where you want to detect browser properties.
Add <script type="text/javascript"> var info = getBrowser(); console.log(info); </script> after adding above code.

It will print browser info in console

List of properties available

info.language // browser language e.g en-US
info.languages // Gives Array of languages
info.user_agent // Gives User Agent
info.browser // Gives Browser name e.g Chrome
info.device // Gives Device e.g Mobile or Desktop
info.referer // Gives Referer
info.os // Gives User OS e.g windows 10 64-bit
info.online // Gives user online status true or false
info.timezone // Gives User Timezone
info.screen_resolution // Gives Screen Resolution e.g 1366 x 768
info.cookie_enabled // Gives Cookie enabled status true or false

About

A JavaScript library to detect browser properties like browser name, device, OS, referrer, timezone, screen resolution and much more.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •