title: Adding X-CSRF-Token header globally to all instances of XMLHttpRequest();
body: <p>I am using a third party library which spawns a raw <code>XMLHttpRequest</code> with <code>new XMLHttpRequest</code>.</p>
  
  <p>This bypasses my CSRF protection and gets shot down by my rails server. </p>
  
  <p>Is there a way to globally add a predefined CSRF token (<code>$('meta[name=csrf-token]').attr('content')</code>) to ALL instances of <code>XMLHttpRequest</code> at instantiation time?</p>