Seems there no auto size option for Panels in Firefox Add-on SDK extensions, but panel.resize
exist. Is it possible to call it on current panel?
No, the code running inside a panel doesn't have the necessary privileges to call any SDK modules. This is solved by using a content script that will send a message back to the extension. The extension can then resize the panel. Something along these lines (untested):
var panel = require("panel").Panel({
contentURL: ...,
contentScript: "self.port.emit('resize', " +
"{width: document.documentElement.clientWidth, " +
"height: document.documentElement.clientHeight});"
});
panel.port.on("resize", function({width, height})
{
panel.resize(width, height);
});
panel.show();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With