开发者

chrome extension, popup window's height

开发者 https://www.devze.com 2023-03-29 04:16 出处:网络
It seems to me that the popup window\'s height has a limit of 489开发者_如何学运维 pixels. If I\'m setting the body element of the popup to 600 pixels of height, then popup window gets a scroll bar (b

It seems to me that the popup window's height has a limit of 489开发者_如何学运维 pixels. If I'm setting the body element of the popup to 600 pixels of height, then popup window gets a scroll bar (because the page inside becomes larger) but the popup window doesn't change its size.

Is it possible to make the popup window's height bigger then 489 pixels?


Set height in css for both html and body elements.


The popup window for chrome extensions has a maximum height and width. That is why the solution to set the height of body and html elements does work in some cases, and does not work in others. For Windows, the max height seems to be set to 489 pixels.

Additionally, the size of the popup does generally fit the size of its (relatively positioned) elements. This is also the case if the DOM of the popup is dynamically changed. So, setting the height for the popup window should usually not be nessecary.


The popup should size to fit the (relatively positioned) content inside. Alternatively, you can set the height CSS property on the body of the your popup page to force it to a particular height.

You can also hide the scrollbar by setting overflow: hidden; on body.


If your popup is only for updating settings of your extension. The best way is to create a seprate setting page called options_page,not popup.

A reference about options_page is here.

0

精彩评论

暂无评论...
验证码 换一张
取 消