为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

window.resizeTo in addon (overlay commonDialog) does not resize after some minimum size in FF v17 & 18

  • 4 个回答
  • 2 人有此问题
  • 1 次查看
  • 最后回复者为 oster

more options

I created an addon which overlay commonDialog.xul. In the load event, window.resizeTo is called and set to a very small size (like 10x10) so it is almost invisible to users.

This works fine in FF 15. After upgrading to FF 17 or FF 18, this stops working.

When I set the size big, it works fine. When setting it to a small size, it seems like when hitting a limit, the window size stays the same. The window size is the same when setting to 10x10 or 100x100.

This is on a MAC, but same behavior is observed on Windows too.

It seems like there is a minimum size predefined and the window does not get smaller than that.

Aren't we supposed to be able to resize the window as we wish in the addon?

I created an addon which overlay commonDialog.xul. In the load event, window.resizeTo is called and set to a very small size (like 10x10) so it is almost invisible to users. This works fine in FF 15. After upgrading to FF 17 or FF 18, this stops working. When I set the size big, it works fine. When setting it to a small size, it seems like when hitting a limit, the window size stays the same. The window size is the same when setting to 10x10 or 100x100. This is on a MAC, but same behavior is observed on Windows too. It seems like there is a minimum size predefined and the window does not get smaller than that. Aren't we supposed to be able to resize the window as we wish in the addon?

由oster于修改

所有回复 (4)

more options

Did you try to use CSS code to set a height and width to that window or set a height and width property?

<?xml-stylesheet href="chrome://xxx/xxx.css" type="text/css"?>

If you use an extension then you can also hide that window until it is needed.

more options

Hi Cor-el,

I tried with CSS but that is not what I want. CSS impacts all commonDialog. What I need is for the dialogs meet my criteria only.

Can you elaborate on how I can hide the window in the extension and show it as needed?

more options

If you create your own window with a unique ID then it should be possible to create more specific CSS rules for that window.

How (when) do you resize that window when you need it to show with the default dimensions?


If you have specific questions about developing extensions then it is best to ask advice at the MozillaZine Extension Development forum.

The helpers at that forum are more knowledgeable.
You need to register at the MozillaZine forum site in order to post at that forum.

more options

The window is the http authentication popup window and is not opened by me,

I listen to the load event and when called, if it matches my criteria, then window.resizeTo is called to change the size.

This works in FF 15, but not 17 or 18. Is this a firefox breakage/bug?