The Code is as follows:
// Set it to function AddFavorite (stitle) {Surl = location. href; 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 ");}}} // set it to the home page function sethome (OBJ, VRL) {try {obj. style. behavior = 'url (# default # homepage) '; obj. setHomePage (VRL);} catch (e) {If (window. netscape) {try {Netscape. security. privilegem Anager. enableprivilege ("universalxpconnect");} catch (e) {alert ("this operation was rejected by the browser! \ N enter \ "about: config \" in the address bar of the browser, press enter \ n, set the value of [signed. Applets. codebase_principal_support] To 'true', and double-click it. ");} Var prefs = components. classes ['@ resolve (components. Interfaces. nsiprefbranch); prefs. setcharpref ('browser. startup. homepage', VRL );}}}