AutoHandleJumpLinks.user.js 730 B

1234567891011121314151617181920212223
  1. // ==UserScript==
  2. // @name 自动处理跳转外链
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 自动处理很多网站跳转外链需要手动确认的问题
  6. // @author westinyang
  7. // @match *://gitee.com/link?target=*
  8. // @match *://www.oschina.net/action/GoToLink?url=*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=gitee.com
  10. // @grant none
  11. // ==/UserScript==
  12. (function() {
  13. 'use strict';
  14. window.location.search.substr(1).split("&").every((item) => {
  15. let val = item.split("=")[1];
  16. if (val.startsWith("http")) {
  17. location.href = decodeURIComponent(val);
  18. return false;
  19. }
  20. });
  21. })();