The video first shows the working behavior when
performance.now() is updated on the page and after 5 seconds a transition to another page is performed. Why is the part of the javascript that is used to navigate to another page executed, but the part that is responsible for outputting
performance.now() is not displayed in Google Meet (when the browser window is inactive)?
code from video
index.html<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h3>index.html LOADED</h3>
<h3 id="test"></h3>
<script>
setTimeout(()=>{
console.log("Change location")
location.href = "./index2.html"
}, 5000)
function step(timestamp) {
document.querySelector('#test').textContent = performance.now()
window.requestAnimationFrame(step);
}
window.requestAnimationFrame(step);
</script>
</body>
</html>
index2.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h3>index.html2 LOADED</h3>
<h3 id="test"></h3>
<script>
setTimeout(()=>{
console.log("Change location")
location.href = "./index.html"
}, 5000)
function step(timestamp) {
document.querySelector('#test').textContent = performance.now()
window.requestAnimationFrame(step);
}
window.requestAnimationFrame(step);
</script>
</body>
</html>