Created
October 10, 2018 06:24
-
-
Save VorticonCmdr/2dafbfcda1fa4f52f8e19c178c462fba to your computer and use it in GitHub Desktop.
google search console fetch & render test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en" prefix="og: http://ogp.me/ns#"> | |
<head> | |
<meta charset="utf-8"/> | |
<link rel="canonical" href=" [insert your url here] "/> | |
<title>Google Fetch and Render test</title> | |
</head> | |
<body> | |
<span>time diff</span> | |
<p id="speedOutput"></p> | |
<span>count</span> | |
<p id="countOutput"></p> | |
<span>useragent</span> | |
<p id="uaOutput"></p> | |
<script> | |
var uaOutput = document.getElementById('uaOutput'); | |
uaOutput.textContent = navigator.userAgent; | |
var speedOutput = document.getElementById('speedOutput'); | |
var countOutput = document.getElementById('countOutput'); | |
var i = 0; | |
var startTime = (new Date().getTime()); | |
setInterval(function(){ | |
var xhttp = new XMLHttpRequest(); | |
xhttp.onreadystatechange = function() { | |
if (this.readyState == 4) { | |
var endTime = (new Date().getTime()); | |
var diff = endTime - startTime; | |
speedOutput.textContent = diff; | |
i++; | |
countOutput.textContent = i; | |
} | |
}; | |
xhttp.open("GET", " [insert your url here] ", true); | |
xhttp.send(); | |
}, 1000); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment