简体   繁体   中英

Browser action height won't reset

I am working on an extension that will give you a response based on your text, this works and is good and all, but the height of the browser action won't reset.

To try to fix this, I have attempted to resize the window using window.resizeTo and tried to manually set the height of both 'html' and 'body' using jQuery. Nothing has worked. Is this a bug with Google Chrome or am I doing something wrong? This does not make it work, as it stays at the same size.

As you can see in the pictures, the window starts out perfectly sized and then I enter a question and go back to the window being larger than it was initially.

起始尺寸

更改响应窗口的大小 身高不会回去

The popup can't become smaller than its content and/or CSS allows.

Find the element and/or CSS rule that occupies the full height by inspecting the popup (right-click it and choose Inspect popup ), point over various elements inside <body> to see them highlighted and their actual height displayed. If all the elements are smaller than the popup it could only mean that you have a CSS rule on <body> or <html> that specifies the minimum height. If possible, remove that rule from the CSS or override it.

The problem in your case was a CSS rule html {min-height: 100%} in one of the 3rd party styles.

Set both height and min-height for body and html , for example like this:

document.body.style.height = '0px';
document.body.style.minHeight = '0px';
document.documentElement.style.height = '0px';
document.documentElement.style.minHeight = '0px';

Or use 'auto' instead of '0px' .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM