AngelDeaD commented on issue #876: Content Security Policy support.
URL: 
https://github.com/apache/incubator-pagespeed-mod/issues/876#issuecomment-436462444
 
 
   This is line that I have problem with:
   `<p><img class="posted_image zoomable" src="https://www.XXXX.XXX/XXX.jpg"; 
srcset="https://www.XXXX.XXX/XXX.jpg 828w, https://www.XXXX.XXX/XXX.jpg 625w, 
https://www.XXXX.XXX/XXX.jpg 414w, https://www.XXXX.XXX/XXX.jpg 1000w" 
sizes="(max-width: 30em) 414px, (max-width: 65em) 744px, 607px" 
onclick="PopEx(this,null,null,0,0,50,'pb-img-on shrinkable');" 
data-pagespeed-url-hash="204305278" 
onload="pagespeed.CriticalImages.checkImageForCriticality(this);"></p>`
   It's piece of source code of an web page.
   This part of line:
   `data-pagespeed-url-hash="204305278" 
onload="pagespeed.CriticalImages.checkImageForCriticality(this);"`
   Is added **staticly** by pagespeed. (I mean there is no way to edit it or 
add something to it).
   
   Regarding my suggestion:
   If ( $webpagespeed-nonce != "" && $webpagespeed-sha == "" ) then
   `<p><img class="posted_image zoomable" src="https://www.XXXX.XXX/XXX.jpg"; 
srcset="https://www.XXXX.XXX/XXX.jpg 828w, https://www.XXXX.XXX/XXX.jpg 625w, 
https://www.XXXX.XXX/XXX.jpg 414w, https://www.XXXX.XXX/XXX.jpg 1000w" 
sizes="(max-width: 30em) 414px, (max-width: 65em) 744px, 607px" 
onclick="PopEx(this,null,null,0,0,50,'pb-img-on shrinkable');" nonce="YYY" 
data-pagespeed-url-hash="204305278" 
onload="pagespeed.CriticalImages.checkImageForCriticality(this);"></p>`
   
   pagespeed static js code would be:
   `nonce="YYY" data-pagespeed-url-hash="204305278" 
onload="pagespeed.CriticalImages.checkImageForCriticality(this);"`
   
   Of course, if both of webpagespeed-nonce and webpagespeed-sha are empty. 
First static would be added (as it's right now).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to