How can I get/set screen resolution for instant games in mobile facebook app or mesenger? I tried getting that by "window.screen.width" and "window.innerWidth", it returned me 360 pixels (but i have 980 in Chrome browser). I haven’t used any meta tags which can limit the resolution.
Asked
Active
Viewed 2,470 times
1 Answers
1
You need to use window.innerWidth
and window.innerHeight
.
You need to multiply these by window.devicePixelRatio
.
So:
PixelW = window.innerWidth * window.devicePixelRatio;
PixelH = window.innerHeight * window.devicePixelRatio;

Raptor
- 53,206
- 45
- 230
- 366

Steven Haggerty
- 308
- 3
- 15