Created
April 30, 2019 12:24
-
-
Save jorgeortega/59ec45e572ef247ace57bbdf3600faec to your computer and use it in GitHub Desktop.
Check if window is fullscreen, maximized or not maximized
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isAtMaxWidth = screen.availWidth - window.innerWidth === 0 | |
const screenPixelRatio = (window.outerWidth - 8) / window.innerWidth | |
const isAtDefaultZoom = screenPixelRatio > 0.92 && screenPixelRatio <= 1.10 | |
const isMaximizedAndDefaultZoom = isAtMaxWidth && isAtDefaultZoom | |
const isFullscreen = window.outerWidth == screen.width && window.outerHeight == screen.height |
Zibri
commented
Nov 16, 2022
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment