A Chrome Extension for redirecting/forwarding request urls.
- Redirect
request.url
- Global switch control
- Disable browser cache
- JSON comments
- Rule suggestions
- CORS
- CORS & browser cache control
- Rules Grouping
更多说明:https://yuque.com/jiushen/blog/xswitch-readme
Rules will be executed in order before all requests are initiated.
{
// proxyRules
"proxy": [
[
"//alinw.alicdn.com/platform/daily-test/isDaily.js",
"//alinw.alicdn.com/platform/daily-test/isDaily.json"
],
// string replace, global mode
[
"alinw",
"g"
]
// replace all x.min to x
[
".min",
""
],
// use reg
[
"(.*)/platform/daily-test/(.*).js$",
"http://127.0.0.1:3000/daily-test/$1.js"
],
// replace to inline JavaScript
[
"https://alinw.alicdn.com/platform/daily-test/isDaily.js",
"data:text/javascript,window.__isDaily = true;"
]
],
// urls that want CORS
"cors": [
"cors.a.com",
"(.*).b.com"
]
}