I'm learning how to make a firefox extension. I have created a xul and overlay file that makes a sidebar in my browser. I'm trying to put buttons in my sidebar that load different pages within the main browser window. I'm not sure how to access the main browser window and load a new url within it. I have here a simple button and script to show you what I have so far. Any light on this subject would be greatly appreciated! Thanks
<script type="application/x-javascript">
function loadURL(url) {
// I know this part is wrong. How do I load url into main browser??
window.content.open(url)
}
</script>
<button
id="identifier"
class="dialog"
label="Yahoo"
image="images/image.jpg"
oncommand="loadURL("http://www.yahoo.com);"/>
-
You should be able to access active tab window context in the following way:
function loadURL(url) { content.wrappedJSObject.location = url; }chris donnelly : This was exactly what I needed! Works Perfect. Thanks!!From Sergey Ilinsky -
This another method!
document.getElementById('1').loadURI('http://tridz.com')From esafwan
0 comments:
Post a Comment