title: Puppeteer-web: Protocol error (Target: getBrowserContexts) not allowed
body: <p>I've got a chrome extension that is trying to implement puppeteer-web. I've followed the following code to try and get set up
  <a href="https://stackoverflow.com/questions/53001009/puppeteer-web-puppeteer-is-not-a-constructor/53024164#53024164">puppeteer-web: &quot;Puppeteer is not a constructor&quot;</a></p>
  
  <p>This is my code:</p>
  
  <pre><code>const puppeteer = require("puppeteer");
  async function initiatePuppeteer() {
    let browserWSEndpoint = '';
    await fetch("http://127.0.0.1:9222/json")
      .then(response =&gt; response.json())
      .then(function(data) {
          let filteredData = data.filter(tab =&gt; tab.type ==='page');
          browserWSEndpoint = filteredData[0].webSocketDebuggerUrl;
        })
      .catch(error =&gt; console.log(error));
      const browser = await puppeteer.connect({
        browserWSEndpoint: browserWSEndpoint
      });
      const page = await browser.newPage();
      ....etc
  }
  </code></pre>
  
  <p>It doesn't seem the code makes it past this point as when I put a debugger at <code>const browser = await puppeteer.connect</code> I get the error </p>
  
  <pre><code>Uncaught (in promise) Error: Protocol error (Target.getBrowserContexts): Not allowed.
  </code></pre>
  
  <p>Using Chrome version V76.0.3809.100
  Any ideas?</p>
  
  <p>Edit: my webSocketDebuggerUrl is something like <code>ws://127.0.0.1:9222/devtools/page/E1B62B356262B00C26A5D79D03745360</code></p>
  
  <p>And I suspect it's because it's <code>/page/</code> and not <code>/browser/</code> but I couldn't find any of type browser from the /json route. I'll give it another look at it tonight.</p>