0

I am trying to open multiple tabs in chrome without popup blocked

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

        setTimeout(function () {
        window.open('http://www.google.com','_blank');
    }, 100);

        setTimeout(function () {
        window.open('http://www.google.com','_blank');
    }, 100);
        setTimeout(function () {
        window.open('http://www.google.com','_blank');
    }, 100);    
        setTimeout(function () {
        window.open('http://www.google.com','_blank');
    }, 100);
    }); 

But only one tab open at the moment How can i open multiple tab without popup blocked in google chrome

2 Answers2

-1

try the following code block. It will not blocked by browser :

var redirectWindow = window.open(url, '_blank');
                        redirectWindow.location;
Sandip Jaiswal
  • 3,428
  • 2
  • 13
  • 15
-1

Use some more code between above two linees code like this :

var redirectWindow = window.open(url, '_blank');
//show loader or prompt user
var userFeedback = prompt('do you want to open new window?');
if(userFeedback){
 redirectWindow.location;
}

Pop will be blocked by browser. Its good feature of browser for security reason.

Sandip Jaiswal
  • 3,428
  • 2
  • 13
  • 15