changed network detection algorithm to comply with same origin policy due to changes as a result of js being stored locally