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

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

目前为 2020-10-11 提交的版本。查看 最新版本

// ==UserScript==
// @name        GreasyFork - jQuery Warning in the Code Tab
// @name:zh-CN  GreasyFork - 在“代码”中显示 jQuery 警告
// @description       Match "jquery" in @require lines and show large jQuery warning when you are checking out the Code tab on Greasy Fork镜像.
// @description:zh-CN 在查看 Greasy Fork镜像 代码页时,通过判断 @require 行中是否有 jquery,显示特大号红色 jQuery 警告。
// @namespace   RainSlide
// @author      RainSlide
// @icon        https://gf.qytechs.cn/assets/blacklogo96-1221dbbb8f0d47a728f968c35c2e2e03c64276a585b8dceb7a79a17a3f350e8a.png
// @version     1.1
// @match       https://gf.qytechs.cn/*/scripts/*/code
// @grant       none
// ==/UserScript==

"use strict";

(() => {
	const pre = document.querySelector('#script-content > pre');
	if (
		pre !== null &&
		/\n[ \t]*\/\/[ \t]*@require[ \t]+.+?jquery/.test(pre.textContent)
	) pre.parentNode.insertBefore(
		(() => {
			const p      = document.createElement("p");
			const strong = document.createElement("strong");
			p.style = "text-align: center;"
			strong.textContent = "jQuery!!!";
			strong.style = "color: red; font-size: 5em;";
			p.appendChild(strong);
			return p;
		})(), pre
	);
})();

QingJ © 2025

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