<script>
// Set a timeout in milliseconds for the anti-flicker.
var timeout = 1000;
var id = "amp-exp-css";
if (!document.getElementById(id)) {
var s = document.createElement("style");
s.id = id;
s.innerText = "* { visibility: hidden !important; background-image: none !important; }";
document.head.appendChild(s);
window.setTimeout(function () {s.remove()}, timeout);
}
</script>
Anti-flicker script is: