Improve XHR detection