I am working on a Firefox extension. For this I need the current URL. I tried both possibilities with the following result:
location.href   >  chrome://browser/content/browser.xul
document.URL    >  undefined
They are called in the event if a menu button is clicked. Why is it not working?
 
    