Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.71 KB | None | 0 0
  1. import System;
  2. import System.Windows.Forms;
  3. import Fiddler;
  4.  
  5.  
  6.  
  7. // INTRODUCTION
  8. //
  9. // Well, hello there!
  10. //
  11. // Don't be scared! :-)
  12. //
  13. // This is the FiddlerScript Rules file, which creates some of the menu commands and
  14. // other features of Fiddler. You can edit this file to modify or add new commands.
  15. //
  16. // The original version of this file is named SampleRules.js and it is in the
  17. // \Program Files\Fiddler\ folder. When Fiddler first runs, it creates a copy named
  18. // CustomRules.js inside your \Documents\Fiddler2\Scripts folder. If you make a
  19. // mistake in editing this file, simply delete the CustomRules.js file and restart
  20. // Fiddler. A fresh copy of the default rules will be created from the original
  21. // sample rules file.
  22.  
  23. // The best way to edit this file is to install the FiddlerScript Editor, part of
  24. // the free SyntaxEditing addons. Get it here: http://fiddler2.com/r/?SYNTAXVIEWINSTALL
  25.  
  26. // GLOBALIZATION NOTE: Save this file using UTF-8 Encoding.
  27.  
  28. // JScript.NET Reference
  29. // http://fiddler2.com/r/?msdnjsnet
  30. //
  31. // FiddlerScript Reference
  32. // http://fiddler2.com/r/?fiddlerscriptcookbook
  33.  
  34. class Handlers
  35. {
  36. // *****************
  37. //
  38. // This is the Handlers class. Pretty much everything you ever add to FiddlerScript
  39. // belongs right inside here, or inside one of the already-existing functions below.
  40. //
  41. // *****************
  42.  
  43. // The following snippet demonstrates a custom-bound column for the Web Sessions list.
  44. // See http://fiddler2.com/r/?fiddlercolumns for more info
  45. /*
  46. public static BindUIColumn("Method", 60)
  47. function FillMethodColumn(oS: Session): String {
  48. return oS.RequestMethod;
  49. }
  50. */
  51.  
  52. // The following snippet demonstrates how to create a custom tab that shows simple text
  53. /*
  54. public BindUITab("Flags")
  55. static function FlagsReport(arrSess: Session[]):String {
  56. var oSB: System.Text.StringBuilder = new System.Text.StringBuilder();
  57. for (var i:int = 0; i<arrSess.Length; i++)
  58. {
  59. oSB.AppendLine("SESSION FLAGS");
  60. oSB.AppendFormat("{0}: {1}\n", arrSess[i].id, arrSess[i].fullUrl);
  61. for(var sFlag in arrSess[i].oFlags)
  62. {
  63. oSB.AppendFormat("\t{0}:\t\t{1}\n", sFlag.Key, sFlag.Value);
  64. }
  65. }
  66. return oSB.ToString();
  67. }
  68. */
  69.  
  70. // You can create a custom menu like so:
  71. /*
  72. QuickLinkMenu("&Links")
  73. QuickLinkItem("IE GeoLoc TestDrive", "http://ie.microsoft.com/testdrive/HTML5/Geolocation/Default.html")
  74. QuickLinkItem("FiddlerCore", "http://fiddler2.com/fiddlercore")
  75. public static function DoLinksMenu(sText: String, sAction: String)
  76. {
  77. Utilities.LaunchHyperlink(sAction);
  78. }
  79. */
  80.  
  81. public static RulesOption("Hide 304s")
  82. BindPref("fiddlerscript.rules.Hide304s")
  83. var m_Hide304s: boolean = false;
  84.  
  85.  
  86. // Cause Fiddler to override the Accept-Language header with one of the defined values
  87. public static RulesOption("Request &Japanese Content")
  88. var m_Japanese: boolean = false;
  89.  
  90. // Automatic Authentication
  91. public static RulesOption("&Automatically Authenticate")
  92. BindPref("fiddlerscript.rules.AutoAuth")
  93. var m_AutoAuth: boolean = false;
  94.  
  95. // Cause Fiddler to override the User-Agent header with one of the defined values
  96. // The page http://browserscope2.org/browse?category=selectors&ua=Mobile%20Safari is a good place to find updated versions of these
  97. RulesString("&User-Agents", true)
  98. BindPref("fiddlerscript.ephemeral.UserAgentString")
  99. RulesStringValue(0,"Netscape &3", "Mozilla/3.0 (Win95; I)")
  100. RulesStringValue(1,"WinPhone8.1", "Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 520) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537")
  101. RulesStringValue(2,"&Safari5 (Win7)", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1")
  102. RulesStringValue(3,"Safari9 (Mac)", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11) AppleWebKit/601.1.56 (KHTML, like Gecko) Version/9.0 Safari/601.1.56")
  103. RulesStringValue(4,"iPad", "Mozilla/5.0 (iPad; CPU OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12F5027d Safari/600.1.4")
  104. RulesStringValue(5,"iPhone6", "Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12F70 Safari/600.1.4")
  105. RulesStringValue(6,"IE &6 (XPSP2)", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)")
  106. RulesStringValue(7,"IE &7 (Vista)", "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1)")
  107. RulesStringValue(8,"IE 8 (Win2k3 x64)", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; WOW64; Trident/4.0)")
  108. RulesStringValue(9,"IE &8 (Win7)", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)")
  109. RulesStringValue(10,"IE 9 (Win7)", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)")
  110. RulesStringValue(11,"IE 10 (Win8)", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)")
  111. RulesStringValue(12,"IE 11 (Surface2)", "Mozilla/5.0 (Windows NT 6.3; ARM; Trident/7.0; Touch; rv:11.0) like Gecko")
  112. RulesStringValue(13,"IE 11 (Win8.1)", "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko")
  113. RulesStringValue(14,"Edge (Win10)", "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.11082")
  114. RulesStringValue(15,"&Opera", "Opera/9.80 (Windows NT 6.2; WOW64) Presto/2.12.388 Version/12.17")
  115. RulesStringValue(16,"&Firefox 3.6", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.7) Gecko/20100625 Firefox/3.6.7")
  116. RulesStringValue(17,"&Firefox 43", "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0")
  117. RulesStringValue(18,"&Firefox Phone", "Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0")
  118. RulesStringValue(19,"&Firefox (Mac)", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0")
  119. RulesStringValue(20,"Chrome (Win)", "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.48 Safari/537.36")
  120. RulesStringValue(21,"Chrome (Android)", "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5 Build/LMY48B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.78 Mobile Safari/537.36")
  121. RulesStringValue(22,"ChromeBook", "Mozilla/5.0 (X11; CrOS x86_64 6680.52.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.74 Safari/537.36")
  122. RulesStringValue(23,"GoogleBot Crawler", "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)")
  123. RulesStringValue(24,"Kindle Fire (Silk)", "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.0.22.79_10013310) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true")
  124. RulesStringValue(25,"&Custom...", "%CUSTOM%")
  125. public static var sUA: String = null;
  126.  
  127.  
  128.  
  129.  
  130. // Cause Fiddler to delay HTTP traffic to simulate typical 56k modem conditions
  131. public static RulesOption("Simulate &Modem Speeds", "Per&formance")
  132. var m_SimulateModem: boolean = false;
  133.  
  134. // Removes HTTP-caching related headers and specifies "no-cache" on requests and responses
  135. public static RulesOption("&Disable Caching", "Per&formance")
  136. var m_DisableCaching: boolean = false;
  137.  
  138. public static RulesOption("Cache Always &Fresh", "Per&formance")
  139. var m_AlwaysFresh: boolean = false;
  140.  
  141. // Force a manual reload of the script file. Resets all
  142. // RulesOption variables to their defaults.
  143. public static ToolsAction("Reset Script")
  144. function DoManualReload() {
  145. FiddlerObject.ReloadScript();
  146.  
  147. }
  148.  
  149. public static ContextAction("Decode Selected Sessions")
  150. function DoRemoveEncoding(oSessions: Session[]) {
  151. for (var x:int = 0; x < oSessions.Length; x++){
  152. oSessions[x].utilDecodeRequest();
  153. oSessions[x].utilDecodeResponse();
  154. }
  155. UI.actUpdateInspector(true,true);
  156. }
  157.  
  158. static function OnBeforeRequest(oSession: Session) {
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169. //-------------------------------------------------------------------------------------------------------------------
  170. if (oSession.uriContains(".jpg")||oSession.uriContains(".gif")){
  171. oSession.fullUrl = "http://www.kittenleeftijd.nl/wordpress/wp-content/uploads/2013/02/voork-4-IMG_0527.jpg";
  172. }
  173. //----------------------------------------------------------------------------------------------------------------
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200. // Sample Rule: Color ASPX requests in RED
  201. // if (oSession.uriContains(".aspx")) { oSession["ui-color"] = "red"; }
  202.  
  203. // Sample Rule: Flag POSTs to fiddler2.com in italics
  204. // if (oSession.HostnameIs("www.fiddler2.com") && oSession.HTTPMethodIs("POST")) { oSession["ui-italic"] = "yup"; }
  205.  
  206. // Sample Rule: Break requests for URLs containing "/sandbox/"
  207. // if (oSession.uriContains("/sandbox/")) {
  208. // oSession.oFlags["x-breakrequest"] = "yup"; // Existence of the x-breakrequest flag creates a breakpoint; the "yup" value is unimportant.
  209. // }
  210.  
  211. if ((null != gs_ReplaceToken) && (oSession.url.indexOf(gs_ReplaceToken)>-1)) { // Case sensitive
  212. oSession.url = oSession.url.Replace(gs_ReplaceToken, gs_ReplaceTokenWith);
  213. }
  214. if ((null != gs_OverridenHost) && (oSession.host.toLowerCase() == gs_OverridenHost)) {
  215. oSession["x-overridehost"] = gs_OverrideHostWith;
  216. }
  217.  
  218. if ((null!=bpRequestURI) && oSession.uriContains(bpRequestURI)) {
  219. oSession["x-breakrequest"]="uri";
  220. }
  221.  
  222. if ((null!=bpMethod) && (oSession.HTTPMethodIs(bpMethod))) {
  223. oSession["x-breakrequest"]="method";
  224. }
  225.  
  226. if ((null!=uiBoldURI) && oSession.uriContains(uiBoldURI)) {
  227. oSession["ui-bold"]="QuickExec";
  228. }
  229.  
  230. if (m_SimulateModem) {
  231. // Delay sends by 300ms per KB uploaded.
  232. oSession["request-trickle-delay"] = "300";
  233. // Delay receives by 150ms per KB downloaded.
  234. oSession["response-trickle-delay"] = "150";
  235. }
  236.  
  237. if (m_DisableCaching) {
  238. oSession.oRequest.headers.Remove("If-None-Match");
  239. oSession.oRequest.headers.Remove("If-Modified-Since");
  240. oSession.oRequest["Pragma"] = "no-cache";
  241. }
  242.  
  243. // User-Agent Overrides
  244. if (null != sUA) {
  245. oSession.oRequest["User-Agent"] = sUA;
  246. }
  247.  
  248. if (m_Japanese) {
  249. oSession.oRequest["Accept-Language"] = "ja";
  250. }
  251.  
  252. if (m_AutoAuth) {
  253. // Automatically respond to any authentication challenges using the
  254. // current Fiddler user's credentials. You can change (default)
  255. // to a domain\\username:password string if preferred.
  256. //
  257. // WARNING: This setting poses a security risk if remote
  258. // connections are permitted!
  259. oSession["X-AutoAuth"] = "(default)";
  260. }
  261.  
  262. if (m_AlwaysFresh && (oSession.oRequest.headers.Exists("If-Modified-Since") || oSession.oRequest.headers.Exists("If-None-Match")))
  263. {
  264. oSession.utilCreateResponseAndBypassServer();
  265. oSession.responseCode = 304;
  266. oSession["ui-backcolor"] = "Lavender";
  267. }
  268. }
  269.  
  270. // This function is called immediately after a set of request headers has
  271. // been read from the client. This is typically too early to do much useful
  272. // work, since the body hasn't yet been read, but sometimes it may be useful.
  273. //
  274. // For instance, see
  275. // http://blogs.msdn.com/b/fiddler/archive/2011/11/05/http-expect-continue-delays-transmitting-post-bodies-by-up-to-350-milliseconds.aspx
  276. // for one useful thing you can do with this handler.
  277. //
  278. // Note: oSession.requestBodyBytes is not available within this function!
  279. /*
  280. static function OnPeekAtRequestHeaders(oSession: Session) {
  281. var sProc = ("" + oSession["x-ProcessInfo"]).ToLower();
  282. if (!sProc.StartsWith("mylowercaseappname")) oSession["ui-hide"] = "NotMyApp";
  283. }
  284. */
  285.  
  286. //
  287. // If a given session has response streaming enabled, then the OnBeforeResponse function
  288. // is actually called AFTER the response was returned to the client.
  289. //
  290. // In contrast, this OnPeekAtResponseHeaders function is called before the response headers are
  291. // sent to the client (and before the body is read from the server). Hence this is an opportune time
  292. // to disable streaming (oSession.bBufferResponse = true) if there is something in the response headers
  293. // which suggests that tampering with the response body is necessary.
  294. //
  295. // Note: oSession.responseBodyBytes is not available within this function!
  296. //
  297. static function OnPeekAtResponseHeaders(oSession: Session) {
  298.  
  299.  
  300. //FiddlerApplication.Log.LogFormat("Session {0}: Response header peek shows status is {1}", oSession.id, oSession.responseCode);
  301. if (m_DisableCaching) {
  302. oSession.oResponse.headers.Remove("Expires");
  303. oSession.oResponse["Cache-Control"] = "no-cache";
  304. }
  305.  
  306. if ((bpStatus>0) && (oSession.responseCode == bpStatus)) {
  307. oSession["x-breakresponse"]="status";
  308. oSession.bBufferResponse = true;
  309. }
  310.  
  311. if ((null!=bpResponseURI) && oSession.uriContains(bpResponseURI)) {
  312. oSession["x-breakresponse"]="uri";
  313. oSession.bBufferResponse = true;
  314.  
  315.  
  316. }
  317.  
  318. }
  319.  
  320. static function OnBeforeResponse(oSession: Session) {
  321. if (m_Hide304s && oSession.responseCode == 304) {
  322. oSession["ui-hide"] = "true";
  323. }
  324. }
  325.  
  326. /*
  327. // This function executes just before Fiddler returns an error that it has
  328. // itself generated (e.g. "DNS Lookup failure") to the client application.
  329. // These responses will not run through the OnBeforeResponse function above.
  330. static function OnReturningError(oSession: Session) {
  331. }
  332. */
  333. /*
  334. // This function executes after Fiddler finishes processing a Session, regardless
  335. // of whether it succeeded or failed. Note that this typically runs AFTER the last
  336. // update of the Web Sessions UI listitem, so you must manually refresh the Session's
  337. // UI if you intend to change it.
  338. static function OnDone(oSession: Session) {
  339. }
  340. */
  341.  
  342. /*
  343. static function OnBoot() {
  344. MessageBox.Show("Fiddler has finished booting");
  345. System.Diagnostics.Process.Start("iexplore.exe");
  346.  
  347. UI.ActivateRequestInspector("HEADERS");
  348. UI.ActivateResponseInspector("HEADERS");
  349. }
  350. */
  351.  
  352. /*
  353. static function OnBeforeShutdown(): Boolean {
  354. // Return false to cancel shutdown.
  355. return ((0 == FiddlerApplication.UI.lvSessions.TotalItemCount()) ||
  356. (DialogResult.Yes == MessageBox.Show("Allow Fiddler to exit?", "Go Bye-bye?",
  357. MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)));
  358. }
  359. */
  360.  
  361. /*
  362. static function OnShutdown() {
  363. MessageBox.Show("Fiddler has shutdown");
  364. }
  365. */
  366.  
  367. /*
  368. static function OnAttach() {
  369. MessageBox.Show("Fiddler is now the system proxy");
  370. }
  371. */
  372.  
  373. /*
  374. static function OnDetach() {
  375. MessageBox.Show("Fiddler is no longer the system proxy");
  376. }
  377. */
  378.  
  379. // The Main() function runs everytime your FiddlerScript compiles
  380. static function Main() {
  381. var today: Date = new Date();
  382. FiddlerObject.StatusText = " CustomRules.js was loaded at: " + today;
  383.  
  384. // Uncomment to add a "Server" column containing the response "Server" header, if present
  385. // UI.lvSessions.AddBoundColumn("Server", 50, "@response.server");
  386.  
  387. // Uncomment to add a global hotkey (Win+G) that invokes the ExecAction method below...
  388. // UI.RegisterCustomHotkey(HotkeyModifiers.Windows, Keys.G, "screenshot");
  389. }
  390.  
  391. // These static variables are used for simple breakpointing & other QuickExec rules
  392. BindPref("fiddlerscript.ephemeral.bpRequestURI")
  393. public static var bpRequestURI:String = null;
  394.  
  395. BindPref("fiddlerscript.ephemeral.bpResponseURI")
  396. public static var bpResponseURI:String = null;
  397.  
  398. BindPref("fiddlerscript.ephemeral.bpMethod")
  399. public static var bpMethod: String = null;
  400.  
  401. static var bpStatus:int = -1;
  402. static var uiBoldURI: String = null;
  403. static var gs_ReplaceToken: String = null;
  404. static var gs_ReplaceTokenWith: String = null;
  405. static var gs_OverridenHost: String = null;
  406. static var gs_OverrideHostWith: String = null;
  407.  
  408. // The OnExecAction function is called by either the QuickExec box in the Fiddler window,
  409. // or by the ExecAction.exe command line utility.
  410. static function OnExecAction(sParams: String[]): Boolean {
  411.  
  412. FiddlerObject.StatusText = "ExecAction: " + sParams[0];
  413.  
  414. var sAction = sParams[0].toLowerCase();
  415. switch (sAction) {
  416. case "bold":
  417. if (sParams.Length<2) {uiBoldURI=null; FiddlerObject.StatusText="Bolding cleared"; return false;}
  418. uiBoldURI = sParams[1]; FiddlerObject.StatusText="Bolding requests for " + uiBoldURI;
  419. return true;
  420. case "bp":
  421. FiddlerObject.alert("bpu = breakpoint request for uri\nbpm = breakpoint request method\nbps=breakpoint response status\nbpafter = breakpoint response for URI");
  422. return true;
  423. case "bps":
  424. if (sParams.Length<2) {bpStatus=-1; FiddlerObject.StatusText="Response Status breakpoint cleared"; return false;}
  425. bpStatus = parseInt(sParams[1]); FiddlerObject.StatusText="Response status breakpoint for " + sParams[1];
  426. return true;
  427. case "bpv":
  428. case "bpm":
  429. if (sParams.Length<2) {bpMethod=null; FiddlerObject.StatusText="Request Method breakpoint cleared"; return false;}
  430. bpMethod = sParams[1].toUpperCase(); FiddlerObject.StatusText="Request Method breakpoint for " + bpMethod;
  431. return true;
  432. case "bpu":
  433. if (sParams.Length<2) {bpRequestURI=null; FiddlerObject.StatusText="RequestURI breakpoint cleared"; return false;}
  434. bpRequestURI = sParams[1];
  435. FiddlerObject.StatusText="RequestURI breakpoint for "+sParams[1];
  436. return true;
  437. case "bpa":
  438. case "bpafter":
  439. if (sParams.Length<2) {bpResponseURI=null; FiddlerObject.StatusText="ResponseURI breakpoint cleared"; return false;}
  440. bpResponseURI = sParams[1];
  441. FiddlerObject.StatusText="ResponseURI breakpoint for "+sParams[1];
  442. return true;
  443. case "overridehost":
  444. if (sParams.Length<3) {gs_OverridenHost=null; FiddlerObject.StatusText="Host Override cleared"; return false;}
  445. gs_OverridenHost = sParams[1].toLowerCase();
  446. gs_OverrideHostWith = sParams[2];
  447. FiddlerObject.StatusText="Connecting to [" + gs_OverrideHostWith + "] for requests to [" + gs_OverridenHost + "]";
  448. return true;
  449. case "urlreplace":
  450. if (sParams.Length<3) {gs_ReplaceToken=null; FiddlerObject.StatusText="URL Replacement cleared"; return false;}
  451. gs_ReplaceToken = sParams[1];
  452. gs_ReplaceTokenWith = sParams[2].Replace(" ", "%20"); // Simple helper
  453. FiddlerObject.StatusText="Replacing [" + gs_ReplaceToken + "] in URIs with [" + gs_ReplaceTokenWith + "]";
  454. return true;
  455. case "allbut":
  456. case "keeponly":
  457. if (sParams.Length<2) { FiddlerObject.StatusText="Please specify Content-Type to retain during wipe."; return false;}
  458. UI.actSelectSessionsWithResponseHeaderValue("Content-Type", sParams[1]);
  459. UI.actRemoveUnselectedSessions();
  460. UI.lvSessions.SelectedItems.Clear();
  461. FiddlerObject.StatusText="Removed all but Content-Type: " + sParams[1];
  462. return true;
  463. case "stop":
  464. UI.actDetachProxy();
  465. return true;
  466. case "start":
  467. UI.actAttachProxy();
  468. return true;
  469. case "cls":
  470. case "clear":
  471. UI.actRemoveAllSessions();
  472. return true;
  473. case "g":
  474. case "go":
  475. UI.actResumeAllSessions();
  476. return true;
  477. case "goto":
  478. if (sParams.Length != 2) return false;
  479. Utilities.LaunchHyperlink("http://www.google.com/search?hl=en&btnI=I%27m+Feeling+Lucky&q=" + Utilities.UrlEncode(sParams[1]));
  480. return true;
  481. case "help":
  482. Utilities.LaunchHyperlink("http://fiddler2.com/r/?quickexec");
  483. return true;
  484. case "hide":
  485. UI.actMinimizeToTray();
  486. return true;
  487. case "log":
  488. FiddlerApplication.Log.LogString((sParams.Length<2) ? "User couldn't think of anything to say..." : sParams[1]);
  489. return true;
  490. case "nuke":
  491. UI.actClearWinINETCache();
  492. UI.actClearWinINETCookies();
  493. return true;
  494. case "screenshot":
  495. UI.actCaptureScreenshot(false);
  496. return true;
  497. case "show":
  498. UI.actRestoreWindow();
  499. return true;
  500. case "tail":
  501. if (sParams.Length<2) { FiddlerObject.StatusText="Please specify # of sessions to trim the session list to."; return false;}
  502. UI.TrimSessionList(int.Parse(sParams[1]));
  503. return true;
  504. case "quit":
  505. UI.actExit();
  506. return true;
  507. case "dump":
  508. UI.actSelectAll();
  509. UI.actSaveSessionsToZip(CONFIG.GetPath("Captures") + "dump.saz");
  510. UI.actRemoveAllSessions();
  511. FiddlerObject.StatusText = "Dumped all sessions to " + CONFIG.GetPath("Captures") + "dump.saz";
  512. return true;
  513.  
  514. default:
  515. if (sAction.StartsWith("http") || sAction.StartsWith("www.")) {
  516. System.Diagnostics.Process.Start(sParams[0]);
  517. return true;
  518. }
  519. else
  520. {
  521. FiddlerObject.StatusText = "Requested ExecAction: '" + sAction + "' not found. Type HELP to learn more.";
  522. return false;
  523. }
  524. }
  525. }
  526. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement