title: Why does Google Chrome's popup blocker shoot down a link when it contains an image or any other tag?
body: <p>Google Chrome is a bit weird nowadays in that v25 no longer respects a 302 redirect header and happily re-posts form data on page refresh, whereas v24 and all the other browsers play nicely. I'm not sure if this is just a temporary browser bug, so let me describe the mystery I'm trying to solve.</p>
  
  <p>As far as I know you cannot open a tab using HTML or JavaScript, but a new window without explicitly set dimensions is going to open as a tab by default.</p>
  
  <p>First I've tried this:</p>
  
  <pre><code>&lt;a href="URL" onclick="window.open(this.href);return false"&gt;
    &lt;img src="NICE IMAGE" alt="foo"&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>This was working everywhere, except in Chrome where it was shot down as an unauthorized popup window. Interestingly, sometimes when I kept clicking on it, Chrome has changed its mind and let the link open anyway (as tab). This was not always the case though, sometimes the link remained dead.</p>
  
  <p>After a couple of hours of experimenting (and having changed from <code>onclick</code> to a simple <code>target="_blank"</code>) I have discovered that the reason the link was killed is that the click event started from the <code>&lt;img&gt;</code> tag within the <code>&lt;a&gt;</code>. When I replaced the <code>&lt;img&gt;</code> with a <code>&lt;span&gt;</code> that contained some text and clicked on the <code>&lt;span&gt;</code>, the link could not open (Chrome has identified it as an unwanted popup), but when I clicked on the <code>&lt;a&gt;</code> tag itself (that had a fixed size or a padding), then it was accepted, and a new tab was born.</p>
  
  <p>Finally I just included the images as CSS background and the <code>&lt;a&gt;</code> tags remained empty. Everything seems to be working now in every browser with this markup:</p>
  
  <pre><code>&lt;a href="URL" target="_blank" style="background:url('NICE_IMAGE'); height:XXX; width:XXX" title="Description"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>What could be the reason behind the Google Chrome’s logic that when a link contains a tag, then it is forbidden from being opened as a new tab, but when it is empty, then it can go ahead?</p>