Edit: I was able to go one step further 🙂
PSEUDO CODE (what I want)
if (CurrentTabURL == empty Tab) and (Tab.Count == 1)
{close Firefox}
else
{close Tab}
MY CODE (only the if statements don’t work. Both actions are working)
if (gBrowser.currentURI == "")
and (tabbrowser.browsers.length == 1)
then
goQuitApplication();
else
gBrowser.removeTab(gBrowser.mCurrentTab);
end
This link helped me a lot.
gBrowser.currentURIis annsIURIinstance. If you want to compare the URL to a string you should look atgBrowser.currentURI.spec. The URL of an “empty tab” isabout:blankby the way. Also, I guess that you want to use JavaScript? Corrected code: