Wrapper for the Page Visibility API