In a xul based extension you can do it like this:
In your xul file:
And in your js file:
function handleOnLoad() {
var iframe = document.getElementById("myframe");
iframe.setAttribute("src","http://www.google.com");
}
Just tried this and it opens a panel with an iframe of google: