title: How to log in True headless mode with puppeteer
body: <p>I'm trying to log into a page, but when headless mode is True it doesn't work, but when it does, this is my code:</p>
  <pre><code>const puppeteer = require(&quot;puppeteer&quot;)           
  const sqlite3 = require(&quot;sqlite3&quot;).verbose();   
  const db = new sqlite3.Database('./db.db');     
  const fs = require(&quot;fs&quot;)       
                                                                                                                      
  const login = async () =&gt; {                      
   db.serialize(function() {                        
    db.all(&quot;SELECT * from usuarios&quot;,async function(err,rows){                                        
     try{                                             
      console.log(&quot;Dormindo ...&quot;)                     
      while(true){                                     
       if(err) {                                        
        console.log(err);                              
       }                                                
       else{                                            
        for(logins of rows){                             
          var data = Date.now()
          const browser = await puppeteer.launch({
           executablePath: '/usr/bin/chromium',
           args:['--no-sandbox',  '--Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36', '--lang=en-US,en;q=0.5']        
          });
          await page.goto(&quot;https://unite.nike.com.br/oauth.html?client_id=QLegGiUU042XMAUWE4qWL3fPUIrpQTnq&amp;redirect_uri=https%3A%2F%2Fwww.nike.com.br%2Fapi%2Fv2%2Fauth%2Fnike-unite%2Fset&amp;response_type=code&amp;locale=pt_BR&amp;state=&quot;, { waitUntil: 'load', timeout:0});
          await page.waitForSelector('input[name=&quot;emailAddress&quot;]')
          await page.type('input[name=&quot;emailAddress&quot;]', logins.email)                                     
          await page.type('input[name=&quot;password&quot;]', logins.password)                                      
          await page.click(&quot;input[value='ENTRAR']&quot;)       
          await page.waitForTimeout(6000)  
          await page.screenshot({fullPage: true, path: 'screenshot.png'})                                 
          console.log(Date.now() - data)                  
          console.log(&quot;Cookie de usuario armazenado!&quot;);                                                   
          browser.close()  
         }
        }
       }                                               
      }
     }                                               
     catch(err){
      console.log(&quot;Erro durante login!&quot;,err)
     }                                              
    })
   })
  }
  </code></pre>
  <p>I want to be able to login in True Headless Mode, If you can help me I appreciate it, I can't solve this at all, but from what I see when I enter the page with headless false mode, and open devtools, in the browser console there is a message like this:
  <code>INFO Fri Jul 16 2021 23:42:16 GMT-0300 (Brasilia Standard Time) OPTIMIZELY: Skipping JSON schema validation.</code></p>
  <p>My theory is that site somehow manages to check whether or not I'm in headless mode, but I don't know how to fix this anyway, since I sent a user-agent and set the language in <code>args:</code>, someone help me with that please.</p>