good target click

自动点击csdn zhihu,jianshu,cloud.tencent,infoq,nodeseek,qixinpro,gitee 弹出的拦截页面 自动跳转

  1. // ==UserScript==
  2. // @name good target click
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.8
  5. // @description 自动点击csdn zhihu,jianshu,cloud.tencent,infoq,nodeseek,qixinpro,gitee 弹出的拦截页面 自动跳转
  6. // @author lich
  7. // @match https://xie.infoq.cn/link?target=*
  8. // @match https://cloud.tencent.com/developer/tools/blog-entry?target=*
  9. // @match https://nav.qixinpro.com/sites/*
  10. // @match https://link.csdn.net/?target=*
  11. // @match https://link.zhihu.com/?target=*
  12. // @match https://link.juejin.cn/?target=*
  13. // @match https://www.jianshu.com/go-wild*
  14. // @match https://www.nodeseek.com/jump?to=*
  15. // @match https://gitee.com/link?target=*
  16. // @match https://www.oschina.net/action/GoToLink?url=*
  17. // @icon https://www.google.com/s2/favicons?sz=64&domain=infoq.cn
  18. // @grant none
  19. // @run-at document-end
  20. // @license MIT
  21. // ==/UserScript==
  22.  
  23. /**
  24. * 如何开始
  25. * 将需要添加的附属到 function是类上
  26. */
  27. (function() {
  28. 'use strict';
  29. var count = 100;
  30. var functions = {}
  31. var href = window.location.href;
  32. function getUrlParams(url) {
  33. let urlStr = url.split('?')[1]
  34. const urlSearchParams = new URLSearchParams(urlStr)
  35. const result = Object.fromEntries(urlSearchParams.entries())
  36. return result
  37. }
  38. function lazyTrigger(func) {
  39. var dom = func()
  40. if(count-- <0 || dom) {
  41. dom && (function(dom) {
  42. if(typeof dom === 'object') {
  43. dom.target && (dom.target = '')
  44. dom.click()
  45. } else {
  46. window.location.href = dom
  47. }
  48. })(dom)
  49. return;
  50. }
  51. setTimeout(function() {
  52. lazyTrigger(func)
  53. }, 200);
  54. }
  55. function fetchSearchTarget(name) {
  56. var search = getUrlParams(href) || {}
  57. return search[name] || '';
  58. }
  59. // infoq
  60. functions['infoq.cn'] = function() {
  61. return fetchSearchTarget('target');
  62. }
  63.  
  64. // cloud.tencent.com/developer
  65. functions['cloud.tencent.com/developer'] = function() {
  66. return fetchSearchTarget('target');
  67. }
  68. // nav.qixinpro.com/sites
  69. functions['nav.qixinpro.com/sites'] = function() {
  70. return document.querySelector('.site-go-url a');
  71. }
  72.  
  73. // csdn
  74. functions['link.csdn.net'] = function() {
  75. return fetchSearchTarget('target');
  76. }
  77.  
  78. // link zhihu
  79. functions['link.zhihu'] = function() {
  80. return fetchSearchTarget('target');
  81. }
  82. // link.juejin.cn
  83. functions['link.juejin.cn'] = function() {
  84. return fetchSearchTarget('target');
  85. }
  86.  
  87. functions['www.jianshu.com'] = function() {
  88. return fetchSearchTarget('url');
  89. }
  90.  
  91. functions['www.nodeseek.com'] = function() {
  92. return fetchSearchTarget('to');
  93. }
  94.  
  95. // gitee
  96. functions['gitee.com'] = function() {
  97. return fetchSearchTarget('target');
  98. }
  99. functions['www.oschina.net'] = function() {
  100. return fetchSearchTarget('url');
  101. }
  102.  
  103. Object.keys(functions).forEach(key => {
  104. if (href.includes(key)) {
  105. lazyTrigger(functions[key])
  106. }
  107. })
  108.  
  109.  
  110. })();

QingJ © 2025

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