XUL and JavaScript question

Hi. I'm writing an extension for Mozilla Firefox, I want it to show the URL that is lodaded. The problem is that when I use this property
window.location.href
it shows "chrome://browser/content/browser.xul"
How can I access the URL that is loaded? thanks!
[287 byte] By [cespinoza1979] at [2007-11-20 10:54:56]
# 1 Re: XUL and JavaScript question
Whoops! Solved...

content.document.location

Sorry...
cespinoza1979 at 2007-11-8 0:43:06 >
# 2 Re: XUL and JavaScript question
Why don't you post your solution so that others may benefit?
PeejAvery at 2007-11-8 0:44:15 >
# 3 Re: XUL and JavaScript question
Ok, here is the solution, just using the content.document.location

URLActual = content.document.location; // Global variable

//This function is executed when another toolbar button is pressed

function Activar()
{
var boton2 = null; // Old and rusty programmer habit

var boton2 = document.getElementById("myextension-button2");
// That's the button in firefox's toolbar, where I want to show the current URL

URLActual = content.document.location;

if (boton2.disabled==false)
boton2.disabled = true; //I enable the button if disabled
else
boton2.disabled = false;
boton2.label = URLActual; // And I change the label

}

Now, what I would like to do is to refresh the global variable "URLActual" every time the url changes, I'm fighting with that right now...
cespinoza1979 at 2007-11-8 0:45:17 >