title: puppeteer web page async code not executed
body: <p>If I 'goto' a web page that contains async code, it is not executed and I don't understand why. Can anyone please help?</p>
  <p>Node:</p>
  <pre><code>const puppeteer = require('puppeteer');
  
  (async () =&gt; {
    const browser = await puppeteer.launch();
    const page = await browser.newPage();
    await page.goto('http://127.0.0.1:8080/?code=ABC123&amp;id=1', {
      waitUntil: 'networkidle0',
    });
    await page.screenshot({ path: 'example.png' });
  
    await browser.close();
  })();
  </code></pre>
  <p>web page:</p>
  <pre><code>onmount = () =&gt; {
      const params = new URLSearchParams(document.location.search);
      const code = params.get('code');
      // above lines are executed     
     
      // the code below is never executed
      // search is an async function (not shown for brevity)
      search(code).then(result =&gt; document.getElementById('title').textContent = result.title);   
  };
  </code></pre>