Check if console in window first