Compatible with IE and FF Firefox, set it as the homepage and add js to favoritesCode
// Add to favorites
Function AddFavorite (Surl, stitle)
{
If (Document. All)
{
Window. External. AddFavorite (Surl, stitle );
}
Else If (Window. Sidebar)
{
Window. Sidebar. addpanel (stitle, Surl, "" );
}
}
//Set Homepage
FunctionSetHomePage (Surl)
{
If(Document. All)
{
Document. Body. style. Behavior= 'URL (# default # homepage)';
Document. Body. setHomePage (Surl );
}
Else If (Window. Sidebar)
{
If (Window. Netscape)
{
Try
{
Netscape. Security. privilegemanager. enableprivilege ( " Universalxpconnect " );
}
Catch (E)
{
Alert ( " This operation is rejected by the browser. To enable this function, enter about: config in the address bar, and set the value of 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 ' , Surl );
}
}