Remove All as a single click button on the toolbar

4 posts, 0 answers
  1. Tony
    Tony avatar
    18 posts
    Member since:
    Sep 2014

    Posted 28 Aug 2015 Link to this post

    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.
  2. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 31 Aug 2015 Link to this post

    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
  3. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 31 Aug 2015 Link to this post

    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
  4. Tony
    Tony avatar
    18 posts
    Member since:
    Sep 2014

    Posted 01 Sep 2015 in reply to Eric Lawrence Link to this post

    Thanks. It worked. I had to uncomment the function and comment out the messagebox and opening of IE.
Back to Top