无须确认,直接跳转

让链接跳转提示自动跳转

  1. // ==UserScript==
  2. // @name 无须确认,直接跳转
  3. // @namespace Don't confirm, just redirect.
  4. // @match *://none/
  5. // @grant none
  6. // @version 0.0.3
  7. // @author -
  8. // @description 让链接跳转提示自动跳转
  9. // ==/UserScript==
  10. const rules = [
  11. { // Weibo
  12. reg: /^https?:\/\/t.cn\/\w+/i,
  13. isit: () => { return document.body.querySelectorAll('p').length === 2 && document.body.querySelectorAll('p.link').length === 1 },
  14. link: () => { return document.body.querySelector('p.link').innerText }
  15. },
  16. { // Other
  17. reg: /https?%3A(?:%2F%2F|\/\/)/i,
  18. isit: true,
  19. link: ()=>{ return decodeURIComponent(
  20. window.location.search
  21. .replace(/^.*?(https?%3A(?:%2F%2F|\/\/))/, '$1')
  22. .replace(/&.*$/, '')
  23. ) }
  24. }
  25. ]
  26. for(const rule of rules){
  27. if(rule.reg.test(window.location.href)){
  28. if(rule.isit()){
  29. window.location.href = rule.link()
  30. }
  31. break;
  32. }
  33. }

QingJ © 2025

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