自动跳转链接

离开网站警告页面自动跳转

  1. // ==UserScript==
  2. // @name 自动跳转链接
  3. // @namespace autoJumpLink
  4. // @version 0.0.1
  5. // @description 离开网站警告页面自动跳转
  6. // @icon https://static.zhihu.com/heifetz/favicon.ico
  7.  
  8. // @match *://link.zhihu.com/*
  9. // @match *://link.csdn.net/*
  10. // @match *://link.juejin.cn/*
  11. // @match *://www.jianshu.com/go-wild*
  12. // @match *://www.oschina.net/action/GoToLink*
  13. // @match *://gitee.com/link*
  14. // @match *://weibo.cn/sinaurl*
  15.  
  16. // @match *://jump2.bdimg.com/*
  17.  
  18. // @author Bking
  19. // @license MIT
  20. // @run-at document-start
  21. // ==/UserScript==
  22.  
  23. (function () {
  24. 'use strict';
  25.  
  26. const url = new URL(window.location.href);
  27. // console.log(url);
  28. const parameters = {
  29. 'link.zhihu.com': 'target',
  30. 'link.csdn.net': 'target',
  31. 'link.juejin.cn': 'target',
  32. 'www.jianshu.com': 'url',
  33. 'www.oschina.net': 'url',
  34. 'gitee.com': 'target',
  35. 'weibo.cn': 'u',
  36. };
  37. const selectors = {
  38. 'jump2.bdimg.com': 'body > div > div.warning_info > p.link',
  39. };
  40.  
  41. if (parameters[url.host]) {
  42. location.replace(url.searchParams.get(parameters[url.host]));
  43. } else if (selectors[url.host]) {
  44. location.replace(document.querySelector(selectors[url.host]).innerHTML);
  45. }
  46. })();

QingJ © 2025

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