jQuery Warning in the Code Tab with jQuery

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.

Verze ze dne 14. 02. 2020. Zobrazit nejnovější verzi.

// ==UserScript==
// @name       jQuery Warning in the Code Tab with jQuery
// @name:zh-CN 在“代码”中显示 jQuery 警告 - jQuery 版
// @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.
// @description:zh-CN 在查看 Greasy Fork 代码页时,通过判断 @require 行中是否有 jquery,显示特大号红色 jQuery 警告。现更以 jQuery 版本呈现。
// @author    RainSlide
// @namespace RainSlide
// @match     https://greasyfork.org/*/scripts/*/code
// @version   1.0
// @grant     none
// @require   https://code.jquery.com/jquery-3.4.1.slim.min.js
// ==/UserScript==

$( '#script-content > pre' )
	.first()
	.filter(
		( index, pre ) =>
			/\n[ \t]*\/\/[ \t]*@require[ \t]+.+?jquery/
				.test( $( pre ).text() )
	).before(
		$( '<p></p>' )
			.css( "text-align", "center" )
			.append(
				$( '<strong></strong>' )
					.text( "jQuery!!!" )
					.css({
						"color"     : "red",
						"font-size" : "5em"
					})
			)
	)