GithubHelp home page GithubHelp logo

ydx-2147483647 / bit-webvpn-converter-web-extension Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 60 KB

BIT WebVPN URL 双向转换器。 (浏览器扩展)

HTML 4.36% JavaScript 94.55% CSS 1.09%
beijing-institute-of-technology browser-extension webvpn

bit-webvpn-converter-web-extension's Introduction

BIT WebVPN URL 双向转换器(浏览器扩展)

best of BITs Mozilla Add-on version Mozilla Add-on rating Mozilla Add-on users

这个转换器相互转换内外 URL(普通校内网 URL 与校外网 WebVPN URL)。

校外无法访问普通 URL,校内无法访问 WebVPN URL。

转换原理源自 spencerwooo/🥑 WEBVPN URL Converter(及其网页)。此项目并不打算再做一个这样的网页,而是做成浏览器插件。

功能

  • 右键菜单:转换并在新标签页打开。(自动识别转换方向)

    context-menu

    目前只有 Firefox 版支持关闭此功能。(扩展管理页 → 选项)

  • 工具栏:打开标签页或复制 URL。

    popup

  • 选项页webvpn.swo.moe 极简版。

    options

  • 自动重定向

    访问校内网页,直接重定向到 Web VPN 相应页面。(反向也可以)

    redirect

    此功能默认关闭,需要到“扩展管理页 → 选项 → 重定向”打开。目前只有 Firefox 版支持。

    需规定重定向范围,只要访问的 URL 命中就会转换(自动识别转换方向)并重定向。以下是些示例。

    *://century.bit.edu.cn/*
    *://cxcy.bit.edu.cn/*
    *://dekt.bit.edu.cn/*
    *://dzb.bit.edu.cn/*
    *://jwms.bit.edu.cn/*
    *://mec.bit.edu.cn/*
    *://student.bit.edu.cn/*
    *://*.info.bit.edu.cn/*
    
    https://webvpn.bit.edu.cn/https/*
    https://webvpn.bit.edu.cn/http/*
    

    详细规则请参考 WebExtensions 的匹配模式

安装

  • Chromium(Chrome、Edge、…)

    请移步另一仓库

  • Firefox已上架 AMO,直接添加即可。

    以下是开发测试方法

    1. 下载或克隆本仓库。
    2. 在 Firefox 地址栏输入about:debugging →(侧边栏)此 Firefox。
    3. 临时扩展 → 临时载入附加组件,选择本仓库的src/manifest.json

潜在疑问

为何需要□□权限?

括号内为涉及的功能。

  • menus:在右键菜单增加转换按钮。(右键菜单)
  • tabs:在新标签页打开转换后的 URL。(右键菜单、工具栏)
  • storage:存储设置。
  • (可选)clipboardWrite:复制转换后的 URL。(工具栏)
  • (可选)webRequestwebRequestBlocking<all_urls>:修改网络请求。(自动重定向)

图标?

现在的图标是随便画的,随时准备换掉……如果您有想法,可以提出议题(issue)。

Chromium 版和 Firefox 版有什么区别?

  • 兼容性:Chromium 版采用 Manifest V3,而 Firefox 版采用 V2。
  • 功能:Chromium 版不支持关闭右键菜单,也不支持“自动重定向”,而 Firefox 版支持。

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.