K-Meleon

KMeleonWiki > Resources > MacroLibrary > KmmSnipr

Submitted by: rstlne



Notes:

Generate a short URL from a page or link using Snipr. To invoke, use the Snipr command in the document or link popup menus.

This macro is similar to the bookmarklet provided by Snipr. The difference is the macro works even if you've set your bookmark options so that bookmarks open in a new layer. That setting breaks the bookmarklet.




Open your User Macro Folder (Edit > Configuration > User-Defined Macros) or your Macro Folder (Edit > Configuration > Macros) and create the following text file(s):

snipr.kmm

# snipr.kmm
#
# Macros for generating a short URL from a page or link using Snipr.

_snipr{
$OpenURL="http://snipr.com/site/snip?link=".urlencode($_snipr_url);
$OpenURL=$OpenURL.($_snipr_title?"&title=".urlencode($_snipr_title):"");
&OpenURL_InNew;
}

snipr_page{
menugrayed=(hostname($URL)=="");
$_snipr_url=$URL; $_snipr_title=$TITLE; &_snipr;
}

snipr_link{
$_snipr_url=$LinkURL; $_snipr_title=""; &_snipr;
}

_snipr_buildmenu{
setmenu(Document,macro,"Snipr of page",snipr_page,-1);
setmenu(LinkPopup,macro,"Snipr of link",snipr_link,-1);
setmenu(FrameLinkPopup,macro,"Snipr of link",snipr_link,-1);
}

$OnInit=$OnInit."_snipr_buildmenu;";
$macroModules=$macroModules."snipr;";

# vim:set tw=0:
# -- The End --


Comments & Questions

K-Meleon

(c) 2000-2010 kmeleonbrowser.org. All rights reserved.
design by splif.