1

I am returning image quality on my webpage based on the physical width of a device. This value should be static. The most reliable solution I know so far must be screen.width property.

However, in the current Firefox I am using, the value of screen.width is not static. When I switched to responsive design view (or ctrl + shift + m), then querying screen.width, the value corresponded to current viewport width, not the real physical width.

I noticed this when switching to the responsive design view, and reload the page, all images were blurred, having very bad quality.

So, is there some way I can get the static or real physical screen width of a device using pure Javascript? Maybe a tiny library?

1 Answer 1

2

screen.availWidth and screen.availHeight will give you the actual available width and height

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.