chrome extension, popup window's height

前端 未结 4 1543
庸人自扰
庸人自扰 2021-02-01 15:08

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

相关标签:
4条回答
  • 2021-02-01 15:25

    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.

    0 讨论(0)
  • 2021-02-01 15:27

    Set height in css for both html and body elements.

    0 讨论(0)
  • 2021-02-01 15:36

    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.

    0 讨论(0)
  • 2021-02-01 15:38

    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 讨论(0)
提交回复
热议问题