CSS Grid Row Height Safari Bug

Short Answer The problem is that Safari is not recognizing the height: 100% on the img elements. Explanation This is not a Safari bug. It’s just a different interpretation of the spec. When dealing with percentage heights, some browsers (like Safari) adhere to the traditional interpretation of the spec, which requires a defined height on … Read more

Low power mode detection in JavaScript for iOS11?

A workaround to get this done is: Put a video (hidden) in the webpage with autoplay ‘on’, and then detect the ‘suspend’ event for that video. Whenever it is invoked, ‘power mode is on’. Here is the script: const videoElement = document.getElementById(‘ID_of_video’); videoElement.addEventListener(‘suspend’, () => { // suspend invoked // show play button // iphone … Read more

Mobile Safari $(window).height() URL bar discrepancy

Tldr If you just want to query the window height, cross-browser, and be done with it, use jQuery.documentSize and call $.windowHeight(). For implementing your own solution, read on. When to use jQuery or the clientHeight of the document jQuery’s $(window).height() is a wrapper for document.documentElement.clientHeight. It gives you the height of the viewport, excluding the … Read more