Escape From WebVPN

避免WebVPN劫持CC98站外链接

  1. // ==UserScript==
  2. // @name Escape From WebVPN
  3. // @version 0.0.4
  4. // @description 避免WebVPN劫持CC98站外链接
  5. // @icon https://www.cc98.org/static/98icon.ico
  6.  
  7. // @author ml98
  8. // @namespace http://tampermonkey.net/
  9. // @license MIT
  10.  
  11. // @match http://www-cc98-org-s.webvpn.zju.edu.cn:8001/*
  12. // @run-at document-idle
  13. // @grant none
  14. // ==/UserScript==
  15.  
  16. /* eslint-env jquery */
  17. /* global revertUrl */
  18.  
  19. $(document).on('click', 'a', function(e) {
  20. if(revertUrl && this.href && !(new URL(this.href).host.includes('cc98.org'))) {
  21. e.preventDefault();
  22. window.open().location = revertUrl(this.href);
  23. return false;
  24. }
  25. });