Get current page URL from a firefox sidebar extension

Hintswen picture Hintswen · Jan 4, 2009 · Viewed 19.8k times · Source

I'm writing a sidebar extension for Firefox and need a way to get the URL of the current page so I can check it against a database and display the results. How can I do this?

Answer

raymi picture raymi · Jun 20, 2010

I stumbled over this post while looking for an answer to the same question.

Actually I think it's as easy as

alert(window.content.location.href)

See also https://developer.mozilla.org/en/DOM/window.content