Auto refresh browser on resize (pure JavaScript)