Add to Favorites <a onclick= "Addfavorite (window.location,document.title)" > Add to Favorites </a>
function Addfavorite (sURL, Stitle) {
try {
Window.external.addFavorite (sURL, stitle);
}
catch (e) {
try {
Window.sidebar.addPanel (Stitle, sURL, "");
}
catch (e) {
Alert ("Add to collection failed, please use ctrl+d for adding");
}
}
}
Homepage <a onclick= "Sethome (this,window.location)" > Homepage </a>
function Sethome (obj, VRL) {
try {
obj.style.behavior = ' url (#default #homepage) '; Obj.sethomepage (VRL);
}
catch (e) {
if (Window.netscape) {
try {
Netscape.security.PrivilegeManager.enablePrivilege ("Universalxpconnect");
}
catch (e) {
Alert ("This action is rejected by the browser!") \ n Please enter "About:config" in the browser address bar and return to \ n then set the value of [Signed.applets.codebase_principal_support] to ' true ' and double click. ");
}
var prefs = components.classes[' @mozilla. Org/preferences-service;1 '].getservice ( Components.interfaces.nsIPrefBranch);
Prefs.setcharpref (' Browser.startup.homepage ', VRL);
}
}
}
JS Set homepage, add to Favorites