官方版

Add Rules to Fiddler

Customize Rules

To add custom columns to the Fiddler UI, modify requests or responses, test application performance, and a variety of other custom tasks, add rules to Fiddler’s JScript.NET CustomRules.js file in FiddlerScript.

  1. Click Rules > Customize Rules….
  2. Enter FiddlerScript code inside the appropriate function.
  3. Save the file.

Fiddler will automatically reload the rules.

Use Additional .NET Assemblies

To use additional .NET assemblies in your script:

  1. Click Tools > Fiddler Options.
  2. Click the Extensions tab.
  3. Edit the References list.
  4. Either:
    • Register the assembly in the GAC; or
    • Copy the assembly to the folder that contains Fiddler.exe.

To use the new assembly’s functions without fully-qualifying them, update the #import clause at the top of the script.

Change the JScript Editor Launched from the Rules Menu

  1. Click Tools > Fiddler Options.
  2. Edit the Editor string.

    Restore Default Rules

  3. Delete the CustomRules.js file in ~/Documents/Fiddler2/Scripts.

  4. Restart Fiddler.

Note: Fiddler’s default rules are stored in ~/Program Files/Fiddler2/Scripts/SampleRules.js.

谷歌翻译版

为Fiddler添加规则

Customize Rules

要将自定义列添加到Fiddler UI,修改请求或响应,测试应用程序性能以及各种其他自定义任务,请在FiddlerScript中向Fiddler的JScript.NET CustomRules.js文件添加规则。

  1. 点击 Rules > Customize Rules….
  2. 在适当的函数内输入FiddlerScript代码。
  3. 保存这个文件。

Fiddler将自动重新加载规则。

使用其他.NET程序集

要在脚本中使用其他.NET程序集,请执行以下操作:

  1. 点击 Tools > Fiddler Options.
  2. 单击 Extensions 选项卡.
  3. 编写 References 列表.
  4. 要么:
    • 在GAC中注册程序集; 要么
    • 将程序集复制到包含Fiddler.exe的文件夹中。

要在不完全限定新程序集功能的情况下使用它们,请更新脚本顶部的#import子句。

更改从Rules菜单启动的JScript编辑器

  1. 点击 Tools > Fiddler Options。
  2. 编辑 Editor 字符串。

    恢复默认的Rules

  3. 删除〜/ Documents / Fiddler2 / Scripts中的CustomRules.js文件。

  4. 重新启动Fiddler

注意:Fiddler的默认规则存储在〜/ Program Files / Fiddler2 / Scripts / SampleRules.js中。