V2EX Redirect

重定向 v2ex.com 的子域名至 www.v2ex.com

目前为 2021-04-07 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name V2EX Redirect
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Redirect subdomains of v2ex.com to www.v2ex.com
  6. // @description:ZH-CN 重定向 v2ex.com 的子域名至 www.v2ex.com
  7. // @author Jiachen Chen
  8. // @match *://*.v2ex.com/*
  9. // @match *://v2ex.com/*
  10. // @icon https://www.google.com/s2/favicons?domain=v2ex.com
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function () {
  15. "use strict";
  16.  
  17. if (location.hostname != "www.v2ex.com") {
  18. window.location.replace(
  19. "https://www.v2ex.com" +
  20. location.pathname +
  21. location.search +
  22. location.hash
  23. );
  24. }
  25. })();