How do I prevent Google Chrome from blocking my popup?

Yes, popups should be a direct result of a user action. Doing them in ajax callback will not do the trick. Also, using async:false is bad - in FF it is known to block the whole browser. Think of some other way to do the check:

  • it could be the first thing you do in the popup
  • you can open the popup on click and manipulate it later when the callback fires
  • you can require the user to click again some button to trigger the popup (probably the worst solution)
  • you can do it on page load

Following up on Emil's excellent answer, "you can open the popup on click and manipulate it later when the callback fires". I used this implementation.

$('#attackButton').click(function() {

New code here

    var win ='');
    window.oldOpen =; = function(url) { // reassignment function
        win.location = url; = oldOpen;

end new code

        url: baseurl + '/index.php',
        data: { 'gameid': 618 },
        type: 'POST',
        success: function(data) {
  'some url'); // will call reassignment function above 

    return false;

You can open a window that is not blocked just under the onclick event, if you open it on ajax call it is considered popup. However I used this method with success for some time to open a popup and not be blocked.

In my case the was launched inside a promise in angular, which turned the popup blocker on, my solution was:

$scope.gotClick = function(){

  var myNewTab = browserService.openNewTab();
      browserService. updateTabLocation(res.url, myNewTab);


this.openNewTab = function(){
  var newTabWindow = $;
  return newTabWindow;

this.updateTabLocation = function(tabLocation, tab) {
  tab.location.href = tabLocation;

this is how you can open a new tab using the promise response and not invoking the popup blocker.