1

我正在手动将我在 Chrome 中编写的扩展移植到 Firefox。我将面板附加到小部件,并将该面板的内容设置为 HTML 文件。如何使面板随内容缩小和增长?现在有很多难看的滚动条和灰色背景。

var data = require("self").data;

var text_entry = require("panel").Panel({
  width: 320,
  height: 181,
  contentURL: data.url("text-entry.html"),
  contentScriptFile: data.url("get-text.js")
});

require("widget").Widget({
  label: "Text entry",
  id: "text-entry",
  contentURL: "http://www.mozilla.org/favicon.ico",
  panel: text_entry
});

不设置面板的高度属性会使其非常高。

4

1 回答 1

0

You might want to check out this example that resizes the panel based on the document loaded. If you want to resize based on changes to the content size, at least on initial load:

https://builder.addons.mozilla.org/package/150225/latest/

( sorry for the delay in respinding, been afk travelling )

于 2012-10-31T21:56:06.080 回答