title: set browser profile settings via puppeteer
body: <p>I am using puppeteer to crawl sites, take screenshots and log all the set cookies.</p>
  <p>Everything is working fine but only first party cookies are saved to the browser.
  After some tweaking I found out that it is probably the setting in the attached picture that I have to change to &quot;Allow all cookies&quot;.</p>
  <p>I couldn't find any way to change the browser settings via puppeteer.
  Can anyone help? Thanks in advance.</p>
  <p><a href="https://i.stack.imgur.com/Hen7t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hen7t.png" alt="Settings in Chrome" /></a></p>
  <p>My code:</p>
  <pre><code>const puppeteer = require('puppeteer');
  
  (async() =&gt; {
  
  const browser = await puppeteer.launch({headless: false});
  const page = await browser.newPage();
  
  await page.goto(process.argv[2], {waitUntil : 'networkidle2' });
  
  await page.screenshot({path: '1.png'});
  
  const client = await page.target().createCDPSession();
  var content = await client.send('Network.getAllCookies');
  var json = JSON.stringify(content, null, 4);
  console.log( json );
  
  
  var fs = require('fs');
  fs.writeFile(&quot;output.json&quot;, json, 'utf8', function (err) {
      if (err) {
          console.log(&quot;An error occured while writing JSON Object to File.&quot;);
          return console.log(err);
      }       
      process.exit();
  });
  
  
  })();
  </code></pre>