<html>
<head>
<title>JavaScript settings homepage and favorite page (compatible with IE and Firefox)</title>
<script>
//url: the link to be collected; title: the name of the favorite item
function AddFavorite(url,title)
{
//If the url or title is empty, the default is the current page url and title.
if(!(url&&title))
{
url=;
title=;
}
if ()//IE
{
(url,title);
}
else if ()//Firefox
{
(title, url, "");
}
}
//url: The link to set as homepage
function SetHomepage(url)
{
//If the url is empty, the default is the current page url.
if(!url)
{
url=;
}
if ()//IE
{
= 'url(#default#homepage)';
(url);
}
else if ()//Firefox
{
if ()
{
try
{
("UniversalXPConnect");
}
catch (e)
{
alert("This operation was rejected by the browser! Please enter "about:config" in the browser address bar and press Enter and then set the value of [.codebase_principal_support] to 'true', double-click.");
}
}
var prefs = ['@/preferences-service;1'].getService();
('', url);
}
}
</script>
</head>
<body>
<a onClick="SetHomepage('https:///')" title="Set as homepage" href="javascript:">Set as homepage</a>
<a onClick="AddFavorite('https:///','Online Notes')" title="Favorite" href="javascript:">Favorite</a>
</body>
</html>