QQ链接自动打开

PC上使用QQ、QQ邮箱,微云文档点开链接,浏览器提示非QQ官方链接页面时自动打开对应的链接。另外支持CSDN,简书,贴吧,微博,酷安,知乎,nodeseek

  1. // ==UserScript==
  2. // @name QQ链接自动打开
  3. // @namespace http://yeyu1024.xyz
  4. // @version 2.4
  5. // @description PC上使用QQ、QQ邮箱,微云文档点开链接,浏览器提示非QQ官方链接页面时自动打开对应的链接。另外支持CSDN,简书,贴吧,微博,酷安,知乎,nodeseek
  6. // @author 夜雨
  7. // @match *://c.pc.qq.com/*
  8. // @match *://weixin110.qq.com/cgi-bin/*
  9. // @match *://link.zhihu.com/*
  10. // @match *://mail.qq.com/cgi-bin/*
  11. // @match *://*.bdimg.com/safecheck/*
  12. // @match *://t.cn/*
  13. // @match *://*.coolapk.com/*
  14. // @match *://*.jianshu.com/go-wild*
  15. // @match *://link.csdn.net/*
  16. // @match *://google.urlshare.cn/umirror_url_check*
  17. // @match *://www.nodeseek.com/jump?to=*
  18. // @icon https://mat1.gtimg.com/www/icon/favicon2.ico
  19. // @grant none
  20. // @license MIT
  21. // ==/UserScript==
  22.  
  23. (function() {
  24. 'use strict';
  25.  
  26. function getParams(name){
  27. let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  28. let r = window.location.search.substr(1).match(reg);
  29. if (r != null) return decodeURIComponent(r[2]);
  30. return '';
  31. }
  32.  
  33.  
  34. let linkUrl = ""
  35.  
  36. if(location.href.includes('c.pc.qq.com')){
  37. linkUrl = getParams('pfurl') || getParams('url');
  38. //debugger;
  39. if(!linkUrl){
  40. linkUrl = document.querySelector("div.safety-url").innerText;
  41. }
  42. }
  43.  
  44. if(location.href.includes('bdimg.com')){
  45. document.querySelector("a.btn.btn-next").click()
  46. }
  47.  
  48. if(location.href.includes('t.cn')){
  49. document.querySelector(".open-url a").click()
  50. }
  51.  
  52. //酷安 https://www.coolapk.com/link?url=https%3A%2F%2Fwwu.lanzoub.com%2Fb0387ekmf
  53. if(location.href.includes('coolapk.com\/link')){
  54. linkUrl = getParams('url');
  55.  
  56. }
  57.  
  58. //知乎
  59. if(location.href.includes('zhihu.com')){
  60. linkUrl = getParams('target');
  61. }
  62.  
  63. //简书
  64. if(location.href.includes('jianshu.com')){
  65. linkUrl = getParams('url');
  66. }
  67.  
  68. //csdn
  69. if(location.href.includes('link.csdn.net')){
  70. linkUrl = getParams('target');
  71. }
  72.  
  73. //微云文档
  74. if(location.href.includes('google.urlshare.cn')){
  75. linkUrl = getParams('url');
  76. }
  77.  
  78. //nodeseek
  79. if(location.href.includes('nodeseek.com\/jump')){
  80. linkUrl = getParams('to');
  81. }
  82.  
  83. //weixin
  84. if(location.href.includes('weixin110')){
  85. linkUrl = document.querySelector(".weui-msg__desc").innerText
  86. }
  87.  
  88. if(location.href.includes('mail.qq.com')){
  89.  
  90. try{
  91. goUrl(1);
  92. console.log("goUrl: ")
  93. return;
  94. }catch (e) {
  95. console.log("exception:", e)
  96. linkUrl = document.querySelector("div.safety-url").innerText;
  97. }
  98.  
  99. }
  100.  
  101. linkUrl && (window.location.href = linkUrl.startsWith("http")? linkUrl:`http://${linkUrl}`) ;
  102.  
  103.  
  104. })();

QingJ © 2025

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