Why is onBeforeAjax invoked several times for one request?

I have following code

webix.attachEvent("onBeforeAjax", function(mode, url, data, request, headers) {
    console.log("url: " + url);
});

When arise any request i see several lines in my logs, but browser shows only one request. Why so?

Not sure. Normally it must one onBeforeAjax call for one request.

It possible that code aborts XHR requests ( for example if you are calling some.load(url); some.clearAll();, such code will start request, call onBeforeAjax and abort the request. As result there will be onBeforeAjax call, but there will not be a real request.

How can i write some code which will be invoked only once for one real request?

May be it will useful for someone, I’ve found solution as redefine send message in XMLHttpRequest prototype