Skip to content

Utility for intercepting in-flight XHR requests and modifying the URL before they are sent

License

Notifications You must be signed in to change notification settings

loganbussey/xhr-intercept

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XHR Intercept

A small utility to intercept in-flight XHR requests and to change the URL before they are sent. Useful for modifying the API endpoint URLs of externally loaded tracking scripts if running your own proxy. E.g. @loganbussey/change-segment-metric-host

Installation & Usage

NPM

$ npm install @loganbussey/xhr-intercept --save

import xhrIntercept from '@loganbussey/xhr-intercept';

xhrIntercept('api.foo.com', 'api.bar.com');

About

Utility for intercepting in-flight XHR requests and modifying the URL before they are sent

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published