Advertisement
Guest User

Untitled

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