Skip to content

Latest commit

 

History

History
86 lines (72 loc) · 2.6 KB

readme.en_US.md

File metadata and controls

86 lines (72 loc) · 2.6 KB

中文版

XSwitch

Chrome version Chrome version Build Status Coverage Status license

A Chrome Extension for redirecting/forwarding request urls.

Features

  • Redirect request.url
  • Global switch control
  • Disable browser cache
  • JSON comments
  • Rule suggestions
  • CORS
  • CORS & browser cache control
  • Rules Grouping

Usage

更多说明: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"
  ]
}

License

MIT © yize.shc