SoFunction
Updated on 2025-04-08

Perfectly compatible with IE and Firefox websites to add to favorites and set up home page


<script type="text/javascript">
    function AddFavorite(sURL, sTitle) {
        try {
            (sURL, sTitle);
        }
        catch (e) {
            try {
                (sTitle, sURL, "");
            }
            catch (e) {
alert("Add to favorites failed, please use Ctrl+D to add");
            }
        }
    }
    function SetHome(obj, vrl) {
        try {
            = 'url(#default#homepage)'; (vrl);
        }
        catch (e) {
            if () {
                try {
                    ("UniversalXPConnect");
                }
                catch (e) {
alert("This operation was rejected by the browser!\nPlease enter "about:config" in the browser address bar and press Enter\n Then set the value of [.codebase_principal_support] to 'true', double-click.");
                }
                var prefs = ['@/preferences-service;1'].getService();
                ('', vrl);
            }
        }
    }
</script>