axios-chrome-messaging-adapter2
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,1 +0,1 @@ | ||
export {}; | ||
export declare const axiosInstance: import("axios").AxiosInstance; |
@@ -0,2 +1,7 @@ | ||
import axios from 'axios'; | ||
import { registerMessageHandler } from "./registerMessageHandler"; | ||
import { adapter } from "./adapter"; | ||
registerMessageHandler(); | ||
export var axiosInstance = axios.create({ | ||
adapter: adapter, | ||
}); |
{ | ||
"name": "axios-chrome-messaging-adapter2", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"main": "lib", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -0,13 +1,9 @@ | ||
For CORS request in chrome extensions,support chrome edge firefox. | ||
### Quick start | ||
If you are using a bundler, like webpack or rollup:, you'll just need to **`require`** the lib. If you are using a CDN, the lib will be available under **`window.axiosChromeMessagingAdapter`**. | ||
In your **background** script: | ||
```javascript | ||
import axios from 'axios'; | ||
import { registerMessageHandler } from 'axios-chrome-messaging-adapter'; | ||
// register the adapter message hanlder | ||
registerMessageHandler(); | ||
import 'axios-chrome-messaging-adapter2'; | ||
``` | ||
@@ -19,3 +15,3 @@ | ||
import axios from 'axios' | ||
import { adapter } from 'axios-chrome-messaging-adapter' | ||
import { adapter } from 'axios-chrome-messaging-adapter2' | ||
@@ -22,0 +18,0 @@ // tell axios to use the adapter for this request |
@@ -0,3 +1,9 @@ | ||
import axios from 'axios'; | ||
import {registerMessageHandler} from "./registerMessageHandler"; | ||
import {adapter} from "./adapter"; | ||
registerMessageHandler(); | ||
export const axiosInstance = axios.create({ | ||
adapter, | ||
}) |
6523
172
23