title: How to prevent new tab creation in puppeteer's chromium instance?
body: <p>I would like to prevent new tab creation. Either by clicking 'new tab button' either by window.open method.
  Is there any way to listen on new tab creation. I don't mean 'targetcreated' event because then tab is already created. Maybe there is something similar to event.preventDefault?</p>
  
  <p>Below is a very simple code that closes every new tab but I think it's very ugly and I want to improve it.</p>
  
  <pre><code>browser.on('targetcreated', (target) =&gt; {
      function closeNewTabs(target) {
        let targetBrowser = target.browser();
        targetBrowser.pages().then(data =&gt; {
            if (data.length&gt;1) {
                for (let i = 0; i &lt; data.length; i++) {
                    if (i&gt;1) data[i].close();
                }
            }
        })
      }
  })
  </code></pre>