{"id":8173,"date":"2025-02-06T17:22:08","date_gmt":"2025-02-06T16:22:08","guid":{"rendered":"https:\/\/tech.lobobrothers.com\/?p=8173"},"modified":"2025-02-07T08:56:51","modified_gmt":"2025-02-07T07:56:51","slug":"does-not-use-passive-listeners-to-improve-scrolling-wordpress","status":"publish","type":"post","link":"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/","title":{"rendered":"Does not use passive listeners to improve scrolling &#8211; WordPress"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"8173\" class=\"elementor elementor-8173 elementor-8147\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"elementor-element elementor-element-de8e40c e-flex e-con-boxed e-con e-parent\" data-id=\"de8e40c\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-2d9b948 elementor-widget elementor-widget-text-editor\" data-id=\"2d9b948\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h2>PAGESPEED WORDPRESS &#8211; DOES NOT USE PASSIVE LISTENER<\/h2>\n<p>In wordpress when we enable comments we find the warning in pagespeed and we can go a little crazy looking for where the problem is generated, being said comments the cause in this case.<\/p>\n<p>WordPress automatically loads certain JavaScript scripts that manage the comment functionality, such as validation and submission. Some of these scripts may include event listeners that are not configured as passive, which causes the warning in PageSpeed.<\/p>\n<p>If you search on the internet you will see many functions to disable this but it makes nested comments stop working, many others simply do not work in your installation.<\/p>\n<p>That is why we want to share with you a direct solution, although it may be somewhat overwhelming for some, but it is simple following the steps.<\/p>\n<p>The problem is in wp-includes\/js\/comment-reply.js where we find several listener events without the passive:true<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-8151 size-full\" src=\"https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2025\/02\/comment-reply-js.png.webp\" alt=\"file js comments wordpress\" width=\"931\" height=\"517\" srcset=\"https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2025\/02\/comment-reply-js.png 931w, https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2025\/02\/comment-reply-js-300x167.png 300w, https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2025\/02\/comment-reply-js-768x426.png 768w\" sizes=\"(max-width: 931px) 100vw, 931px\" \/><\/p>\n<p>We could simply add { passive: true } after each of the touchstart events, leaving something like this for each of them, example:<\/p>\n<p style=\"padding-left: 40px;\">element.addEventListener( &#8216;touchstart&#8217;, clickEvent, { passive: true } );<\/p>\n<p>But with a WordPress update it will go away again if the WordPress team has not added it in subsequent versions. If we want it to be permanent, we have to do it in the child theme, where we create a folder called js and inside a file called comment-reply-custom.js, where we could copy all the content of the original, make the changes and then in the functions.php unregister the original and register our custom, but this is not good enough either, because as it is the core of WordPress there will come a time when our custom will give problems for not being up to date.<\/p>\n<p><strong>So what do we do?<\/strong><\/p>\n<p>We create the js folder in our childtheme if we don&#8217;t have it and in the function.php of our child theme we add the following code. Of course, make a backup <strong>copy of the functions.php<\/strong> in case you have any problems when editing, like your cat suddenly jumping on the keyboard, hehe (It usually happens to me, they love the keyboard)<\/p>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-74a795c elementor-widget elementor-widget-code-highlight\" data-id=\"74a795c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-php line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-php\">\n\t\t\t\t\t<xmp>\/\/passive comments\nfunction modificar_comment_reply_js() {\n    $ruta_original = ABSPATH . WPINC . '\/js\/comment-reply.js';\n    $ruta_modificada = get_stylesheet_directory() . '\/js\/comment-reply-custom.js';\n\n    \/\/ If the original file has changed, regenerate the custom one\n    if (!file_exists($ruta_modificada) || filemtime($ruta_original) > filemtime($ruta_modificada)) {\n        $contenido = file_get_contents($ruta_original);\n        \n        \/\/ Replace all addEventListener without options\n        $contenido = preg_replace('\/addEventListener\\(([^,]+), ([^,]+)\\)\/', 'addEventListener($1, $2, { passive: true })', $contenido);\n\n        \/\/ Save the new modified file\n        file_put_contents($ruta_modificada, $contenido);\n    }\n\n    \/\/ Use the modified file instead of the original\n    wp_deregister_script('comment-reply');\n    wp_register_script(\n        'comment-reply',\n        get_stylesheet_directory_uri() . '\/js\/comment-reply-custom.js',\n        array('jquery'),\n        null,\n        true\n    );\n}\nadd_action('wp_enqueue_scripts', 'modificar_comment_reply_js', 100);\n<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c233180 elementor-widget elementor-widget-text-editor\" data-id=\"c233180\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>With this code we compare the original with the one we have in the js folder of the child theme and if it has changed we add the new one with the corresponding events with passive:true. If it does not exist it will simply create it with said events corrected if it does not have them.<\/p>\n<p>Once this is done, we delete the caches we have and in PageSpeed \u200b\u200bthe warning will have disappeared, improving your score and performance.<\/p>\n<p>TL.<\/p>\n<p>Have a nice day<\/p>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-532bd65 elementor-widget elementor-widget-heading\" data-id=\"532bd65\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">FAQS<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c511dd1 elementor-widget elementor-widget-toggle\" data-id=\"c511dd1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"toggle.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-toggle\">\n\t\t\t\t\t\t\t<div class=\"elementor-toggle-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-2061\" class=\"elementor-tab-title\" data-tab=\"1\" role=\"button\" aria-controls=\"elementor-tab-content-2061\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-toggle-icon elementor-toggle-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-toggle-icon-closed\"><svg class=\"e-font-icon-svg e-fas-caret-right\" viewBox=\"0 0 192 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-toggle-icon-opened\"><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-toggle-title\" tabindex=\"0\">What is an event listener in JavaScript?<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<div id=\"elementor-tab-content-2061\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"1\" role=\"region\" aria-labelledby=\"elementor-tab-title-2061\"><p>An event listener is a function that waits for an event to occur on an element, such as a click, mouse movement, or key press. It is used with addEventListener().<\/p>\n<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-toggle-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-2062\" class=\"elementor-tab-title\" data-tab=\"2\" role=\"button\" aria-controls=\"elementor-tab-content-2062\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-toggle-icon elementor-toggle-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-toggle-icon-closed\"><svg class=\"e-font-icon-svg e-fas-caret-right\" viewBox=\"0 0 192 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-toggle-icon-opened\"><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-toggle-title\" tabindex=\"0\">What is a child theme in WordPress?<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<div id=\"elementor-tab-content-2062\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"2\" role=\"region\" aria-labelledby=\"elementor-tab-title-2062\"><p>A child theme is a theme that inherits the design and functionality of another theme (the &#8220;parent theme&#8221;), allowing you to make changes without affecting the original.<\/p>\n<p>If you directly modify a theme and it is then updated, you will lose all your changes. With a child theme, you can customize it without worry.<\/p>\n<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-toggle-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-2063\" class=\"elementor-tab-title\" data-tab=\"3\" role=\"button\" aria-controls=\"elementor-tab-content-2063\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-toggle-icon elementor-toggle-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-toggle-icon-closed\"><svg class=\"e-font-icon-svg e-fas-caret-right\" viewBox=\"0 0 192 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-toggle-icon-opened\"><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-toggle-title\" tabindex=\"0\">What is the functions.php file?<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<div id=\"elementor-tab-content-2063\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"3\" role=\"region\" aria-labelledby=\"elementor-tab-title-2063\"><p>It is a WordPress file where you can add PHP code to modify or extend the functions of the theme without touching the WordPress core.<\/p>\n<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class=\"elementor-toggle-item\">\n\t\t\t\t\t<div id=\"elementor-tab-title-2064\" class=\"elementor-tab-title\" data-tab=\"4\" role=\"button\" aria-controls=\"elementor-tab-content-2064\" aria-expanded=\"false\">\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-toggle-icon elementor-toggle-icon-left\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-toggle-icon-closed\"><svg class=\"e-font-icon-svg e-fas-caret-right\" viewBox=\"0 0 192 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z\"><\/path><\/svg><\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-toggle-icon-opened\"><\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-toggle-title\" tabindex=\"0\">How do I create a child theme in WordPress?<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t\t\t\t<div id=\"elementor-tab-content-2064\" class=\"elementor-tab-content elementor-clearfix\" data-tab=\"4\" role=\"region\" aria-labelledby=\"elementor-tab-title-2064\"><p>Crea una carpeta en \/wp-content\/themes\/, por ejemplo, hello-chiltheme\/<\/p>\n<p>Dentro, agrega un archivo style.css con este contenido como ejemplo del child theme de Hello, cambiando obviamente los datos correspondientes a tu tema:<\/p>\n<blockquote><p>\/*<br \/>\nTheme Name: Hello Elementor Child<br \/>\nTheme URI: https:\/\/github.com\/elementor\/hello-theme-child\/<br \/>\nDescription: Hello Elementor Child is a child theme of Hello Elementor, created by Elementor team<br \/>\nAuthor: Elementor Team<br \/>\nAuthor URI: https:\/\/elementor.com\/<br \/>\nTemplate: hello-elementor<br \/>\nVersion: 2.0.0<br \/>\nText Domain: hello-elementor-child<br \/>\nLicense: GNU General Public License v3 or later.<br \/>\nLicense URI: https:\/\/www.gnu.org\/licenses\/gpl-3.0.html<br \/>\nTags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready<br \/>\n*\/<\/p>\n<p>\/* Add your custom styles here *\/<\/p><\/blockquote>\n<p>Many themes already give you the child theme to install and there are also plugins that create it for you.<\/p>\n<p>Once created you can activate it from WordPress<\/p>\n<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t<script type=\"application\/ld+json\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"What is an event listener in JavaScript?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"<p>An event listener is a function that waits for an event to occur on an element, such as a click, mouse movement, or key press. It is used with addEventListener().<\\\/p>\\n\"}},{\"@type\":\"Question\",\"name\":\"What is a child theme in WordPress?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"<p>A child theme is a theme that inherits the design and functionality of another theme (the &#8220;parent theme&#8221;), allowing you to make changes without affecting the original.<\\\/p>\\n<p>If you directly modify a theme and it is then updated, you will lose all your changes. With a child theme, you can customize it without worry.<\\\/p>\\n\"}},{\"@type\":\"Question\",\"name\":\"What is the functions.php file?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"<p>It is a WordPress file where you can add PHP code to modify or extend the functions of the theme without touching the WordPress core.<\\\/p>\\n\"}},{\"@type\":\"Question\",\"name\":\"How do I create a child theme in WordPress?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"<p>Crea una carpeta en \\\/wp-content\\\/themes\\\/, por ejemplo, hello-chiltheme\\\/<\\\/p>\\n<p>Dentro, agrega un archivo style.css con este contenido como ejemplo del child theme de Hello, cambiando obviamente los datos correspondientes a tu tema:<\\\/p>\\n<blockquote><p>\\\/*<br \\\/>\\nTheme Name: Hello Elementor Child<br \\\/>\\nTheme URI: https:\\\/\\\/github.com\\\/elementor\\\/hello-theme-child\\\/<br \\\/>\\nDescription: Hello Elementor Child is a child theme of Hello Elementor, created by Elementor team<br \\\/>\\nAuthor: Elementor Team<br \\\/>\\nAuthor URI: https:\\\/\\\/elementor.com\\\/<br \\\/>\\nTemplate: hello-elementor<br \\\/>\\nVersion: 2.0.0<br \\\/>\\nText Domain: hello-elementor-child<br \\\/>\\nLicense: GNU General Public License v3 or later.<br \\\/>\\nLicense URI: https:\\\/\\\/www.gnu.org\\\/licenses\\\/gpl-3.0.html<br \\\/>\\nTags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready<br \\\/>\\n*\\\/<\\\/p>\\n<p>\\\/* Add your custom styles here *\\\/<\\\/p><\\\/blockquote>\\n<p>Many themes already give you the child theme to install and there are also plugins that create it for you.<\\\/p>\\n<p>Once created you can activate it from WordPress<\\\/p>\\n\"}}]}<\/script>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>PAGESPEED WORDPRESS &#8211; DOES NOT USE PASSIVE LISTENER In wordpress when we enable comments we find the warning in pagespeed and we can go a little crazy looking for where the problem is generated, being said comments the cause in this case. WordPress automatically loads certain JavaScript scripts that manage the comment functionality, such as [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":8171,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50],"tags":[],"class_list":["post-8173","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-open-source"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Does not use passive listeners to improve scrolling - Wordpress<\/title>\n<meta name=\"description\" content=\"A passive listener is a type of event handler that simply listens for changes or actions without interfering with the flow of the program.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Does not use passive listeners to improve scrolling - Wordpress\" \/>\n<meta property=\"og:description\" content=\"A passive listener is a type of event handler that simply listens for changes or actions without interfering with the flow of the program.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog sobre linux y el mundo opensource\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/LoboBrothers\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-06T16:22:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-07T07:56:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2025\/02\/event-listener-wordpress-scaled.jpg.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"2048\" \/>\n\t<meta property=\"og:image:height\" content=\"1365\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TL\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TL\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/\"},\"author\":{\"name\":\"TL\",\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/#\/schema\/person\/11c359ab9896aa196007651fa6208beb\"},\"headline\":\"Does not use passive listeners to improve scrolling &#8211; WordPress\",\"datePublished\":\"2025-02-06T16:22:08+00:00\",\"dateModified\":\"2025-02-07T07:56:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/\"},\"wordCount\":726,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2025\/02\/event-listener-wordpress-scaled.jpg.webp\",\"articleSection\":[\"Open Source\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/\",\"url\":\"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/\",\"name\":\"Does not use passive listeners to improve scrolling - Wordpress\",\"isPartOf\":{\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2025\/02\/event-listener-wordpress-scaled.jpg.webp\",\"datePublished\":\"2025-02-06T16:22:08+00:00\",\"dateModified\":\"2025-02-07T07:56:51+00:00\",\"description\":\"A passive listener is a type of event handler that simply listens for changes or actions without interfering with the flow of the program.\",\"breadcrumb\":{\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/#primaryimage\",\"url\":\"https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2025\/02\/event-listener-wordpress-scaled.jpg.webp\",\"contentUrl\":\"https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2025\/02\/event-listener-wordpress-scaled.jpg.webp\",\"width\":2048,\"height\":1365,\"caption\":\"event listener\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\/\/tech.lobobrothers.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Does not use passive listeners to improve scrolling &#8211; WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/#website\",\"url\":\"https:\/\/tech.lobobrothers.com\/en\/\",\"name\":\"Tech LBT\",\"description\":\"Como apasionados de la tecnolog\u00eda y amantes del open source creamos este blog con art\u00edculos interesantes obre linux, cloud, open source, criptomonedas y ciberseguridad\",\"publisher\":{\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/tech.lobobrothers.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/#organization\",\"name\":\"Lobo Brothers Technology\",\"url\":\"https:\/\/tech.lobobrothers.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2019\/06\/logo_red.png\",\"contentUrl\":\"https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2019\/06\/logo_red.png\",\"width\":110,\"height\":50,\"caption\":\"Lobo Brothers Technology\"},\"image\":{\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/LoboBrothers\/\",\"https:\/\/www.linkedin.com\/company\/lobobrothers\/about\/?viewAsMember=true\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/#\/schema\/person\/11c359ab9896aa196007651fa6208beb\",\"name\":\"TL\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tech.lobobrothers.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a2d3b9e0b67bd28fe8248346c09cbe07?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a2d3b9e0b67bd28fe8248346c09cbe07?s=96&d=mm&r=g\",\"caption\":\"TL\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Does not use passive listeners to improve scrolling - Wordpress","description":"A passive listener is a type of event handler that simply listens for changes or actions without interfering with the flow of the program.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"Does not use passive listeners to improve scrolling - Wordpress","og_description":"A passive listener is a type of event handler that simply listens for changes or actions without interfering with the flow of the program.","og_url":"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/","og_site_name":"Blog sobre linux y el mundo opensource","article_publisher":"https:\/\/www.facebook.com\/LoboBrothers\/","article_published_time":"2025-02-06T16:22:08+00:00","article_modified_time":"2025-02-07T07:56:51+00:00","og_image":[{"width":2048,"height":1365,"url":"https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2025\/02\/event-listener-wordpress-scaled.jpg.webp","type":"image\/jpeg"}],"author":"TL","twitter_card":"summary_large_image","twitter_misc":{"Written by":"TL","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/#article","isPartOf":{"@id":"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/"},"author":{"name":"TL","@id":"https:\/\/tech.lobobrothers.com\/en\/#\/schema\/person\/11c359ab9896aa196007651fa6208beb"},"headline":"Does not use passive listeners to improve scrolling &#8211; WordPress","datePublished":"2025-02-06T16:22:08+00:00","dateModified":"2025-02-07T07:56:51+00:00","mainEntityOfPage":{"@id":"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/"},"wordCount":726,"commentCount":0,"publisher":{"@id":"https:\/\/tech.lobobrothers.com\/en\/#organization"},"image":{"@id":"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2025\/02\/event-listener-wordpress-scaled.jpg.webp","articleSection":["Open Source"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/","url":"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/","name":"Does not use passive listeners to improve scrolling - Wordpress","isPartOf":{"@id":"https:\/\/tech.lobobrothers.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/#primaryimage"},"image":{"@id":"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2025\/02\/event-listener-wordpress-scaled.jpg.webp","datePublished":"2025-02-06T16:22:08+00:00","dateModified":"2025-02-07T07:56:51+00:00","description":"A passive listener is a type of event handler that simply listens for changes or actions without interfering with the flow of the program.","breadcrumb":{"@id":"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/#primaryimage","url":"https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2025\/02\/event-listener-wordpress-scaled.jpg.webp","contentUrl":"https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2025\/02\/event-listener-wordpress-scaled.jpg.webp","width":2048,"height":1365,"caption":"event listener"},{"@type":"BreadcrumbList","@id":"https:\/\/tech.lobobrothers.com\/en\/does-not-use-passive-listeners-to-improve-scrolling-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/tech.lobobrothers.com\/en\/"},{"@type":"ListItem","position":2,"name":"Does not use passive listeners to improve scrolling &#8211; WordPress"}]},{"@type":"WebSite","@id":"https:\/\/tech.lobobrothers.com\/en\/#website","url":"https:\/\/tech.lobobrothers.com\/en\/","name":"Tech LBT","description":"Como apasionados de la tecnolog\u00eda y amantes del open source creamos este blog con art\u00edculos interesantes obre linux, cloud, open source, criptomonedas y ciberseguridad","publisher":{"@id":"https:\/\/tech.lobobrothers.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/tech.lobobrothers.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/tech.lobobrothers.com\/en\/#organization","name":"Lobo Brothers Technology","url":"https:\/\/tech.lobobrothers.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tech.lobobrothers.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2019\/06\/logo_red.png","contentUrl":"https:\/\/tech.lobobrothers.com\/wp-content\/uploads\/2019\/06\/logo_red.png","width":110,"height":50,"caption":"Lobo Brothers Technology"},"image":{"@id":"https:\/\/tech.lobobrothers.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/LoboBrothers\/","https:\/\/www.linkedin.com\/company\/lobobrothers\/about\/?viewAsMember=true"]},{"@type":"Person","@id":"https:\/\/tech.lobobrothers.com\/en\/#\/schema\/person\/11c359ab9896aa196007651fa6208beb","name":"TL","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tech.lobobrothers.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a2d3b9e0b67bd28fe8248346c09cbe07?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a2d3b9e0b67bd28fe8248346c09cbe07?s=96&d=mm&r=g","caption":"TL"}}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/tech.lobobrothers.com\/en\/wp-json\/wp\/v2\/posts\/8173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tech.lobobrothers.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.lobobrothers.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.lobobrothers.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.lobobrothers.com\/en\/wp-json\/wp\/v2\/comments?post=8173"}],"version-history":[{"count":2,"href":"https:\/\/tech.lobobrothers.com\/en\/wp-json\/wp\/v2\/posts\/8173\/revisions"}],"predecessor-version":[{"id":8183,"href":"https:\/\/tech.lobobrothers.com\/en\/wp-json\/wp\/v2\/posts\/8173\/revisions\/8183"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tech.lobobrothers.com\/en\/wp-json\/wp\/v2\/media\/8171"}],"wp:attachment":[{"href":"https:\/\/tech.lobobrothers.com\/en\/wp-json\/wp\/v2\/media?parent=8173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.lobobrothers.com\/en\/wp-json\/wp\/v2\/categories?post=8173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.lobobrothers.com\/en\/wp-json\/wp\/v2\/tags?post=8173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}