Open multiple links in Chrome at once as new tabs

前端 未结 7 1530
小蘑菇
小蘑菇 2020-11-29 09:32

I\'m trying to open multiple links at once in Google Chrome in new tabs but it fails.

Problems:

  1. Blocked by popup
  2. Open in new windows instead o
相关标签:
7条回答
  • 2020-11-29 10:09

    User will have to allow popups but I ended up doing this:

    function openMultipleTabs(urlsArray){
    
        urlsArray.forEach(function(url){
            let link     = document.createElement('a');
            link.href    = url;
            link.target  = '_blank';
            link.click();
        });
    
    }
    
    0 讨论(0)
提交回复
热议问题