我想在 Google Chrome 中一次打开多个链接,但是失败了。
问题:
- 被弹窗拦截
- 在用户允许弹窗后,在新窗口中打开而不是新标签页中打开
使用 这个方法,我可以在 Firefox 中一次打开多个链接:
<!DOCTYPE html>
<html ng-app="plunker">
<head>
<meta charset="utf-8">
<title>AngularJS Plunker</title>
<script>document.write('<base href="' + document.location + '" >');</script>
<link rel="stylesheet" href="style.css">
<script data-require="angular.js@1.2.x" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.17/angular.min.js" data-semver="1.2.17"></script>
<script src="app.js"></script>
</head>
<body ng-controller="MainCtrl">
<button ng-click="openLinks()">Open</button>
</body>
</html>
另外,我遇到了一个找到了一种解决方法的人。
我尝试使用setInterval
来逐个打开链接,但它没有奏效。