Greasy Fork 还支持 简体中文。

GreasyFork - jQuery Warning in the Code Tab

Match "jquery" in @require lines and show large jQuery warning when you are checking out the Code tab on Greasy Fork.

目前為 2021-04-03 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name GreasyFork - jQuery Warning in the Code Tab
  3. // @name:zh-CN GreasyFork - 在“代码”中显示 jQuery 警告
  4. // @description Match "jquery" in @require lines and show large jQuery warning when you are checking out the Code tab on Greasy Fork.
  5. // @description:zh-CN 在查看 Greasy Fork 代码页时,通过判断 @require 行中是否有 jquery,显示特大号红色 jQuery 警告。
  6. // @namespace RainSlide
  7. // @author RainSlide
  8. // @icon https://greasyfork.org/packs/media/images/blacklogo96-b2384000fca45aa17e45eb417cbcbb59.png
  9. // @version 1.2
  10. // @match https://greasyfork.org/*/scripts/*/code
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. "use strict";
  15.  
  16. (() => {
  17. const pre = document.querySelector('.code-container > pre');
  18. pre !== null &&
  19. /\n[ \t]*\/\/[ \t]*@require[ \t]+.+?jquery/.test(pre.textContent) &&
  20. pre.parentNode.parentNode.insertBefore(
  21. (() => {
  22. const p = document.createElement("p");
  23. const strong = document.createElement("strong");
  24. p.style = "text-align: center;"
  25. strong.textContent = "jQuery!!!";
  26. strong.style = "color: red; font-size: 5em;";
  27. p.appendChild(strong);
  28. return p;
  29. })(), pre.parentNode
  30. );
  31. })();