OuterChainJump

自动跳转外链

  1. // ==UserScript==
  2. // @name OuterChainJump
  3. // @namespace cityTS
  4. // @version 0.1.4
  5. // @description 自动跳转外链
  6. // @author cityTS
  7. // @match *://link.zhihu.com/?target=*
  8. // @match *://link.juejin.cn/?target=*
  9. // @match *://www.jianshu.com/go-wild?ac=2&url=*
  10. // @match *://c.pc.qq.com/middlem.html?pfurl=*
  11. // @match *://gitee.com/link?target=*
  12. // @match *://link.csdn.net/?target=*
  13. // @match *://docs.qq.com/scenario/link.html?url=*
  14. // @match *://www.kdocs.cn/office/link?target=*
  15. // @match *://mail.qq.com/cgi-bin/readtemplate*
  16. // @match *://hd.nowcoder.com/link.html?target=*
  17. // @icon https://img.picgo.net/2023/03/10/R-Ccac3d9a7c5c66076.png
  18. // @grant none
  19. // @license MIT
  20. // ==/UserScript==
  21.  
  22. // 各大网站跳转页面中url的跳转参数名
  23. const siteJumpParamMap = new Map([
  24. ['link.zhihu.com','target'],
  25. ['link.csdn.net','target'],
  26. ['link.juejin.cn','target'],
  27. ['gitee.com','target'],
  28. ['www.jianshu.com','url'],
  29. ['c.pc.qq.com','pfurl'],
  30. ['docs.qq.com', 'url'],
  31. ['www.kdocs.cn', 'target'],
  32. ['mail.qq.com', 'gourl'],
  33. ['hd.nowcoder.com', 'target']
  34. ]);
  35.  
  36. (function() {
  37. 'use strict';
  38.  
  39. // 清空页面原有内容,防闪烁(非必须)
  40. window.document.documentElement.innerHTML=''
  41. // 获取URL中的请求参数
  42. const params = new URLSearchParams(location.search.substring(1));
  43. // 获取该网站的的跳转URL的参数名,进而获取目标URL
  44. const targetURL = params.get(siteJumpParamMap.get(location.hostname));
  45. // 利用replace()方法进行跳转,保证无用的跳转页面不会产生在历史记录中
  46. location.replace(targetURL);
  47. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址