Extensions
: K-Meleon Forum
All about K-Meleon extensions.
Goto:
Forum List
•
Message List
•
Search
•
Log In
Your Name:
Subject:
Help information
BBcode help
Smileys help
[quote=siria] [i][b](update: Version 1.1)[/b][/i] This is for sending a fake "vendor" (=browser name) to sites that won't let you in otherwise. There's also a menu entry to check the current User Agent String. More explanations below inside macro :) [img]http://two.xthost.info/siria/km/kmm_misc/useragent2_screen2.png[/img] [img]http://two.xthost.info/siria/km/kmm_misc/useragent2_screen1.png[/img] --------------------------------------------------- Copy the blue text into a text file and save it as "useragent2.kmm" in the macros folder: [color=blue]# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage) # # ------------------ useragent2.kmm -------------- (Version 1.1) ----------------- # [b]Menu entry: Tools > Privacy > User Agent, and optional UA button on privacy bar[/b] (right-click) # Version: 1.1 / 2010-02-04 / by Siria # Forum: http[i][/i]://kmeleon.sourceforge.net/forum/read.php?9,101185 #---------------------------------------------------------------------------- # # [b]To TOGGLE "USERAGENT.VENDOR" and "USERAGENT.VENDORSUB" in about:config[/b] # # This is just meant [b]additionally to the default macro useragent.kmm[/b], which switches useragents. # This macro here can [b]fake the vendor string (="K-Meleon")[/b], according to the useragent # set by the default macro. Wrote this because possibly there may be nasty websites out there # which ignore the useragent and rather decide by the vendor whether to let you in or not. # At any rate you can try out with this macro ;-) # TIP: Check on a site like www.browserspy.dk how much your settings reveal! # # NOTES: # ** At each browser restart the vendor will be reset to K-Meleon, to change that read at bottom. # ** And if you want to change the vendor strings automatically when switching UserAgent, open # useragent.kmm and insert 3 lines, with a comment line before (e.g. ##### useragent2.kmm) # 1) insert as the last line before "}" in submacro "_UserAgent_Reset{" (ca line-75): # getpref(BOOL,$_UserAgent_Reset)?&useragent2_vendorKM:0; # 2) insert as the last line before "}" in submacro "_UserAgent{" (ca line-44): # &useragent2_vendorXY; # 3) insert as the last line before "}" in submacro "UserAgent{" (ca line-17): # $ARG==""?&useragent2_vendorKM:0; # ** The User Agent strings are defined in K-Meleon/defaults/pref/I10n.js (use notepad) # Strings for FF3 and Opera-Linux: kmeleon.sourceforge.net/forum/read.php?1,101141 #---------------------------------------------------------------------------- useragent2_vendorKM{ macroinfo="Reset pref ''general.useragent.vendor'' to K-Meleon"; menuchecked=(getpref(STRING,"general.useragent.vendor")=="K-Meleon"); $ua2_vendor="K-Meleon"; $ua2_vensub=readfile(getfolder(RootFolder)."\\defaults\\pref\\kmeleon.js"); $ua2_vensub=substr($ua2_vensub,index($ua2_vensub,"vendorSub")+13,5); &_useragent2_setprefs; } useragent2_vendorXY{ macroinfo="Set pref ''general.useragent.vendor'' like in UserAgent"; menuchecked=(index(getpref(STRING,"general.useragent.override"),$ua2_vendor)>-1); $ua2_vendor="K-Meleon"; $ua2_fakestring=getpref(STRING,"general.useragent.override"); index($ua2_fakestring,"Firefox")>-1 ? $ua2_vendor="Firefox" : 0; index($ua2_fakestring,"SeaMonkey")>-1 ? $ua2_vendor="SeaMonkey" : 0; index($ua2_fakestring,"Opera")>-1 ? $ua2_vendor="Opera" : 0; index($ua2_fakestring,"MSIE")>-1 ? $ua2_vendor="MSIE" : 0; $ua2_vensub=substr($ua2_fakestring,index($ua2_fakestring,$ua2_vendor)+length($ua2_vendor)+1); index($ua2_vensub," ")>-1 ? $ua2_vensub=substr($ua2_vensub,0,index($ua2_vensub," ")) : 0; index($ua2_vensub,";")>-1 ? $ua2_vensub=substr($ua2_vensub,0,index($ua2_vensub,";")) : 0; $ua2_vendor=="MSIE" ? $ua2_vendor=="msie" : 0; $ua2_fakestring=="" ? &useragent2_vendorKM : &_useragent2_setprefs; } useragent2_vendor0{ macroinfo="Delete prefs ''general.useragent.vendor''"; menuchecked=(getpref(STRING,"general.useragent.vendor")==""); $ua2_vendor=""; $ua2_vensub=""; &_useragent2_setprefs; } _useragent2_setprefs{ setpref(STRING,"general.useragent.vendor",$ua2_vendor); setpref(STRING,"general.useragent.vendorSub",$ua2_vensub); } useragent2_check{ macroinfo="View current user agent and vendor settings"; alert(getpref(STRING,"general.useragent.override")."\n\ngeneral.useragent.vendor + vendorsub: ".getpref(STRING,"general.useragent.vendor")." ".getpref(STRING,"general.useragent.vendorSub"),"View current UA settings (can also be set and checked in about:config)"); } useragent2_help{ alert("(help under construction yet ;-)\n\nFor now take this for easier experimenting with getting nasty websites to work.\nAt each browser restart the vendor setting will be reset to K-Meleon.\n\nIf you want to change the vendor strings automatically when switching User Agents, insert this in the last line (ca. L42) of the submacro ''_UserAgent'', in macro useragent.kmm (perhaps with a comment line before, starting with #):\n\n&useragent2_vendorXY;\n\nTIP: Check on a site like www.browserspy.dk how much your settings reveal!","help"); } _useragent2_BuildMenu{ setmenu("&User Agent",separator,-1); setmenu("&User Agent",macro,"Set Vendor: K-Meleon",useragent2_vendorKM,-1); setmenu("&User Agent",macro,"Set Vendor: User Agent",useragent2_vendorXY,-1); setmenu("&User Agent",macro,"Set Vendor: --",useragent2_vendor0,-1); setmenu("&User Agent",macro,"View Settings",useragent2_check,-1); setmenu("&User Agent",macro,"Help",useragent2_help,-1); } #------------------------ BROWSER START -------------------- # Reset vendor to K-Meleon at browser start. To avoid this, set a # in front of the next line: $OnInit=$OnInit."useragent2_vendorKM;"; $OnInit=$OnInit."_useragent2_BuildMenu;"; $macroModules=$macroModules."useragent2;"; [/color][/quote]
[Please Enable JavaScript]
K-Meleon forum is powered by
Phorum
.
Home/News
Screenshots
Download
Documentation
Resources
Get Involved
Forum
Bugs
Development