https://github.com/yize/xswitch
A Chrome Extension for redirecting/forwarding request urls
https://github.com/yize/xswitch
chrome-extension forwarding proxy redirect-urls redirecting-requests
Last synced: about 1 year ago
JSON representation
A Chrome Extension for redirecting/forwarding request urls
- Host: GitHub
- URL: https://github.com/yize/xswitch
- Owner: yize
- License: mit
- Created: 2018-01-11T03:35:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-11-01T08:46:23.000Z (over 3 years ago)
- Last Synced: 2025-04-12T14:55:54.488Z (about 1 year ago)
- Topics: chrome-extension, forwarding, proxy, redirect-urls, redirecting-requests
- Language: JavaScript
- Homepage: https://chrome.google.com/webstore/detail/xswitch/idkjhjggpffolpidfkikidcokdkdaogg
- Size: 11.5 MB
- Stars: 1,020
- Watchers: 11
- Forks: 125
- Open Issues: 34
-
Metadata Files:
- Readme: readme.en_US.md
Awesome Lists containing this project
README
[中文版](./readme.md)
## XSwitch
[![Chrome version][badge-cws]][link-cws] [![Chrome version][badge-cws-count]][link-cws] [![Build Status][badge-travis]][link-travis] [![Coverage Status][badge-coverage]][link-coverage] [![license][badge-license]][link-xswitch]
A [Chrome Extension][link-cws] for redirecting/forwarding request urls.
## Features
- [x] Redirect `request.url`
- [x] Global switch control
- [x] Disable browser cache
- [x] JSON comments
- [x] Rule suggestions
- [x] CORS
- [x] CORS & browser cache control
- [x] Rules Grouping
## Usage
更多说明:[https://yuque.com/jiushen/blog/xswitch-readme](https://yuque.com/jiushen/blog/xswitch-readme)
Rules will be executed in order before all requests are initiated.
```js
{
// 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"
]
}
```
## License
[MIT](https://opensource.org/licenses/MIT) © [yize.shc](https://www.yuque.com/jiushen)
[link-xswitch]: https://github.com/yize/xswitch
[link-cws]: https://chrome.google.com/webstore/detail/xswitch/idkjhjggpffolpidfkikidcokdkdaogg
[link-me]: https://github.com/Microsoft/monaco-editor
[link-travis]: https://travis-ci.org/yize/xswitch
[link-coverage]: https://coveralls.io/github/yize/xswitch?branch=master
[badge-travis]: https://travis-ci.org/yize/xswitch.svg?branch=master
[badge-coverage]: https://coveralls.io/repos/github/yize/xswitch/badge.svg?branch=master
[badge-license]: https://img.shields.io/github/license/yize/xswitch.svg
[badge-cws]: https://img.shields.io/chrome-web-store/v/idkjhjggpffolpidfkikidcokdkdaogg.svg?label=chrome
[badge-cws-count]: https://img.shields.io/chrome-web-store/users/idkjhjggpffolpidfkikidcokdkdaogg.svg