CodeByZach / pace

Automatically add a progress bar to your site.
https://codebyzach.github.io/pace/
MIT License
15.65k stars 1.91k forks source link

Synchronous XMLHttpRequest on the main thread is depreciated #532

Open netniV opened 2 years ago

netniV commented 2 years ago

Chrome is reporting depreciated request usage:

[Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

    RequestIntercept = (function(_super) {
        __extends(RequestIntercept, _super);

        function RequestIntercept() {
            var monitorXHR, _this = this;
            RequestIntercept.__super__.constructor.apply(this, arguments);
            monitorXHR = function(req) {
                var _open;
                _open = req.open;
                return req.open = function(type, url, async) {
                    if (shouldTrack(type)) {
                        _this.trigger('request', {
                            type: type,
                            url: url,
                            request: req
                        });
                    }
                    return _open.apply(req, arguments);
                }
                ;
            }

The error appears against the return _open.apply(req, arguments);

netniV commented 2 years ago

This is appearing whilst using pace as part of https://github.com/cacti/cacti/ project.