sprd/lib/raygun.js
function makePostCorsRequest (url, data) {
        var xhr = createCORSRequest('POST', url, data);

        if (typeof _beforeXHRCallback === 'function') {
            _beforeXHRCallback(xhr);
        }

        if ('withCredentials' in xhr) {

            xhr.onreadystatechange = function() {
                if (xhr.readyState !== 4) {
                    return;
                }

                if (xhr.status === 202) {
                    sendSavedErrors();
                } else if (_enableOfflineSave && xhr.status !== 403 && xhr.status !== 400 && xhr.status !== 429) {
                    offlineSave(url, data);
                }
            };

            xhr.onload = function() {
                _private.log('posted to Raygun');

                callAfterSend(this);
            };

        } else if (window.XDomainRequest) {
            xhr.ontimeout = function() {
                if (_enableOfflineSave) {
                    _private.log('Raygun: saved locally');
                    offlineSave(url, data);
                }
            };

            xhr.onload = function() {
                _private.log('posted to Raygun');

                sendSavedErrors();
                callAfterSend(this);
            };
        }

        xhr.onerror = function() {
            _private.log('failed to post to Raygun');

            callAfterSend(this);
        };

        if (!xhr) {
            _private.log('CORS not supported');
            return;
        }

        xhr.send(data);
    }
function makePostCorsRequest (url, data) {
        var xhr = createCORSRequest('POST', url, data);

        if (typeof _beforeXHRCallback === 'function') {
            _beforeXHRCallback(xhr);
        }

        if ('withCredentials' in xhr) {

            xhr.onreadystatechange = function() {
                if (xhr.readyState !== 4) {
                    return;
                }

                if (xhr.status === 202) {
                    sendSavedErrors();
                } else if (_enableOfflineSave && xhr.status !== 403 && xhr.status !== 400 && xhr.status !== 429) {
                    offlineSave(url, data);
                }
            };

            xhr.onload = function() {
                _private.log('posted to Raygun');

                callAfterSend(this);
            };

        } else if (window.XDomainRequest) {
            xhr.ontimeout = function() {
                if (_enableOfflineSave) {
                    _private.log('Raygun: saved locally');
                    offlineSave(url, data);
                }
            };

            xhr.onload = function() {
                _private.log('posted to Raygun');

                sendSavedErrors();
                callAfterSend(this);
            };
        }

        xhr.onerror = function() {
            _private.log('failed to post to Raygun');

            callAfterSend(this);
        };

        if (!xhr) {
            _private.log('CORS not supported');
            return;
        }

        xhr.send(data);
    }
function makePostCorsRequest ( url , data ) { var xhr = createCORSRequest ( 'POST' , url , data ) ; if ( typeof _beforeXHRCallback === 'function' ) { _beforeXHRCallback ( xhr ) ; } if ( 'withCredentials' in xhr ) { xhr . onreadystatechange = function ( ) { if ( xhr . readyState !== 4 ) { return ; } if ( xhr . status === 202 ) { sendSavedErrors ( ) ; } else if ( _enableOfflineSave && xhr . status !== 403 && xhr . status !== 400 && xhr . status !== 429 ) { offlineSave ( url , data ) ; } } ; xhr . onload = function ( ) { _private . log ( 'posted to Raygun' ) ; callAfterSend ( this ) ; } ; } else if ( window . XDomainRequest ) { xhr . ontimeout = function ( ) { if ( _enableOfflineSave ) { _private . log ( 'Raygun: saved locally' ) ; offlineSave ( url , data ) ; } } ; xhr . onload = function ( ) { _private . log ( 'posted to Raygun' ) ; sendSavedErrors ( ) ; callAfterSend ( this ) ; } ; } xhr . onerror = function ( ) { _private . log ( 'failed to post to Raygun' ) ; callAfterSend ( this ) ; } ; if ( ! xhr ) { _private . log ( 'CORS not supported' ) ; return ; } xhr . send ( data ) ; }
Make the actual CORS request.
Make the actual CORS request .