uProxy/uproxy — pull request #566 by lucyhe (2014-11-11 19:02:02+00:00)
Title: Open new login auth tab each time "Connect" is clicked.

Ran grunt test.

Ideally, clicking Connect should do something different depending on the situation:
1) If the auth tab is no longer active, but it still open in Chrome, clicking Connect should just make the auth tab active and refresh it.
2) If the user changes the URL of the auth tab (i.e. they use the same tab to navigate to another page), clicking Connect should open a new auth tab.
Unfortunately, if the user needs to go through another URL before landing at our auth URL, there doesn't seem to be an easy way to detect if the user has navigated away. (For example, the user's connection might first redirect the tab to land on a university wifi login page.)

The compromise here is that clicking Connect will just always open a new tab. A small problem with this is if the user ends up opening several login tabs. After successfully logging in with one tab, the other login tabs won't work anymore (but they won't aversely interfere with anything); however, the user will be redirected to an unsightly "This webpage was blocked by an extension" page if they try to complete logging in with any of the extra pages. I felt like this is better than refreshing the auth tab though (in case the user was doing something important in that tab, we dont want to reroute that tab.)

@salomegeo this also fixes the bug where if you navigate away and back in the auth tab, the login fails. (The onTabReplace function handles the id change!)