- Joined
- Aug 17, 2008
- Messages
- 2,190 (0.36/day)
- Location
- Minnesota, USA
System Name | TaichiTig |
---|---|
Processor | i7 6800K |
Motherboard | ASRock X99 Taichi |
Memory | 32GB DDR4 3200 |
Video Card(s) | RTX 4070 |
Storage | SSD + Misc. HDDs in DrivePool |
Display(s) | BenQ PD3200U, Samsung C32HG70 |
Case | Antec Twelve Hundred |
Audio Device(s) | Behringer UMC404HD, LSR308, Shure SRH840, AKG K612, Etymotic HF5 |
Power Supply | Corsair 750TX |
Mouse | Logitech G502 |
Keyboard | Deck Legend Ice Tactile |
Software | Win10 |
I'm using JavaScript's screen.width and screen.height to detect the screen resolution of a web page's users. This works fine regardless of the number of monitors a user has, except in IE and Opera.
IE seems to return the current screen resolution of whichever display is set in Windows as the primary display.
Opera seems to return the resolution of whichever display it was originally opened in, when it was opened—even if the resolution of that display has since been changed. Cheater.
I already have separate code in place to detect the height and width of the browser window/frame. Can anyone help me get the actual screen resolution of the screen the browser is currently in? Thanks.
FYI I have only tested in Chrome 12, Firefox 5, IE 8 and 9, Opera 11.5, and Safari 5.0.5 so far. The demographics of this web site's users also demand compatibility with Chrome 10 and 11, Firefox 3.6 and 4, IE 6 and 7, Opera 10.5 and 11.5, and Safari 3.2 and 4.
IE seems to return the current screen resolution of whichever display is set in Windows as the primary display.
Opera seems to return the resolution of whichever display it was originally opened in, when it was opened—even if the resolution of that display has since been changed. Cheater.
I already have separate code in place to detect the height and width of the browser window/frame. Can anyone help me get the actual screen resolution of the screen the browser is currently in? Thanks.

FYI I have only tested in Chrome 12, Firefox 5, IE 8 and 9, Opera 11.5, and Safari 5.0.5 so far. The demographics of this web site's users also demand compatibility with Chrome 10 and 11, Firefox 3.6 and 4, IE 6 and 7, Opera 10.5 and 11.5, and Safari 3.2 and 4.