Change url of javascript firefox tab
2 answers
The mozilla doc mentioned by TML has sample code for this in the section "Reuse by different criteria", but it's broken. The related page says to add this line to fix it:
tabbrowser.loadURI(url, tabbrowser.currentURI, "UTF-8");
However, if you already have a tab object (say from the addTab call earlier), then I think it's easier:
gBrowser.selectedTab = mytab; gBrowser.loadURI(myurl);
I don't see any way to change the url of a tab that is NOT selected, but that would be nice - I hate focus stealing.
UPDATE: here's how you do it, no tab selection. Plain:
gBrowser.getBrowserForTab(mytab).loadURI(myurl);
+2
a source to share