K-Meleon's IE Favorites Plugin empowers you to share your Favorites with K-Meleon and provides a functionality to add pages and links to your Favorites. But when compared with Internet Explorer, this functionality is very limited, yet. You can influence neither the name nor the location of the created shortcuts. Before the IE Favorites Plugin is going to be improved in this regard, I want to demonstrate how this improvement could be done. There is no need to invent the wheel twice. You can simply make K-Meleon use Internet Explorer's "Add to Favorites" function, that is provided to other applications by the Shell.UIHelper ActiveX control.
Following, I want to describe the steps to set up K-Meleon 0.9. Note, that this setup is experimental and has some limitations.
Windows Script Host 1.0 (or better) required!
WSH is part of Microsoft Internet Explorer 5.0 and newer. Latest version of WSH is available in the Download Section of Microsoft's Scripting Homepage.
Download AddFavorite.js and place it in your profile directory
(e.g.
C:\Program Files\K-Meleon\Profiles\<profilename>\<random>.slt).
/* AddFavorite.js by kko, version 1.0
This script uses Internet Explorer's own "Add to Favorites" function
to create a new Internet Shortcut. You will be asked for the name and
the location.
Windows Script Host 1.0 (or better) required!
WSH is part of Microsoft Internet Explorer 5.0 and newer. Latest version
of WSH is available at http://msdn.microsoft.com/scripting/
*/
if (WScript.Arguments.length) {
var uih = WScript.CreateObject("Shell.UIHelper");
var cmd = "uih.AddFavorite(WScript.Arguments(0)";
if ((WScript.Arguments.length > 1) && (WScript.Arguments(1)))
cmd += ",WScript.Arguments(1)"; eval(cmd+");");
} else WScript.Echo("Syntax: "+WScript.ScriptName+" URL [Title]");
Select "Tools" > "Advanced Preferences" > "Macros..." to open K-Meleon's macro configuration file macros.cfg and apply the following changes:
# ----BOOKMARK MACROS----
# Use Internet Explorer's own "Add to Favorites" function (kko)
FavoritesAdd {
# Replacement for plugin command favorites(Add)/plugin(favorites,Add)
$TITLE==$URL?$u="":$u=$TITLE;
exec("wscript.exe \"".$path."AddFavorite.js\" \"".$URL."\" \"".$u."\"");
}
FavoritesAddLink {
# Replacement for plugin command favorites(AddLink)/plugin(favorites,AddLink)
$macro="FavoritesAddLnk"; &JSEnable;
}
FavoritesAddLnk {
$TITLE==$URL?$t="":$t=$TITLE;
open("javascript:function chkLnk(e){var t='".$LinkURL."',l=e.document.links;for(var j=0;j<l.length;j++)if(l[j].href==t){top.document.title=(l[j].text==l[j].innerHTML)?l[j].text:'';break;}}function chkFrm(e){var f=e.frames;for(var j=0;j<f.length;j++)chkFrm(f[j]);chkLnk(e);}void(chkFrm(top));");
$TITLE==$URL?$u="":$u=$TITLE;
open("javascript:(function(){top.document.title='".$t."';})();");
exec("wscript.exe \"".$path."AddFavorite.js\" \"".$LinkURL."\" \"".$u."\"");
}
# The file "AddFavorite.js" must be located within your profile directory (where this file resides) !
FileBook{
plugin(bookmarks,Add); plugin(bookmarks,Edit);
}
FileHot{
Select "Tools" > "Advanced Preferences" > "Menus..." to open K-Meleon's menu configuration file menus.cfg and apply the following changes:
F&avorites {
%ifplugin macros
macros(FavoritesAdd, Add)
%else
favorites(Add, Add)
%endif
favorites(Edit, Explore)
macros(FileFav, Add/Explore)
-
favorites()
}
Save{
bookmarks(Add, Bookmark This Page)
%ifplugin macros
macros(FavoritesAdd, Add Page to Favorites)
%else
favorites(Add, Add Page to Favorites)
%endif
hotlist(Add, Add Page to Hotlist)
%ifplugin macros
macros(SavePage, Save Page As...)
macros(EmailURL, Send Page As Link...)
%else
Save Page &As... = ID_FILE_SAVE_AS
%endif
-
}
Link{
%ifplugin layers
layers(OpenLink, Open in New Layer)
layers(OpenLinkBg, Open in Background Layer)
-
%endif
Open in &New Window = ID_OPEN_LINK_IN_NEW_WINDOW
Open in Back&ground Window = ID_OPEN_LINK_IN_BACKGROUND
-
bookmarks(AddLink, Bookmark This Link)
%ifplugin macros
macros(FavoritesAddLink, Add Link to Favorites)
%else
favorites(AddLink, Add Link to Favorites)
%endif
hotlist(AddLink, Add Link to Hotlist)
&Copy Link URL = ID_COPY_LINK_LOCATION
%ifplugin macros
macros(SaveLink, Save Link As...)
macros(LinkInfo, View Link URL...)
macros(LinkInIE, View Link In IE)
%else
Save &Link As... = ID_SAVE_LINK_AS
%endif
}
Search menus.cfg for "favorites(Add" to quickly find the correct locations.
The IE Favorites Plugin will refresh the Favorites menu only when you use the plugin itself to add favorites. When K-Meleon is set up as described above, you will have to restart the application to see the created shortcuts in your Favorites menu!