About Favorite Sites

Source: Internet
Author: User

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! ');}}}     


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.