问题
I have this chrome extension that shows some content in the popup.html. As the content changes at "run-time" the popup.html sizes change too, expanding where there's more content to show. The problem that I have is that the popup.html don't resize itself back according to a smaller content. How can I do that?
回答1:
Add <!DOCTYPE html>
to the very beginning of the popup.html - it looks like you've forgotten to add it
回答2:
I had a pesky CSS line:
body {
min-height: 100vh;
}
in my popup's CSS and removing it made the popup auto-resize itself again.
来源:https://stackoverflow.com/questions/9498685/resize-popup-html-in-chrome-extension