Assuming there are no visible elements above 100 pixels on the popup page:
document.body.style.height="100px"; document.getElementsByTagName("html")[0].style.height="100px";
If this does not work, then some element is still considered visible (Chrome is misleading).
The best way to understand this is to use the popup inspector.
- Right-click on the pop-up window icon, select "View Pop-up Window".
- Set height for
<html> and <body> elements - Set height for your container div
- Play with
height , overflow:hidden , float:left , display:none in the div container and its children until the pop-up window is reduced to the required height.
source share