As I do not know how to convert Firefox stuff for KM, I tried to get the info using the macro system. I have two versions of a macro called PingBack.
One looks up the IP address for every page load and that can be displayed in the title from a memu item under Tools menu.
The other version only looks up the IP address on demand from the popup menu under the Tools menu. A second item on the popup will display the IP address in the title.
The reason the user has to ask for the display to title is that I do not know of a way to have the macro execution stop and wait for ping.exe to complete and output to file.
The requirements are that a user will copy one of the PingBack.kmm files and the PingBack.bat file and put them in the UserMacro area of the profile.
PingBack.kmm -- Automatic lookup version
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- PingBack.kmm
# ---------- K-Meleon Macro Language to show the ip number of the page host ---------------
#
# Dependencies : main.kmm
# Resources : PingBack.bat, PingBack.dat
# Preferences : -
# Version : 0.7 2008-09-28
# --------------------------------------------------------------------------------
_PingBack_RunPing{
$_PingBack_HostNameOfURL = hostname($URL) ;
$_PingBack_TempOutPath = getfolder(UserMacroFolder)."\\PingBack.dat";
exec("\"".$_PingBack_PathBat."\"" . " " . "\"".$_PingBack_HostNameOfURL."\"" . " " . "\"". $_PingBack_TempOutPath ."\"" ) ;
#setclipboard("\"".$_PingBack_PathBat."\"" . " " . "\"".$_PingBack_HostNameOfURL."\"" . " " . "\"". $_PingBack_TempOutPath ."\"");
}
_PingBack_RunCode{
macroinfo="Display IP number for current host";
$_PingBack_IP_File = readfile($_PingBack_TempOutPath );
$_PingBackLB = index($_PingBack_IP_File,"[");
$_PingBackRB = index($_PingBack_IP_File,"]");
$_PingBackLn = $_PingBackRB - $_PingBackLB ;
$_PingBack_IP = substr( $_PingBack_IP_File, $_PingBackLB, $_PingBackLn +1);
$TITLE = $_PingBack_IP . " " . $TITLE ;
}
_PingBack_BuildMenu{
# add another option to Tools menu
setmenu("&Tools",macro,"PingBack",_PingBack_RunCode,Misc);
}
_PingBack_GetPathBat{
$__DataB=readfile(getfolder(MacroFolder)."\\PingBack.bat");
$_PingBack_PathBat=getfolder($__DataB==""?UserMacroFolder:MacroFolder)."\\PingBack.bat";
}
$OnStartup=$OnStartup."_PingBack_GetPathBat;";
$OnInit=$OnInit."_PingBack_BuildMenu;";
$OnLoad=$OnLoad."_PingBack_RunPing;";
$macroModules=$macroModules."PingBack;";
PingBack.kmm -- On demand lookup version
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- PingBack.kmm
# ---------- K-Meleon Macro Language to show the ip number of the page host ---------------
#
# Dependencies : main.kmm
# Resources : PingBack.bat, PingBack.dat
# Preferences : -
# Version : 0.7 2008-09-28
# --------------------------------------------------------------------------------
_PingBack_RunPing{
macroinfo="Obtain IP number for current host";
$_PingBack_HostNameOfURL = hostname($URL) ;
$_PingBack_TempOutPath = getfolder(UserMacroFolder)."\\PingBack.dat";
exec("\"".$_PingBack_PathBat."\"" . " " . "\"".$_PingBack_HostNameOfURL."\"" . " " . "\"". $_PingBack_TempOutPath ."\"" ) ;
#setclipboard("\"".$_PingBack_PathBat."\"" . " " . "\"".$_PingBack_HostNameOfURL."\"" . " " . "\"". $_PingBack_TempOutPath ."\"");
}
_PingBack_RunCode{
macroinfo="Display IP number for current host";
$_PingBack_IP_File = readfile($_PingBack_TempOutPath );
$_PingBackLB = index($_PingBack_IP_File,"[");
$_PingBackRB = index($_PingBack_IP_File,"]");
$_PingBackLn = $_PingBackRB - $_PingBackLB ;
$_PingBack_IP = substr( $_PingBack_IP_File, $_PingBackLB, $_PingBackLn +1);
$TITLE = $_PingBack_IP . " " . $TITLE ;
}
_PingBack_BuildMenu{
# add another option to Misc section of Tools menu
$_PingBack_Popm = "PingBack" ;
setmenu("&Tools",popup,$_PingBack_Popm,Misc);
setmenu($_PingBack_Popm,macro,"Obtain IP",_PingBack_RunPing,0);
setmenu($_PingBack_Popm,macro,"Display IP",_PingBack_RunCode,1);
}
_PingBack_GetPathBat{
$__DataB=readfile(getfolder(MacroFolder)."\\PingBack.bat");
$_PingBack_PathBat=getfolder($__DataB==""?UserMacroFolder:MacroFolder)."\\PingBack.bat";
}
$OnStartup=$OnStartup."_PingBack_GetPathBat;";
$OnInit=$OnInit."_PingBack_BuildMenu;";
$macroModules=$macroModules."PingBack;";
PingBack.bat -- Required batch file
ping.exe -n 1 %1 > %2