Does Google execute JavaScript?

Stephan Boyer created a website with some JS injected content and waited for Google to crawl it. It got indexed, but without JS execution. Only after having submitted the site manually via the Google Search Console it got indexed with JS executed.

His conclusion:

Google may or may not decide to run your JavaScript, and you don’t want your business to depend on its particular inclination of the day. Do server-side/universal/isomorphic rendering just to be safe.

Now, I don’t wholeheartedly agree with this, as other experiments have already verified that Google indeed indexes JS content. What I think is going on is that Google has 2 crawlers: one dumb/fast one sans JS execution (to quickly index new sites), and a smart/slow one with JS execution (which visits the site later).

Also, I once read a similar article (but cannot seem to find it back) that used window.setTimeout to see how long Google allows the JS execution. If I remember correctly Google will let your scripts run for some time between 30 and 60 seconds max.

Does Google execute JavaScript? →
Does Google crawl dynamic content? →

Related, a few other Google indexing experiments I did:

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.