Because the company page needs to set the top of the home collection needs to be updated, because after the browser update, some JS will not be used
Compatible with IE and Firefox only
Collection:
Firefox:Window.sidebar.addPanel (Stitle, sURL, ""); this is not going to work.
But found in a tag add rel= "sidebar" can also be added to the collection, title is the name of the collection
So: function Addfavorite (url,title) {
if (!window.sidebar) {
Try{window.external.addfavorite (Url,title)}catch (e) {
Alert ("Add to collection failed, please use ctrl+d for adding");
}
}
}
Only IE can add success above, others are prompt
Set Homepage:
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 was 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);p refs.setcharpref (' Browser.startup.homepage ', VRL)}else{alert (' Your browser does not support setting the homepage automatically, please set it manually using the browser menu! ');}}}