jQuery Element Logger para chrome v.54+

Añade la funcionalidad de Log al navegador Chrome, desparacida a partir de la version 54

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

You will need to install an extension such as Tampermonkey to install this script.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         jQuery Element Logger para chrome v.54+
// @description  Añade la funcionalidad de Log al navegador Chrome, desparacida a partir de la version 54
// @namespace    http://tampermonkey.net/
// @version      0.2
// @author       Divisadero LABS
// @match        http*://*/*
// @grant        none
// @run-at document-start
// ==/UserScript==


window.logManager =  {
    debug:false,
    trigger:localStorage.getItem('dsd_logmanager') || "LOAD",
    triggerDictionary: ["ALWAYS","READY","LOAD","NEVER"],
    setTrigger:function(moment){
        if(this.triggerDictionary.indexOf(moment) > -1){
            localStorage.setItem('dsd_logmanager',moment);
            this.trigger = moment;
            this.executeTrigger();
        }else{
            console.error('Error logManager: Not a valid trigger. Possible Values ["ALWAYS","READY","LOAD","NEVER"]');
            return false;
        }
    },
    executeTrigger: function(){
        switch(this.trigger){
            case "ALWAYS":
                this.debug = true;
                break;
            case "READY":
                var _self = this;
                document.addEventListener('DOMContentLoaded', function() {
                    _self.debug = true;
                });
                break;
            case "LOAD":
                var _self = this;
                window.addEventListener('load', function() {
                    _self.debug = true;
                });
                break;
            case "NEVER":
                this.debug = false;
                break;
        }
    },
    log:function(){
        if(this.debug){
            console.log.apply(this,arguments);
        }
    }
};
logManager.executeTrigger();
var jQueryInterval = setInterval(function(){
    if(window.jQuery){
        clearInterval(jQueryInterval);
        (function($) {
            var jQueryInit = $.fn.init;

            $.fn.init = function(arg1, arg2, rootjQuery){
                var jQueryShit = new jQueryInit(arg1, arg2, rootjQuery);
                for(var i = 0; i < jQueryShit.length; i++){
                    logManager.log(jQueryShit[i]);
                }
                return jQueryShit;
            };
        })(jQuery);
    }
},100);
// After 5 seconds of not jQuery loaded the interval is removed
setTimeout(function(){clearInterval(jQueryInterval);},5000);