Giter Site home page Giter Site logo

ynchuan / xswitch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yize/xswitch

0.0 2.0 0.0 3.64 MB

A Chrome Extension for redirecting/forwarding request urls

Home Page: https://chrome.google.com/webstore/detail/xswitch/idkjhjggpffolpidfkikidcokdkdaogg

License: MIT License

HTML 0.26% TypeScript 5.29% JavaScript 94.23% Shell 0.02% CSS 0.20%

xswitch's Introduction

English

XSwitch

Chrome version Chrome version Build Status Coverage Status license

一个用来做请求链接转发的 Chrome 浏览器插件,因为采用的是浏览器原生 API,安全性和性能能得到保障。

XSwitch-intro

优酷视频介绍

功能

  • 请求地址转发
  • 全局插件启用开关
  • 可禁用浏览器缓存
  • 可在 JSON 中写注释
  • 自动补全
  • 支持 CORS,支持 withCredentials
  • 跨域和缓存禁用键
  • 分组规则

用法

所有的规则,会按照定义的顺序从前往后执行,即使匹配到了规则,也会继续往下匹配。

小提示:把 HTTPS 的链接转发到 http://127.0.0.1 下,浏览器不会出安全提示。如果之前习惯用 localhost 的同学,可以尝试下。

{
  // 转发规则
  "proxy": [
    [
      "//alinw.alicdn.com/platform/daily-test/isDaily.js", // 匹配 URL
      "//alinw.alicdn.com/platform/daily-test/isDaily.json" // 替换成这个 URL
    ],
    // 字符串替换,会全局匹配
    [
      "alinw",
      "g"
    ]
    // 把链接里所有的 .min 替换掉
    // [
    //   ".min",
    //   ""
    // ],
    // 正则
    // [
    //   "(.*)/platform/daily-test/(.*).js$",
    //   "http://127.0.0.1:3000/daily-test/$1.js"
    // ],
    // 直接转换成 inline 模式的 JavaScript
    // [
    //   "https://alinw.alicdn.com/platform/daily-test/isDaily.js",
    //   "data:text/javascript,window.__isDaily = true;"
    // ]
  ],
  // 希望开启 CORS 跨域的链接
  "cors": [
    "cors.a.com",
    "(.*).b.com"
  ]
}

更多说明:https://yuque.com/jiushen/blog/xswitch-readme

License

MIT © yize.shc

xswitch's People

Contributors

creamidea avatar suikaxin avatar yize avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.