You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 10, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 10, 2025. It is now read-only.
Critical images js doesn't play well with display #1087
On ngx-pagespeed-discuss someone said their page was intermittently getting js plastered across it on mobile. Specifically, PageSpeed was turning:
<a class="logo" href="http://lebonstream.net" title="Lebonstream | Un site utilisant WordPress"><img src="http://lebonstream.net/wp-content/uploads/2015/05/logo-header.png" alt="Lebonstream | Un site utilisant WordPress"/></a>
into:
<a class="logo" href="http://lebonstream.net" title="Lebonstream | Un site utilisant WordPress"><script pagespeed_no_defer="">(function(){var g=this,h=function(b,d)...pagespeed.CriticalImages.Run('/ngx_pagespeed_beacon','http://lebonstream.net/?a=b','bOk8u7_prl',true,false,'-tCPhA9VMdE');</script><img src="http://lebonstream.net/wp-content/uploads/2015/05/xlogo-header.png.pagespeed.ic.m4z1_NscpC.png" alt="Lebonstream | Un site utilisant WordPress" pagespeed_url_hash="1901629196" onload="pagespeed.CriticalImages.checkImageForCriticality(this);"/></a>
I have a CL sitting around to fix this that needs tests written. My
proposed solution is to not inject the script into the middle of the page
at all, but to put it in the head. It means we'll occasionally inject it
when we don't need to, but that should basically never happen in practice.
Misplaced the bug number, which I used to have open in a tab. Grrr... No
previous solution has suggested adding a style= to the script, and I'm
pretty sure that's Just Wrong (it offends my delicate sensibilities,
anyway).
Activity
jeffkaufman commentedon May 28, 2015
I think this was reported before, but I don't see the bug looking now.
jmaessen commentedon May 28, 2015
I have a CL sitting around to fix this that needs tests written. My
proposed solution is to not inject the script into the middle of the page
at all, but to put it in the head. It means we'll occasionally inject it
when we don't need to, but that should basically never happen in practice.
Misplaced the bug number, which I used to have open in a tab. Grrr... No
previous solution has suggested adding a style= to the script, and I'm
pretty sure that's Just Wrong (it offends my delicate sensibilities,
anyway).
-Jan
On Thu, May 28, 2015 at 9:25 AM, Jeff Kaufman notifications@github.com
wrote:
jmaessen commentedon Jun 1, 2015
This should be fixed; I've moved the script load to or to top of page if there's no head.
crowell commentedon Jun 10, 2015
closed by 0184daf
[-]critical images js doesn't play well with `display`[/-][+]Critical images js doesn't play well with `display`[/+]