Reputation: 5
I know that "useragent.js" and "user-agent-utils 1.8" is used to identify the type of the browser ,operating system,mobile devices etc,at the user end.
Can we identify the resolution/size of the screen(in pixels) using USER AGENT class library?
Thanks in Advance.
Upvotes: 0
Views: 219
Reputation: 41945
Using Javascript not User Agent
window.screen.availHeight
Specifies the height of the screen, in pixels, minus interface features such as the taskbar in Windows.
window.screen.availWidth
Specifies the width of the screen, in pixels, minus interface features such as the taskbar in Windows.
window.screen.width
The total height of the screen, in pixels.
window.screen.height
The total width of the screen, in pixels.
Upvotes: 1
Reputation: 78545
You can't get that data from the user agent. You can use Javascript:
var resolutionX = screen.width;
var resolutionY = screen.height;
Upvotes: 0