GreasyFork - 在“代码”中显示 jQuery 警告 - jQuery 版

在查看 Greasy Fork镜像 代码页时,通过判断 @require 行中是否有 jquery,显示特大号红色 jQuery 警告。现更以 jQuery 版本呈现。

  1. // ==UserScript==
  2. // @name GreasyFork - jQuery Warning in the Code Tab with jQuery
  3. // @name:zh-CN GreasyFork - 在“代码”中显示 jQuery 警告 - jQuery 版
  4. // @description Match "jquery" in @require lines and show large jQuery warning when you are checking out the Code tab on Greasy Fork镜像. Now written with jQuery.
  5. // @description:zh-CN 在查看 Greasy Fork镜像 代码页时,通过判断 @require 行中是否有 jquery,显示特大号红色 jQuery 警告。现更以 jQuery 版本呈现。
  6. // @namespace RainSlide
  7. // @author RainSlide
  8. // @icon https://gf.qytechs.cn/packs/media/images/blacklogo96-b2384000fca45aa17e45eb417cbcbb59.png
  9. // @version 1.2.3
  10. // @license blessing
  11. // @require https://code.jquery.com/jquery-3.7.1.slim.min.js
  12. // @match https://gf.qytechs.cn/*/scripts/*/code
  13. // @grant none
  14. // ==/UserScript==
  15.  
  16. "use strict";
  17.  
  18. $( '.code-container > pre' )
  19. .first()
  20. .filter(
  21. ( index, pre ) =>
  22. /\n[ \t]*\/\/[ \t]*@require[ \t]+.+?jquery/
  23. .test( $( pre ).text() )
  24. )
  25. .parent()
  26. .before(
  27. $( '<p></p>' )
  28. .css( "text-align", "center" )
  29. .append(
  30. $( '<strong></strong>' )
  31. .text( "jQuery!!!" )
  32. .css({
  33. "color" : "red",
  34. "font-size" : "5em"
  35. })
  36. )
  37. );

QingJ © 2025

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