title: window.open() opening same link twice
body: <p>I am creating a chrome extension for a clothing website that releases items at a certain time. The extension looks for a certain set of links that contain certain keywords. If it finds the links, it opens them. If not, it refreshes the page. I accomplish this by using Javascript and jQuery. The script is injected via a background script &amp; tabs. Here is my code:</p>
  
  <pre><code>if ($("body").hasClass(" products us")) {
      var firstitem_link = $("a[href*='mizuno']").attr('href');
      var seconditem_link = $("a[href*='schott']").attr('href');
      if (firstitem_link &amp;&amp; seconditem_link) {
          window.open(firstitem_link);
          window.open(seconditem_link);
      } else {
          window.location.reload(true);
      }
  }
  </code></pre>
  
  <p>When I use this code and it finds the links, it opens them numerous times, as opposed to once for each. How can I fix this?</p>