Intercept every request from Kibana plugin

Ahh ok, thanks!
So how would I rewrite the headers in the hacks.js?
Should I just set the default ajax header like this:

$.ajaxSetup({
    beforeSend: function (xhr)
    {
       xhr.setRequestHeader("SomeHeader","SomeValue");

    }
});

or

XMLHttpRequest.prototype.origOpen = XMLHttpRequest.prototype.open;
        XMLHttpRequest.prototype.open   = function () {
            this.origOpen.apply(this, arguments);
            this.setRequestHeader('SomeHeader', 'SomeValue');
        };

Or is there a more "Kibana"-way to do it?

Kind Regards!