Vol.moe新标签页打开链接

Vol.moe打开漫画页面链接时用新标签形式打开

  1. // ==UserScript==
  2. // @name Vol.moe新标签页打开链接
  3. // @namespace zhihaofans
  4. // @version 0.0.3
  5. // @description Vol.moe打开漫画页面链接时用新标签形式打开
  6. // @author zhihaofans
  7. // @match http://vol.moe/
  8. // @match http://vol.moe/list/*
  9. // @match https://vol.moe/
  10. // @match https://vol.moe/list/*
  11. // @require https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js
  12. // @grant Apache-2.0
  13. // @note 开源地址:https://github.com/zhihaofans/JavaScript-awesome/blob/master/greasyfork/volmoe.newpage.user.js
  14. // @note Greasyfork地址:https://gf.qytechs.cn/zh-CN/scripts/39773
  15. // ==/UserScript==
  16. String.prototype.startWith = function (str) {
  17. var reg = new RegExp("^" + str);
  18. return reg.test(this);
  19. };
  20. String.prototype.endWith = function (str) {
  21. var reg = new RegExp(str + "$");
  22. return reg.test(this);
  23. };
  24. (function () {
  25. jQuery.noConflict();
  26. jQuery(document).ready(function () {
  27. var links = jQuery("tr.listbg > td > a");
  28. for (var a = 0; a < links.length; a++) {
  29. var thisLink = jQuery(links[a]);
  30. if(thisLink.attr("href").indexOf("http://")>=0){
  31. thisLink.attr("href",thisLink.attr("href").replace("http://","https://"));
  32. }
  33. if (thisLink.attr("href").startWith("https://vol.moe/comic/") && thisLink.attr("href").endWith(".htm")) {
  34. thisLink.attr("target", "_black");
  35. }
  36. }
  37. });
  38. })();

QingJ © 2025

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