When I click on my extension icon a popup windows appears, but the problem I'm facing is that the popup windows height is too large so it gets below my taskbar. Is there anyway to set the height of the popup window?
I have tried with declaring height and width in a css file by the body tag. But only the width of the window changes. I have also tried with making an iframe, but the popup window only gets blank.
Add the following at the beginning of your popup page to replace the <html>
:
<!DOCTYPE html>
Good luck!
You can set height and width of your popup window by using window.resizeTo(preferedWidth, preferedHeight) function. If you want to set this inside a popup window not from parent window than self.resizeTo(preferedWidth, preferedHeight); will do the job for you.
Better suggestion is to keep your content inside a div for example div with id 'content' so you can use this for popup window.
<head>
<script type="text/javascript">
function resizeMe()
{
height = document.getElementById("content").offsetHeight;
width = document.getElementById("content").offsetWidth;
self.resizeTo(width+20, height+100);
}
</script>
</head>
<body onload="resizeMe();">
This should be enough to solve your problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With