Add to favorites JSCode:
Function AddFavorite (Surl, stitle ){
Try {
Window. External. AddFavorite (Surl, stitle );
}
Catch (e ){
Try {
Window. Sidebar. addpanel (stitle, Surl ,"");
}
Catch (e ){
Alert ("failed to add to favorites, please add with Ctrl + D ");
}
}
}
Reference <li class = "Li1"> <a class = "A1" href = "javascript: AddFavorite (window. location, document. title); "> Add this information to favorites </a> </LI>
Set as homepage JS Code:
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 operation is rejected by the browser! Enter about: config in the address bar of the browser and press enter to set [signed. Applets. codebase_principal_support] to true ");
}
VaR prefs = components. classes ['@ mozilla.org/preferences-service%1'%.getservice
(Components. Interfaces. nsiprefbranch );
Prefs. setcharpref ('browser. startup. homepage', VRL );
}
}
}
Reference on the front-end page:
<Li class = "Li1"> <a href = "#" onclick = "javascript: sethome (this, window. location) "> set to homepage </a> </LI>