News for hackers. Stuff that matters.
Re:A Report from the AMP Advisory Committee Meeting by psandersen on Wednesday May 15, 2019 @10:51AM (#19919941)
You actually have to make it deliberately slow if Google's js is disabled? that seems a little malicious...
Re:A Report from the AMP Advisory Committee Meeting by hadrien01 on Wednesday May 15, 2019 @10:54AM (#19919989)
Yup. This snippet adds a css animation to make the page white for 8s, and it's stopped by Google's JS or the browser's noscript (which you don't enable if you only block Google's JS and not the domain JS):

https://amp.dev/fr/documentation/guides-and-tutorials/learn/...

Re:A Report from the AMP Advisory Committee Meeting by rogual on Wednesday May 15, 2019 @01:00PM (#19921406)
Insane. Google has lost all credibility.
Re:A Report from the AMP Advisory Committee Meeting by amirmasoudabdol on Wednesday May 15, 2019 @11:12AM (#19920167)
So, is there a way that I can block this tag somehow and drop it during the load time?
Re:A Report from the AMP Advisory Committee Meeting by hadrien01 on Wednesday May 15, 2019 @11:18AM (#19920255)
You can add a Stylus stylesheet enabled for the regex .[star]amp.[star] (replace [star] with the star symbol) that contains body{animation:none}, but I don't know if that's good for performance.

Edit: Developers can also add that css in their amp style, and it seems to be accepted by the amp validator. AMP devs, you know what to do! ;)

Re:A Report from the AMP Advisory Committee Meeting by chrismorgan on Wednesday May 15, 2019 @01:13PM (#19921568)
Go for this on all pages instead:

  html[\26a1] body, html[amp] body {
    animation: none;
  }
(I wrote \26a1 because HN doesn’t allow the literal U+26A1 character.)

That way it applies to all AMP pages, regardless of their URL, and doesn’t clobber any other pages (though I can’t actually imagine any genuine animation on a body element).

Re:A Report from the AMP Advisory Committee Meeting by hadrien01 on Wednesday May 15, 2019 @06:20PM (#19924346)
Works perfectly, thank you!

I took the liberty to put it on userstyles.org for one-click install: https://userstyles.org/styles/171953/disable-amp-blank-loadi...

Re:A Report from the AMP Advisory Committee Meeting by TazeTSchnitzel on Wednesday May 15, 2019 @12:07PM (#19920782)
Btw you can begin a line with two spaces for code formatting:

  .*amp.*
Re:A Report from the AMP Advisory Committee Meeting by TazeTSchnitzel on Wednesday May 15, 2019 @12:00PM (#19920698)
I assume the idea behind it is to prevent the “flash of unstyled content”.
Re:A Report from the AMP Advisory Committee Meeting by sanbor on Wednesday May 15, 2019 @12:18PM (#19920917)
I wonder who made the decision that 8s delay is better than the unstyled flash.
Re:A Report from the AMP Advisory Committee Meeting by Wowfunhappy on Wednesday May 15, 2019 @07:14PM (#19924701)
Flashes are distracting. IMO, it's not the delay that's the problem, but the fact that it lasts eight seconds. The limit should be 500 milliseconds, at most.
Re:A Report from the AMP Advisory Committee Meeting by echeese on Wednesday May 15, 2019 @01:51PM (#19921946)
There is no delay if the script loads properly.
Re:A Report from the AMP Advisory Committee Meeting by JohnFen on Wednesday May 15, 2019 @02:54PM (#19922539)
Having the delay in that circumstance is much, much worse than a FOUC.
Re:A Report from the AMP Advisory Committee Meeting by echeese on Wednesday May 15, 2019 @09:59PM (#19925519)
I agree
Re:A Report from the AMP Advisory Committee Meeting by TazeTSchnitzel on Wednesday May 15, 2019 @02:28PM (#19922295)
Consider a very slow network connection. Is effectively delaying the page loading for 8 seconds worth it?
Re:A Report from the AMP Advisory Committee Meeting by echeese on Wednesday May 15, 2019 @09:58PM (#19925518)
No, but I didn't say it was was a good idea
Re:A Report from the AMP Advisory Committee Meeting by randomguy7788 on Wednesday May 15, 2019 @02:24PM (#19922252)
the original code is to prevent FOUC, that 8 second delay is sort of a fallback if the js hasn't unhidden the body