The goal is to change the size of my chrome extension popup (different from a normal popup window) dynamically when the user clicks on a button.
I tried to hide the elements I have on the page by setting the hidden attribute to true. I also tried to change the window size with window.resizeTo, but nothing works.
Note: I can enlarge the window, but I can't shrink it back
The goal is to change the size of my chrome extension popup (different from a normal popup window) dynamically when the user clicks on a button.
I tried to hide the elements I have on the page by setting the hidden attribute to true. I also tried to change the window size with window.resizeTo, but nothing works.
Note: I can enlarge the window, but I can't shrink it back
Share Improve this question asked May 18, 2011 at 22:41 Tony StarkTony Stark 3,4637 gold badges28 silver badges30 bronze badges1 Answer
Reset to default 5Just adjust the css width
property of <body>
element. Can also do the same with <html>
for good measure.
document.body.style.width="100px";
document.getElementsByTagName("html")[0].style.width="100px";