Você pode fazer isso o tempo todo por padrão. Eu tenho lutado para quebrar a função jquery ou o método jquery.fn.init para fazer isso sem erros, mas você pode fazer uma alteração simples na fonte do jquery para fazer isso. Estão incluídas algumas linhas circundantes que você pode pesquisar. Eu recomendo procurar na fonte jquery porThe jQuery object is actually just the init constructor 'enhanced'
var
version = "3.3.1",
// Define a local copy of jQuery
jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
// Need init if jQuery is called (just allow error to be thrown if not included)
var result = new jQuery.fn.init( selector, context );
if ( result.length === 0 ) {
if (window.console && console.warn && context !== 'failsafe') {
if (selector != null) {
console.warn(
new Error('$(\''+selector+'\') selected nothing. Do $(sel, "failsafe") to silence warning. Context:'+context)
);
}
}
}
return result;
},
// Support: Android <=4.0 only
// Make sure we trim BOM and NBSP
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
jQuery.fn = jQuery.prototype = {
Por último, mas não menos importante, você pode obter o código fonte do jquery não compactado aqui: http://code.jquery.com/