Hello, does anybody know, how to get URI of current page/tab?
The accepted answer here is incorrect, but the comment associated with it is a lot closer.
The FAQ linked in phsr's page links to "Getting document of currently selected tab", but Mozilla changed all their links without retaining backwards compatibility, and thus breaking a lot of reference sites.
The correct URL is: https://developer.mozilla.org/en/Extension_Code_Snippets/Tabbed_Browser#Getting_document_of_currently_selected_tab
This document explains how to get the document object as you'd expect to get in web-side Javascript.
Given than, you can easily ask for gBrowser.contentDocument.location.href
or content.document.location.href
. If your use-case is more complex than a script running on the active tab (eg Your script is running in a pop-up XUL window) then you're best to read the FAQ linked above.