Improve compatibility with XULRunner applications

XULRunner apps are not required to have tabs, so add a fallback to
connect to the application as a whole.