var bar = document.querySelector('progress'),
max = document.body.scrollHeight - innerHeight,
val;
bar.max = max;
addEventListener('scroll', function(){
bar.value = window.pageYOffset;
})
addEventListener('resize', function(){
bar.max = document.body.scrollHeight - innerHeight;
})
