Is there a way to manually set the minimum size of a browser window across all browsers?
Here's my solution for ensuring actual minimum content width and height, which includes dealing with different browser's "chrome" dimensions. This doesn't work with Firefox, but I've tested it in Edge and Chrome.
function ensureMinimumWindowSize(width, height) {
var tooThin = (width > window.innerWidth);
var tooShort = (height > window.innerHeight);
if (tooThin || tooShort) {
var deltaWidth = window.outerWidth - window.innerWidth;
var deltaHeight = window.outerHeight - window.innerHeight;
width = tooThin ? width + deltaWidth : window.outerWidth;
height = tooShort ? height + deltaHeight : window.outerHeight;
// Edge not reporting window outer size correctly
if (/Edge/i.test(navigator.userAgent)) {
width -= 16;
height -= 8;
}
window.resizeTo(width, height);
}
}
var resizeTimer;
window.addEventListener('resize', function(event) {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function () {
ensureMinimumWindowSize(,);
}, 250);
}, false);