//加入收藏夹
function AddFvtgc() {
var title = document.title;
var url = document.location.href;
try {
window.external.AddFavorite(url, title);
}
catch (e) {
alert("请按下 Ctrl + D 键将本站加入收藏。");
}
}
//设为首页
function AddHomegc() {
var url = document.location.href; if (document.all)
{ document.body.style.behavior = ‘url(#default#homepage)‘; document.body.setHomePage(url); }
else if (window.sidebar) {
if (window.netscape) {
try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }
catch (e)
{ alert("此操作被浏览器拒绝!\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为‘true‘"); }
}
//var prefs = Components.classes[‘@mozilla.org/preferences-service;1‘].getService(Components.interfaces.nsIPrefBranch);
//prefs.setCharPref(‘browser.startup.homepage‘, url);
}
else {
alert(‘您的浏览器不支持自动自动设置首页, 请使用浏览器菜单手动设置!‘);
}
}