When I include a script whose loading fails with a timeout (e.g. via packets being dropped, such as the Chinese Great Firewall dropping all packets to Google Analytics), the browser favicon loading indicator keeps spinning until the timeout is over.
(Note on Linux, you can simulate such timeouts using iptables
, e.g. sudo iptables -I OUTPUT -d 'IP_OF_GOOGLE_ANALYTICS_HERE' -j DROP
.)
How do I have to place/annotate a <script>
so that it does not block the loading indicator?
I have tried various combinations (see articles here and here) of the defer
and async
attributes of <script>
in <head>
and <body>
, but the spinner keeps spinning in my Chromium 68 and Firefox 63 Nightly.
Also, what exactly determines whether the spinner is shown or not? Is DOMContentLoaded
the boundary, or are other things at play?