Is there a way with Firefox Add-on SDK to get the URL while user is typing it in the location field?
Yes and no. Yes it is possible, but not within the SDK standard API.
navigator:browser
, chrome://browser/content/browser.xul
). window/utils::windows()
may help here, but it has the drawback that it will not notify you about new windows. However, you can use require("chrome")
and nsIWindowWatcher.registerNotification
for that.addEventListener
DOM API. The DOM element in browser.xul
you're looking for is #urlbar
.