Even better, popping up a JS alert stops further JS execution, so this was a clever way for Github to throttle connections (rather than them being made every 2 seconds as per the hijacked Baidu JS)
I see; I missed the part where the resource request was executed every 2 seconds. The alert essentially would make the page unusable. From my understanding that Baidu is Google for china, the amount of productivity lost since people not being able to search, would mean the hack backfired spectacularly.
Well, except for the fact that it only impacts people who access Baidu from outside the Chinese firewall. People who access Baidu from inside China would not have their Baidu use interrupted.