Created
March 2, 2016 20:18
-
-
Save mzabriskie/029c620ca97a45fd702d to your computer and use it in GitHub Desktop.
Auto detect Greasemonkey and use custom axios adapter if available
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
if (typeof GM_xmlhttpRequest === 'function') { | |
import GMAdapter from './GMAdapter'; | |
axios.defaults.adapter = GMAdapter; | |
} | |
export default axios; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment