home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2008 September
/
PCWorld_2008-09_cd.bin
/
komunikace
/
kmeleon
/
K-Meleon1.1.3en-US.exe
/
macros
/
useragent.kmm
< prev
next >
Wrap
Text File
|
2007-05-09
|
3KB
|
71 lines
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
# ---------- User Agent --------------------------------------------------------------------------------------------
#
# Dependencies : main.kmm ($macroPrefBranch)
# Resources : -
# Preferences : kmeleon.privacy.useragent[1,2,...].name
# kmeleon.privacy.useragent[1,2,...].string
#
# ------------------------------------------------------------------------------------------------------------------
UserAgent{
menuchecked=$ARG==""?(getpref(STRING,$_UserAgent_Active)==""):(getpref(STRING,$_UserAgent_Active)==getpref(STRING,$_UserAgent_Custom.$ARG.".string"));
$ARG==""?delpref($_UserAgent_Active):$_string=getpref(STRING,$_UserAgent_Custom.$ARG.".string");
$ARG==""?&_UserAgent_SyncMenu:&_UserAgent;
}
UserAgent_Custom{
$_string=prompt(_("Enter the User Agent string to identify K-Meleon as:"),_("Custom User Agent"),getpref(STRING,$_UserAgent_Active));
$_string==""?0:&_UserAgent;
}
UserAgent_ToggleReset{
menuchecked=getpref(BOOL,$_UserAgent_Reset);
togglepref(BOOL,$_UserAgent_Reset);
}
# ----- PRIVATE
$_UserAgent_Active="general.useragent.override";
$_UserAgent_Custom="kmeleon.privacy.useragent";
$_UserAgent_Reset=$macroPrefBranch."useragent.reset_on_exit";
_UserAgent{
setpref(STRING,$_UserAgent_Active,$_string); &_UserAgent_SyncMenu;
}
_UserAgent_SyncMenu{
$_data=getpref(STRING,$_UserAgent_Active);
setcheck("macros(UserAgent_Custom)",($_data!=""));
$_j=1; while($_j>0) &_UserAgent_SyncMenuLoop;
}
_UserAgent_SyncMenuLoop{
$__data=getpref(STRING,$_UserAgent_Custom.$_j.".string");
$__data==$_data?setcheck("macros(UserAgent_Custom)",false):0;
$_j=$__data==""?0:$_j+1;
}
$OnStartup=$OnStartup."_UserAgent_SyncMenu;";
_UserAgent_BuildMenu{
# tools menu
$_u="&User Agent";
setmenu(PrivacySecurity,popup,$_u);
setmenu($_u,macro,"Default","UserAgent()");
$_i=1; while($_i>0) &_UserAgent_BuildMenuLoop;
setmenu($_u,macro,"&Custom...",UserAgent_Custom);
setmenu($_u,macro,"&Reset To Default On Exit",UserAgent_ToggleReset);
setmenu($_u,separator,"&Reset To Default On Exit");
}
_UserAgent_BuildMenuLoop{
$__data=getpref(STRING,$_UserAgent_Custom.$_i.".name");
$__data==""?0:setmenu($_u,macro,$__data,"UserAgent(".$_i.")");
$_i=$__data==""?0:$_i+1;
}
$OnInit=$OnInit."_UserAgent_BuildMenu;";
_UserAgent_Reset{
getpref(BOOL,$_UserAgent_Reset)==true?delpref($_UserAgent_Active):0;
}
$OnQuit=$OnQuit."_UserAgent_Reset;";
# ------------------------------------------------------------------------------------------------------------------
$macroModules=$macroModules."UserAgent;";