简书取消外链跳转确认

直接去掉a标签中的外链确认部分

  1. // ==UserScript==
  2. // @name 简书取消外链跳转确认
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1.3
  5. // @description 直接去掉a标签中的外链确认部分
  6. // @author topcloud
  7. // @match *://www.jianshu.com/*
  8. // @grant none
  9. // @run-at document-end
  10. // ==/UserScript==
  11.  
  12. // 根据网速自己设置时间间隔
  13. var waitTime = 3000;
  14.  
  15. (function() {
  16. 'use strict';
  17. setTimeout(function () {
  18. // 文章部分
  19. var container = document.querySelector('.ouvJEz');
  20.  
  21. var aList = container.getElementsByTagName('a');
  22. for (var i = 0; i < aList.length; ++i) {
  23. // 不带有跳转确认的链接
  24. if (aList[i].href.indexOf('links.jianshu.com') == -1 && aList[i].href.indexOf('link.jianshu.com') == -1) {
  25. continue;
  26. }
  27.  
  28. // 截取真实url
  29. var href = aList[i].href;
  30. var newUrl = href.substr(href.indexOf('=') + 1);
  31. // 解码并替换
  32. aList[i].href = decodeURIComponent(newUrl);
  33. }
  34. }, waitTime);
  35. })();

QingJ © 2025

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