title: How to get Chrome to open multiple sites in a new tab
body: <p>I'm developing a tool that lets you open multiple pages at once with a shortcut, to be used for things like opening your daily sites or querying multiple search engines for a phrase.  In Firefox, Internet Explorer and Opera, assuming you've unblocked pop-ups for the domain, the code works as expected.</p>
  
  <p>Chrome, however, opens the sites in new windows instead of tabs if the links are opened automatically when the page loads.  If openAll() is commented out and the button is clicked or a key is pressed, the pages open in tabs.  Note it's calling the exact same function.</p>
  
  <p>The best solution I've found (which isn't saying much) is the <a href="https://chrome.google.com/webstore/detail/papnlnnbddhckngcblfljaelgceffobn" rel="nofollow">One Window</a> extension.  It works, but you can see the new window open then get sucked back in, and it keeps you from opening new Windows with Ctrl-N, forcing you to drag tabs out to use another Chrome window.</p>
  
  <p>I can understand there not being a programmatic way to change this because it's a browser setting, but as a user of the tool it's annoying to have the sites all open in new windows.  Is there a Chrome setting or extension that will open links in tabs when they're loaded without user input?  I realize opening a bevy of windows is the very thing browsers aim to stop, but this is one time where I want to allow it.</p>
  
  <pre><code>&lt;input id="openAllBtn" type="button" value="Open all links"&gt; (Or press any key)
  &lt;script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.1.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  function openAll() {
      window.open('http://yahoo.com/');
      window.location.replace('http://www.bing.com/');
      return false;
  }
  $(document).ready(function() {
      $(document).bind('keypress', openAll);
      $("#openAllBtn").bind("click", openAll);
      openAll();
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Here's a Fiddle of the code: <a href="http://jsfiddle.net/sfzjR/" rel="nofollow">http://jsfiddle.net/sfzjR/</a></p>