Headless detection

try to guess whether the session is headless or not, if it isn't don't try to open a browser for login