There are two possible ways to do this.
Location change detection
The nsIWebProgressListener interface is used to determine when the window location has changed. Put something like this in the onLoad window handler:
Please note that onLocationChange triggered every time the window location is changed. This means that it starts when the browser starts, when a new URL is loaded into the current tab, when the tab changes, etc. This is probably what you want if your goal is to update the status bar based on the current URL load.
Detecting Tab Changes
To determine only the case when a new tab was selected, use the TabSelect event. The full example is copied here:
function exampleTabSelected(event) { var browser = gBrowser.selectedBrowser;
source share