title: Puppeteer: is there a way to access the DevTools Network API?
body: <p>I am trying to use <a href="https://github.com/GoogleChrome/puppeteer" rel="noreferrer">Puppeteer</a> for end-to-end tests. These tests require accessing the network emulation capabilities of DevTools (e.g. to simulate offline browsing). </p>
  
  <p>So far I am using chrome-remote-interface, but it is too low-level for my taste. </p>
  
  <p>As far as I know, Puppeteer does not expose the network DevTools features (<code>emulateNetworkConditions</code> in the DevTools protocol). </p>
  
  <p>Is there an escape hatch in Puppeteer to access those features, e.g. a way to execute a Javascript snippet in a context in which the DevTools API is accessible?</p>
  
  <p>Thanks</p>
  
  <p><strong>Edit:</strong>
  OK, so it seems that I can work around the lack of an API using something like this:</p>
  
  <pre><code>    const client = page._client;
      const res = await client.send('Network.emulateNetworkConditions',
        { offline: true, latency: 40, downloadThroughput: 40*1024*1024, 
        uploadThroughput: 40*1024*1024 });
  </code></pre>
  
  <p>But I suppose it is Bad Form and may slip under my feet at any time?</p>