• 16-08-2022, 18:44:03
    #1
    Product Designer
    konu kilit
  • 16-08-2022, 22:26:52
    #2
    Product Designer
    konu aktif
  • 16-08-2022, 22:48:46
    #3
    hsyildirim adlı üyeden alıntı: mesajı görüntüle
    Sayfanızın kaydırma performansını artırmak için dokunma ve ve tekerlek etkinliği işleyicilerini `passive` olarak işaretlemeyi değerlendirin. Daha fazla bilgi.
    siteadi.com::65:0
    siteadi.com:271:0
    hataları vermekte.
    Araştırdım

    (function() { var supportsPassive = eventListenerOptionsSupported(); if (supportsPassive) { var addEvent = EventTarget.prototype.addEventListener; overwriteAddEvent(addEvent); } function overwriteAddEvent(superMethod) { var defaultOptions = { passive: true, capture: false }; EventTarget.prototype.addEventListener = function(type, listener, options) { var usesListenerOptions = typeof options === 'object'; var useCapture = usesListenerOptions ? options.capture : options; options = usesListenerOptions ? options : {}; options.passive = options.passive !== undefined ? options.passive : defaultOptions.passive; options.capture = useCapture !== undefined ? useCapture : defaultOptions.capture; superMethod.call(this, type, listener, options); }; } function eventListenerOptionsSupported() { var supported = false; try { var opts = Object.defineProperty({}, 'passive', { get: function() { supported = true; } }); window.addEventListener("test", null, opts); } catch (e) {} return supported; } })();

    betheme kullanıyorum bu kodu temanın custom.js içerisine koydum fakat yine aynı uyarıyı search console tarafından hem mobilde hem masaüstünde alıyorum.
    Fikri olan var mı? Saygılarımla
    hsyildirim adlı üyeden alıntı: mesajı görüntüle
    konu aktif
    /**
     * R10 MESSI
     */
    
    function wp_dereg_script_comment_reply(){wp_deregister_script( 'comment-reply' );}
    add_action('init','wp_dereg_script_comment_reply');
    
    add_action('wp_head', 'wp_reload_script_comment_reply');
    function wp_reload_script_comment_reply() {
        ?>
    <script>
    //Function checks if a given script is already loaded
    function isScriptLoaded(src){
        return document.querySelector('script[src="' + src + '"]') ? true : false;
    }
    //When a reply link is clicked, check if reply-script is loaded. If not, load it and emulate the click
    var repLinks = document.getElementsByClassName("comment-reply-link");
    for (var i=0; i < repLinks.length; i++) {
        repLinks[i].onclick = function() { 
        if(!(isScriptLoaded("/wp-includes/js/comment-reply.min.js"))){
            var script = document.createElement('script');
            script.src = "/wp-includes/js/comment-reply.min.js";
        script.onload = emRepClick(event.target.getAttribute('data-commentid'));        
            document.head.appendChild(script);
        }
    }
    };
    //Function waits 50 ms before it emulates a click on the relevant reply link now that the reply script is loaded
    function emRepClick(comId) {
    sleep(50).then(() => {
    document.querySelectorAll('[data-commentid="'+comId+'"]')[0].dispatchEvent(new Event('click'));
    });
    }
    //Function does nothing, for a given amount of time
    function sleep (time) {
      return new Promise((resolve) => setTimeout(resolve, time));
    }
    </script>
        <?php
    }

    Bu kodu yazınca o hatanın kalkması gerekiyor.
  • 16-08-2022, 23:05:24
    #4
    Kodu function.php en altına ekleyin.
  • 17-08-2022, 10:57:01
    #5
    Product Designer
    Messi adlı üyeden alıntı: mesajı görüntüle
    Kodu function.php en altına ekleyin.
    maalesef sonuc degısmedı