一键打开多个网页

最近有点忙,博客也好久没更新了,作为2019年最后一篇博客,今天给大家带来一款可同时打开多个页面的页面。 注意事项:复制到左侧文本框中的链接要以回车or空格分隔若链接不在新选项卡中打开,请更改浏览器设置.经测试IE, Firefox, Chrome均可用各按钮作用:OpenAll: 打开所有链接Open&RemoveDuplicate: 打开并去掉重复链接CloseAll:关闭所有链接CloseLastBrowsingPages:关闭最近一次打开的链接Reset: 清空 代码如下所示:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8" />
<title>一次打开多个网页</title>
<style type="text/css">
#Container{ width:100%; }
#Container .gnb {width:880px; padding:5px 25px 5px 0; margin:0 auto; overflow:hidden; position:relative}
#Container .Content{text-align:left;width:880px;margin:0 auto 0 auto;padding:5px 15px 0 10px;}
#Container .Content .Tips{float:right;width:200px;}
#Container .Content .Left{ float:left; width:680px;}
#Container .Content .Clear { clear:both;}
#msg_win{border:1px solid #A67901;background:#EAEAEA;width:240px;position:absolute;right:0;font-size:12px;font-family:Arial;margin:0px;display:none;overflow:hidden;z-index:99;}
#msg_win .icos{position:absolute;top:2px;*top:0px;right:2px;z-index:9;}
.icos a{float:left;color:#833B02;margin:1px;text-align:center;font-weight:bold;width:14px;height:22px;line-height:22px;padding:1px;text-decoration:none;font-family:webdings;}
.icos a:hover{color:#fff;}
#msg_title{background:#FECD00;border-bottom:1px solid #A67901;border-top:1px solid #FFF;border-left:1px solid #FFF;color:#000;height:25px;line-height:25px;text-indent:5px;}
#msg_content{margin:5px;margin-right:0;width:230px;height:126px;overflow:hidden;}
.style1 {
	color: #FF0000;
	font-style: italic;
}
</style>
<script language="javascript">
var arr=new Array();
var arri = 0;
var content = "&nbsp;<input type='button' value='CloseAll' οnclick='closeAll();' />"
function openMulti()
{
var strs= new Array();
var n = 0;
var m = 0;
var value = document.getElementById("code").value;
Tvalue = Trim(value);
if (!Tvalue.match(/[a-z]/g)||Tvalue=="")
{	
	alert("请输入链接!");
 }
else
{ 
	strs = value.split(/\s+/g);
	var str;
	var flagBegin = arri;
	for (i=0;i<strs.length ;i++ )   
    {   
		if ( strs[i].slice(0,7)!="http://" && strs[i].slice(0,7)!="https:/" && strs[i].slice(0,7)!="")
		  { str = "http://" + strs[i];
				if(!str.match(/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/))
	   			{
	      			n++;
	   			}
				else
				{	arr[arri]=window.open(strs[i]);
					m++;
				}
		   }
		else if (strs[i]==""){}
		else
		   {
			    if(!strs[i].match(/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/))
	   			{
	      			n++;
	   			}
				else
				{	arr[arri]=window.open(strs[i]);
					m++;
				}
		   } 
		arri = arri + 1;
    } 
	var flagEnd = arri;
	if (m != 0)
	{document.getElementById("closeBtn").innerHTML=content+" <input type='button' value='CloseLastBrowsingPages' οnclick='closeBefore("+flagBegin+","+flagEnd+");' />";}
	document.getElementById("msg_win").style.display= "block";
	document.getElementById("msg_win").style.visibility="visible";
	document.getElementById("msg_content").innerHTML= "打开了" + m +"个页面,"+ "关闭了" + n + "个错误页面";
	Message.init();
}
}



function removeDuplicate()
{
var strs= new Array();
var n = 0;
var m = 0;
var value = document.getElementById("code").value;
Tvalue = Trim(value);
if (!Tvalue.match(/[a-z]/g)||Tvalue=="")
{	
	alert("请输入链接!");
	
 }
else
{ 
	strs = value.split(/\s+/g);
	var str;
	var flagBegin = arri;
	var dupi = 0;	
	for (i=0;i<strs.length ;i++ )   
    {   
		if ( strs[i].slice(0,7)!="http://" && strs[i].slice(0,7)!="https:/" && strs[i].slice(0,7)!=""){ str = "http://" + strs[i];}
		else if(strs[i]=="") {continue;}
		else {str = strs[i];} 
		if(!str.match(/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/))
	   	{
	      	n++;
	   	}
		else
		{	
			var clo = 0;
			for (var t=1;t+i<strs.length;t++)   
    		{
				if ( strs[i]==strs[i+t] && i!=(i+t))
				{
					clo++;
					dupi++;
					break;
					}
			}
			if (clo==0)
			{
				arr[arri]=window.open(str);
				arri = arri + 1;
				m++;
			}
		}					
	}
		
	var flagEnd = arri;
	if (m != 0)
	{
		document.getElementById("closeBtn").innerHTML=content+" <input type='button' value='CloseLastBrowsingPages' οnclick='closeBefore("+flagBegin+","+flagEnd+");' />";}
	document.getElementById("msg_win").style.display= "block";
	document.getElementById("msg_win").style.visibility="visible";
	document.getElementById("msg_content").innerHTML= "打开了" + m +"个页面,"+ "关闭了" + n + "个错误页面"+ "和" + dupi + "个重复页面";
	Message.init();
	}
}



function closeAll() { 

for (i=0;i<arr.length ;i++)   
    {  
		if (arr[i])
			{	arr[i].close();
			 }
		else
			{	continue;	}
    }
	arri = 0;
	document.getElementById("closeBtn").innerHTML="";
}

function closeBefore(begin,end) { 

for (i=begin;i<=end ;i++ )   
    {   
		if (arr[i])
			{	arr[i].close();
			 }
		else
			{	continue;	}
    }   
document.getElementById("closeBtn").innerHTML=content;
}

function Trim(m){ 
   	while((m.length>0)&&(m.charAt(m.length-1)==' ')) 
   	{m = m.substring(0, m.length-1);}
	 return m;  
  	}
	
function Reset(){ 
	document.getElementById("code").value = "";
  	}  
	
window.onbeforeunload = function(){
		return "关闭或刷新此页将会导致:不能用本工具关闭以前打开的网页。继续?";
	} 
</script>
</head>

<body>

<div id="Container">
  <div class="gnb">
    <p align="center">一次打开多个网页</p>
  </div>
  <div class="Content">
    
    <div class="Left">
        <textarea id="code" cols="78" rows="32"></textarea>
        <div id="openBtn" style="float:left">
        <input type="button" value="OpenAll" οnclick="openMulti();" />
        <input type="button" value="Open&RemoveDuplicate" οnclick="removeDuplicate();" />
		<input type="button" name="Reset" id="button" value="Reset" οnclick="Reset();"/>
        </div>
        <div id="closeBtn" style="float:left"></div>
		<br /><br /><br /><br /><br />
    </div>
    
    <div class="Tips">
      <p>注意事项:</p>
      <p>复制到左侧文本框中的链接要以<span class="style1">回车or空格</span>分隔</p>
      <p>若链接不在新选项卡中打开,请更改浏览器设置.</p>
      <p>经测试IE, Firefox, Chrome均可用</p>
      <p>各按钮作用:</p>
      <p>OpenAll: 打开所有链接</p>
      <p>Open&amp;RemoveDuplicate: 打开并去掉重复链接</p>
      <p>CloseAll:关闭所有链接</p>
      <p>CloseLastBrowsingPages:关闭最近一次打开的链接</p>
      <p>Reset: 清空</p>
    </div>
    
    <div class="Clear"> </div>
    
  </div>
    <div id="msg_win" style="display:none;top:490px;visibility:hidden;opacity:1;">
		<div class="icos"><a id="msg_close" title="close" href="###">×</a></div>
		<div id="msg_title">提示</div>
		<div id="msg_content"></div>
	</div>
</div>
<script language="javascript">
var Message={
close: function() {
	this.win.style.display = 'none';
	},
setOpacity: function(x) {
	var v = x >= 100 ? '': 'Alpha(opacity=' + x + ')';
	this.win.style.visibility = x<=0?'hidden':'visible';
	this.win.style.filter = v;
	this.win.style.opacity = x / 100;
	},
show: function() {
	clearInterval(this.timer2);
	var me = this,fx = this.fx(0, 100, 0.1),t = 0;
	this.timer2 = setInterval(function() {
	t = fx();
	me.setOpacity(t[0]);
	if (t[1] == 0) {clearInterval(me.timer2) }
	},10);
},
fx: function(a, b, c) {
	var cMath = Math[(a - b) > 0 ? "floor": "ceil"],c = c || 0.1;
	return function() {return [a += cMath((b - a) * c), a - b]}
},
getY: function() {
	var d = document,b = document.body, e = document.documentElement;
	var s = Math.max(b.scrollTop, e.scrollTop);
	var h = /BackCompat/i.test(document.compatMode)?b.clientHeight:e.clientHeight;
	var h2 = this.win.offsetHeight;
	return {foot: s + h + h2 + 2+'px',top: s + h - h2 - 2+'px'}
},
moveTo: function(y) {
	clearInterval(this.timer);
	var me = this,a = parseInt(this.win.style.top)||0;
	var fx = this.fx(a, parseInt(y));
	var t = 0 ;
	this.timer = setInterval(function() {
	t = fx();
	me.win.style.top = t[0]+'px';
	if (t[1] == 0) {
		clearInterval(me.timer);
		me.bind();
	}
	},10);
},
bind:function (){
	var me=this,st,rt;
	window.onscroll = function() {
	clearTimeout(st);
	clearTimeout(me.timer2);
	me.setOpacity(0);
	st = setTimeout(function() {
	me.win.style.top = me.getY().top;
	me.show();
	},600);
};
window.onresize = function (){
	clearTimeout(rt);
	rt = setTimeout(function() {me.win.style.top = me.getY().top},100);
}
},
init: function() {
	function $(id) {return document.getElementById(id)};
	this.win=$('msg_win');
	var set={minbtn: 'msg_min',closebtn: 'msg_close',title: 'msg_title',content: 'msg_content'};
	for (var Id in set) {this[Id] = $(set[Id])};
		var me = this;
		this.closebtn.onclick = function() {me.close()};
		this.char=navigator.userAgent.toLowerCase().indexOf('firefox')+1?['_','::','×']:['0','2','r'];
		this.closebtn.innerHTML=this.char[2];
		setTimeout(function() {
		me.win.style.display = 'block';
		me.win.style.top = me.getY().foot;
		me.moveTo(me.getY().top);
		},0);
	return this;
}
};

</script>
</body>
</html>

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Windows 11一键修复IE11工具是Windows 11操作系统提供的一种便捷修复IE11浏览器的工具。IE11是Windows操作系统中自带的默认浏览器,虽然现在已有更先进的浏览器可供选择,但仍有很多用户在某些情况下需要使用IE11。 一键修复IE11工具主要用于解决IE11出现的常见问题和故障。当用户遇到IE11无法正常加载网页、频繁崩溃、插件或扩展失效等问题时,可以通过使用该工具来尝试修复这些问题,让IE11恢复正常运行。 使用一键修复IE11工具非常简单。用户只需打开该工具,然后选择需要修复的问题类型,工具会自动分析问题的原因,并尝试恢复IE11的正常工作状态。修复过程通常会涉及重置IE11的设置、清除缓存、修复损坏的文件等操作。 但需要注意的是,一键修复IE11工具并不能解决所有IE11的故障,有时可能需要进行更深入的排查和修复。同时,随着Windows操作系统的升级,微软也逐渐将重点转移到了新一代的Edge浏览器上,将来可能会逐渐减少对IE11的维护和支持。 总之,Windows 11一键修复IE11工具为用户提供了一种便捷的解决IE11问题的方法,帮助用户在遇到故障时能够快速修复IE11,提高浏览器的稳定性和使用体验。 ### 回答2: Windows 11一键修复IE11工具是一种用于修复Internet Explorer 11(简称IE11)问题的功能。IE11是Windows操作系统自带的网页浏览器,但是在使用过程中可能会出现一些常见的问题,比如无法打开网页、运行缓慢、崩溃等。为了解决这些问题,微软推出了一键修复IE11工具。 一键修复IE11工具可以通过一系列自动化的操作修复IE11的问题,使用户无需手动进行繁琐的操作。只需要执行简单的步骤,即可修复大多数常见的IE11问题。 使用一键修复IE11工具的步骤如下: 1. 打开开始菜单,并搜索“一键修复IE11工具”。 2. 点击打开该工具,并等待加载完成。 3. 在工具界面上,选择“修复IE11问题”选项。 4. 程序会开始检测并修复IE11的问题。 5. 修复完成后,会显示修复结果的详细信息。 这个工具的主要优点是简单易用,并且能够解决大多数常见的IE11问题。它可以自动执行修复操作,节省用户的时间和精力。而且,在IE11修复过程中,用户的个人数据和设置不会受到任何影响。 然而,这个工具也有一些限制。首先,它只能解决一些常见的IE11问题,对于一些复杂的问题可能无法提供有效的解决方案。其次,一键修复IE11工具只能用于修复IE11本身的问题,无法解决其他与IE11无关的问题。 总之,Windows 11一键修复IE11工具是一种方便的工具,可用来修复IE11的常见问题。它能够简化修复过程,提高用户的使用体验。但是在遇到复杂问题时,可能需要使用其他更为全面的修复方法。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值