How to show WebPage document into XUL elemento?

I am doing a Firefox addon and I've a button on my navigation bar. If I click on my button, I drill down a panel with elements like a label, buttons etc. I'd like to show a webpage (ex: google.com) in this panel.

Thank you 4 your answer, Diego.

Upvotes: 0

Views: 61

Answers (2)

Well, I found a solution for my problem and I have a box with my loaded webpage in this way:

 <vbox id="testPanel" align="top" width="500" height="500">
<groupbox flex="1">
 <caption label="Myweb"/>
 <browser type="content" scrollbars="no" width="500" height="500" src="http://www.myweb.com" flex="1"/>
</groupbox>     
  </vbox>

Now I want to hide the scroll bars which appear in my browser xul element. It is because I just wanna show a part of my site 500x500. I don't know what propierty I should set off :S

THank you, DIego

Upvotes: 0

Filipe Silva
Filipe Silva

Reputation: 21657

You can put an IFRAME inside your panel and show it there:

In your XUL:

<vbox id="iframeContainerContainer" align="top">
    <iframe id="myframe" width="100" height="100"/>
</vbox>

In your JS:

var iframe = document.getElementById("myframe");
iframe.setAttribute("src","http://www.google.com");

This is a basic implementation. For more details, see the documentation

Upvotes: 1

Related Questions