7 ms·
Are you sure that isn't just a timeout function in case AMP fails to load? edit: Dug up the code. <style> body {animation:-amp-start 8s steps(1,en
by SquareWheel 8y ago
Are you sure that isn't just a timeout function in case AMP fails to load?
edit: Dug up the code.
<style>
body {animation:-amp-start 8s steps(1,end) 0s 1 normal both}
@keyframes -amp-start{from{visibility:hidden} to{visibility:visible}}
</style>
<noscript>
<style>
body {animation:none}
</style>
</noscript>
The timeout function is turned off if JS isn't available, so JS being disabled shouldn't be a problem.
I'm guessing this is actually to delay page paint so it doesn't display when half-loaded.
- anoncoward111 8y agoIf they don't allow you to fix this fallback, it's a punishment
- bastawhiz 8y agoIn fairness, blocking the external half of the code while not blocking the inline part of the code is on you. You could just as easily block/disable the <style> tag that adds this in addition to the AMP JS.
- JoshMnem 8y agoBlocking inline CSS is more difficult than blocking external resources.
- deleted 8y ago[deleted]
- detaro 8y agoparent said > block the AMP JavaScript not, > JS being disabled
- SquareWheel 8y agoThen the noscript tag wouldn't fire here. But that's just shooting yourself in the foot. A page won't function with half its code running.
- tedunangst 8y agoThe JavaScript should create the fade style, then it will only happen if js is running.
- SquareWheel 8y agoI'm pretty sure the JS actually stops the fade. The inline CSS will be executed very early on in the page, before any assets are loaded. Though it seems to me if the page is fast enough anyway (as amp pages claim to be), then this trick shouldn't be necessary anyway.
- lightswitch05 8y agoI think you might have missed the point of my comment. If you block AMP scripts, you will definitely encounter broken sites. The point I was trying to make are that those broken sites are mostly junk anyways. Overloaded with ads, tracking, and other manipulative content geared at turning me into the product. I haven't missed those sites any. However, I recognize that I'm not the average user, which is why these blocks are in my aggressive list. I initially put the blocks into my regular block list which is then consumed by Steven Black's hosts [1]. Very quickly a ticket was opened to whitelist AMP [2]. Funny enough, the user requesting that AMP be white listed posted screen shots of broken advertisements disguised as 'news' articles. To make everyone happy I moved it to my aggressive list which isn't included in Steven's project. Anyways, long story short, I don't like AMP and don't mind the occasional broken site. But it's definitely not for everyone. [1] https://github.com/StevenBlack/hosts https://github.com/StevenBlack/hosts [2] https://github.com/StevenBlack/hosts/issues/657 https://github.com/StevenBlack/hosts/issues/657
- JoshMnem 8y agoAMP is shooting users in the foot. They are content-based pages with no reason for making users wait for 8 seconds if JS isn't loaded. See also: https://developer.mozilla.org/en-US/docs/Glossary/Graceful_degradation https://developer.mozilla.org/en-US/docs/Glossary/Graceful_d...
- 8y ago