This is a migrated thread and some comments may be shown as answers.

Remove All as a single click button on the toolbar

3 Answers 243 Views
Windows
This is a migrated thread and some comments may be shown as answers.
Tony
Top achievements
Rank 1
Tony asked on 28 Aug 2015, 09:37 PM
Clearing the traffic pane is one of the most used actions I take in Fiddler. Is there a way to have a single click button on the toolbar for it (Instead of clicking then selecting from the dropdown)? It doesn't look like the toolbar is customizable. I know ctrl-x does the same.

3 Answers, 1 is accepted

Sort by
0
Eric Lawrence
Telerik team
answered on 31 Aug 2015, 03:04 PM
No, there's presently no exposed mechanism to add new commands to the toolbar. Either Ctrl+X or "Remove all" from dropdown.

Having said that...

Fiddler's object model is arguably "too" powerful, so you can hack your own stuff pretty much anywhere. Note that this is explicitly not recommended and if I catch anyone doing this with an extension they're distributing publicly I'm liable to break it on purpose.

Click Rules > Customize Rules. Scroll to OnBoot() and add the following code inside it:

        try {
            for (var c in FiddlerApplication.UI.Controls)
            {
                if (c.GetType().Name == "ToolStrip")
                {
                    var ts: ToolStrip = c;
                    var tsi: ToolStripButton = new ToolStripButton("BYE!");
                    tsi.add_Click(RemoveAll)
                    ts.Items.Insert(0, tsi);
                }
            }
        } catch(e) { FiddlerApplication.Log.LogString(e); }

        

Then, just before OnBoot, add the following code:

    static function RemoveAll(s: Object, e: EventArgs)
    {
        FiddlerApplication.UI.lvSessions.Clear();                   
    }


Restart Fiddler and your new button appears.

Regards,
Eric Lawrence
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Eric Lawrence
Telerik team
answered on 31 Aug 2015, 06:19 PM
Correction, that RemoveAll function should instead look like:

    static function RemoveAll(s: Object, e: EventArgs)
    {
        FiddlerApplication.UI.actRemoveAllSessions();
    }

Sorry for the inconvenience,
Eric Lawrence
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Tony
Top achievements
Rank 1
answered on 01 Sep 2015, 06:43 AM
Thanks. It worked. I had to uncomment the function and comment out the messagebox and opening of IE.
Tags
Windows
Asked by
Tony
Top achievements
Rank 1
Answers by
Eric Lawrence
Telerik team
Tony
Top achievements
Rank 1
Share this question
or