Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Correct. You've broken the page by blocking only some of the assets. AMP loads fine if you allow all scripts or disable Javascript completely.


This is not really the point, the point is that the page loads anyway, without the AMP scripts so there's really no excuse for having an 8s delay. I don't want this google stuff on every web page I visit, and frankly it's unnecessary -- this article could easily have been written using static HTML / CSS and it would probably have been easier to develop (as well as access).


Disabling javascript doesn't disable css animations.


The CSS animation only comes into play as a fallback mechanism. The AMP script will force a draw sooner otherwise.


Precisely. The exact code is here:

https://www.ampproject.org/docs/fundamentals/spec/amp-boiler...

Here it is pretty-printed and simplified to not have the vendor-specific stuff:

  <style amp-boilerplate>
  body{
    animation:-amp-start 8s steps(1,end) 0s 1 normal both
  }
  @keyframes -amp-start{
    from{visibility:hidden}to{visibility:visible}
  }
  </style>
  <noscript>
    <style amp-boilerplate>
      body{animation:none}
    </style>
  </noscript>
The first bit is for browsers with javascript, but where the network is poor and can't load the minimal required highly cacheable javascript file within 8 seconds. It uses CSS just in case javascript really isn't working anyway such as being disabled per domain or something. The second bit is for browsers without javascript - the page is unblocked immediately.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: