Workaround for phantomjs bug regarding navigator.onLine